若有安裝色情守門員,可用無界、自由門等軟件瀏覽伊莉。或使用以下網址瀏覽伊莉: http://www.eyny.com:81/index.php
本帖最後由 ggnnyy 於 2018-6-20 10:49 PM 編輯
各位大大好:
想請問以下兩種程式碼實作的差別以及優缺點??- public class EmailService
- {
- public void SendMessage()
- {
- //...
- }
- }
- public class NotificationSystem
- {
- private EmailService svc;
- public NotificationSystem()
- {
- svc = new EmailService();
- }
- public void InterestingEventHappend()
- {
- svc.SendMessage();
- }
- }
複製代碼 以及以下沒有用構造函數創建- public class EmailService
- {
- public void SendMessage()
- {
- //...
- }
- }
- public class NotificationSystem
- {
- private EmailService svc = new EmailService();
- public void InterestingEventHappend()
- {
- svc.SendMessage();
- }
- }
複製代碼
... |