<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gd="http://schemas.google.com/g/2005"><id>tag:blogger.com,1999:blog-4500363753981919783.post9117297959636151237..comments</id><updated>2023-10-03T22:06:50.708+08:00</updated><title type='text'>Comments on Huan-Lin 學習筆記: 《.NET 相依性注入》第 3 章可公開的情報</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://www.huanlintalk.com/feeds/comments/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/9117297959636151237/comments/default'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2014/06/di-book-chapter-3-map.html'/><link rel="hub" href="http://pubsubhubbub.appspot.com/"/><author><name>Michael Tsai</name><uri>http://www.blogger.com/profile/00364693770445538641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-2984974676466753928</id><published>2014-06-20T11:13:12.448+08:00</published><updated>2014-06-20T11:13:12.448+08:00</updated><title type='text'>嗯...我不確定我是否真正了解你碰到的困難。似乎,Unity 載入特定組態區段,這部分目前仍沒解決?...</title><content type='html'>嗯...我不確定我是否真正了解你碰到的困難。似乎,Unity 載入特定組態區段,這部分目前仍沒解決?<br />另一個部分,有關獨立 DLL 模組的設計,要讓 Host 專案不需要引用 Unity 的類別參考。我想問的是,你有試過寫一個單獨的 Class Library 專門用來處理物件組合的工作嗎?例如叫做 BootStrapper.dll,這個模組只做型別註冊和物件組合等工作。然後,在應用程式的進入點呼叫此模組來組合物件。這個部分可能得用實際的範例程式來討論可能比較具體些。</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/9117297959636151237/comments/default/2984974676466753928'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/9117297959636151237/comments/default/2984974676466753928'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2014/06/di-book-chapter-3-map.html?showComment=1403233992448#c2984974676466753928' title=''/><author><name>Michael Tsai</name><uri>https://www.blogger.com/profile/00364693770445538641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.huanlintalk.com/2014/06/di-book-chapter-3-map.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-9117297959636151237' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/9117297959636151237' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1825873726"/><gd:extendedProperty name="blogger.displayTime" value="2014/6/20 上午11:13"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-6661176046336776100</id><published>2014-06-19T10:22:51.698+08:00</published><updated>2014-06-19T10:22:51.698+08:00</updated><title type='text'>老師您好,謝謝回覆。我目前是有在WebForms應用程式區分出商業邏輯層和資料存取層的觀念。實作上也...</title><content type='html'>老師您好,謝謝回覆。我目前是有在WebForms應用程式區分出商業邏輯層和資料存取層的觀念。實作上也分成不同的.net Class Library專案。DI 解決方案我是先試著使用Unity。<br /><br />我的設計方式是WebForms應用程式叫用介面,由Unity去找到商業邏輯層的DLL。<br />如要做資料庫存取時,由商業邏輯層DLL叫用介面,由Unity去找到資料存取層的DLL。實際的資料存取技術是用ADO.NET。<br />所有的 Unity 容器的型別對應,都是在組態檔來設定。<br /><br />之前我希望我的Class Library專案未來可以獨立被使用,<br />所以我有參考您之前的文章【讓 DLL 組件讀取自己的組態檔】試圖去分開DLL的組態設定。<br />http://huan-lin.blogspot.com/2012/04/assembly-config.html<br /><br />後來我在【商業邏輯層DLL叫用介面,由Unity去找到資料存取層的DLL】這段有遇到困難。<br />我找不到如何在Class Library專案中,有效處理以下語句的方式。<br />_section = ConfigurationManager.GetSection(&quot;unity&quot;);<br />_container.LoadConfiguration(_section, &quot;Container&quot;);<br /><br />後來只有在單元測試專案中,定義App.Config,並在單元測試專案中去處理上述語句,才得以通過。<br /><br />不知道是不是我的思維有錯。我是希望能夠設計獨立的DLL,它可以去獨立運作載入Unity以叫用其他DLL,這樣子Host 就不用去知道它是用什麼方式去存取其他DLL的;也就是Host專案(不限WebForms/MVC/Windows Form)不一定要引用Unity的類別參考。<br />這部份也想聽聽老師的想法。謝謝。<br /><br /><br /><br /><br /><br /></content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/9117297959636151237/comments/default/6661176046336776100'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/9117297959636151237/comments/default/6661176046336776100'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2014/06/di-book-chapter-3-map.html?showComment=1403144571698#c6661176046336776100' title=''/><author><name>Ziegfeld</name><uri>https://www.blogger.com/profile/12349421294529662604</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.huanlintalk.com/2014/06/di-book-chapter-3-map.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-9117297959636151237' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/9117297959636151237' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1491261770"/><gd:extendedProperty name="blogger.displayTime" value="2014/6/19 上午10:22"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-5908721329725772347</id><published>2014-06-19T09:03:44.505+08:00</published><updated>2014-06-19T09:03:44.505+08:00</updated><title type='text'>Hi Ziegfeld, 目前還沒有特別規劃 web forms 的部分耶。Web forms 應用...</title><content type='html'>Hi Ziegfeld, 目前還沒有特別規劃 web forms 的部分耶。Web forms 應用程式也是可以區分商業邏輯層和資料存取層,在概念上是相似的,實作上可能會碰到一些麻煩。你目前已經有為 web forms 應用程式分層嗎?或者有碰到什麼問題?如果可以具體描述一下,也許可以互相討論、研究看看。</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/9117297959636151237/comments/default/5908721329725772347'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/9117297959636151237/comments/default/5908721329725772347'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2014/06/di-book-chapter-3-map.html?showComment=1403139824505#c5908721329725772347' title=''/><author><name>Michael Tsai</name><uri>https://www.blogger.com/profile/00364693770445538641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.huanlintalk.com/2014/06/di-book-chapter-3-map.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-9117297959636151237' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/9117297959636151237' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1825873726"/><gd:extendedProperty name="blogger.displayTime" value="2014/6/19 上午9:03"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-76264879789041702</id><published>2014-06-19T08:38:44.608+08:00</published><updated>2014-06-19T08:38:44.608+08:00</updated><title type='text'>老師您好,請問是否會介紹DI 與ASP.NET Webform 的分層架構建議?如果系統的建置規劃上...</title><content type='html'>老師您好,請問是否會介紹DI 與ASP.NET Webform 的分層架構建議?如果系統的建置規劃上是採用多個assembly(dll),若要加入DI,是否有需特別注意的部份?謝謝指導。</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/9117297959636151237/comments/default/76264879789041702'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/9117297959636151237/comments/default/76264879789041702'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2014/06/di-book-chapter-3-map.html?showComment=1403138324608#c76264879789041702' title=''/><author><name>Ziegfeld</name><uri>https://www.blogger.com/profile/12349421294529662604</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.huanlintalk.com/2014/06/di-book-chapter-3-map.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-9117297959636151237' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/9117297959636151237' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1491261770"/><gd:extendedProperty name="blogger.displayTime" value="2014/6/19 上午8:38"/></entry></feed>