<?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.post5725866946975517405..comments</id><updated>2023-10-03T22:06:50.708+08:00</updated><title type='text'>Comments on Huan-Lin 學習筆記: Repository,我可能不會用你</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/5725866946975517405/comments/default'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.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>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-2984372978719668846</id><published>2014-10-13T20:06:37.151+08:00</published><updated>2014-10-13T20:06:37.151+08:00</updated><title type='text'>抱歉打錯字,上面的 &quot;MVC5+EF5&quot; 應是 &quot;MVC5+EF6&q...</title><content type='html'>抱歉打錯字,上面的 &quot;MVC5+EF5&quot; 應是 &quot;MVC5+EF6&quot;,</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/2984372978719668846'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/2984372978719668846'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1413201997151#c2984372978719668846' title=''/><link rel='related' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/23351812784014289'/><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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1825873726"/><gd:extendedProperty name="blogger.displayTime" value="2014/10/13 晚上8:06"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-23351812784014289</id><published>2014-10-13T20:04:05.911+08:00</published><updated>2014-10-13T20:04:05.911+08:00</updated><title type='text'>EF5 有 DbSet 耶。如果我沒理解錯,DbSet 應是從 EF 4.1 開始出現(DbCont...</title><content type='html'>EF5 有 DbSet 耶。如果我沒理解錯,DbSet 應是從 EF 4.1 開始出現(DbContext 和 DbQuery 也是)。<br />MVC5+EF5 教學範例之所以略過 Repository,背後的原因或許只是單純因為想要簡化練習步驟,或者是因為 Repository 的相關文章到處都找得到,不需要再重複了。不過猜想畢竟只是猜想。實務上,還是依個別專案的實際需要來決定是否採用。我的看法是若沒有需要、沒有為專案帶來明顯的好處,就不要加上 Repository 層。</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/23351812784014289'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/23351812784014289'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1413201845911#c23351812784014289' 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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1825873726"/><gd:extendedProperty name="blogger.displayTime" value="2014/10/13 晚上8:04"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-185958670391667734</id><published>2014-10-13T17:10:38.045+08:00</published><updated>2014-10-13T17:10:38.045+08:00</updated><title type='text'>我猜測MVC5+EF6抽掉Repository的原因,是因為先前EF5的版本需要Repository...</title><content type='html'>我猜測MVC5+EF6抽掉Repository的原因,是因為先前EF5的版本需要Repository做切換測試,但是EF6有了DbSet,,所以不需要利用Reposity也可以直接在記憶體測試??</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/185958670391667734'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/185958670391667734'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1413191438045#c185958670391667734' title=''/><author><name>Anonymous</name><uri>https://www.blogger.com/profile/04923951248563270397</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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1984471335"/><gd:extendedProperty name="blogger.displayTime" value="2014/10/13 下午5:10"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-4597755931150354406</id><published>2012-12-06T20:04:43.650+08:00</published><updated>2012-12-06T20:04:43.650+08:00</updated><title type='text'>了解,Thanks :)</title><content type='html'>了解,Thanks :)</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/4597755931150354406'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/4597755931150354406'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1354795483650#c4597755931150354406' 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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1825873726"/><gd:extendedProperty name="blogger.displayTime" value="2012/12/6 晚上8:04"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-6654220344218279179</id><published>2012-12-06T09:56:55.621+08:00</published><updated>2012-12-06T09:56:55.621+08:00</updated><title type='text'>在設計上會是一個 IRepository 介面,然後有多種 Repository 實作。
這裡面了設...</title><content type='html'>在設計上會是一個 IRepository 介面,然後有多種 Repository 實作。<br />這裡面了設計思路,是IRepository是為BLL服務,只提供BLL服務需要的功能。<br />以這樣的角度去思考,就能讓IRepository的設計範圍不發散。<br /><br />至於泛型Repository,我是比較少用到的設計,畢竟這樣的設計是以DAL層的角度來看待Repository。<br />通常會用的場合是在使用EF的場合下,EF已經幫忙建好提供CRUD的物件,<br />繼承這個物件並且讓這個物件實做IRepository,就能注入到BLL層,這樣是比較有可能會用到泛型Repository的情景。</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/6654220344218279179'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/6654220344218279179'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1354759015621#c6654220344218279179' title=''/><author><name>Clark</name><uri>https://www.blogger.com/profile/13902532235164838469</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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1874098437"/><gd:extendedProperty name="blogger.displayTime" value="2012/12/6 上午9:56"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-1568319661160643698</id><published>2012-12-05T22:05:14.805+08:00</published><updated>2012-12-05T22:05:14.805+08:00</updated><title type='text'>對於系統之外的各種資料來源....老實說這個部分我還有點疑問:是只定義一個 IRepository ...</title><content type='html'>對於系統之外的各種資料來源....老實說這個部分我還有點疑問:是只定義一個 IRepository 介面,然後有多種 Repository 實作,還是每碰到一種一種資料來源,就會有不同的 Repository 介面?<br />也就是說,是將 DRY 原則發揮到極致(也許是採用泛型 Repository?),還是只是要讓程式撰寫模型盡量趨於一致,這部分我欠缺實務經驗,只憑空想像,覺得似乎是後者的成分居多。<br />還看過一種說法:如果是關聯式資料庫,就使用 ORM;如果是非關聯式資料庫,則針對那類資料來源實作一個 DAO。其基本理念是:尊重底層儲存體的結構。<br />寫得有點多了....這些原本打算整理到下一篇筆記的。不過還是很高興聽到各種實戰經驗分享,很難得的。Thanks!!</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/1568319661160643698'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/1568319661160643698'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1354716314805#c1568319661160643698' 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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1825873726"/><gd:extendedProperty name="blogger.displayTime" value="2012/12/5 晚上10:05"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-6553015142101056340</id><published>2012-12-05T21:42:55.816+08:00</published><updated>2012-12-05T21:42:55.816+08:00</updated><title type='text'>嗯,Repository 作為隔離之用,合理。</title><content type='html'>嗯,Repository 作為隔離之用,合理。</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/6553015142101056340'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/6553015142101056340'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1354714975816#c6553015142101056340' 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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1825873726"/><gd:extendedProperty name="blogger.displayTime" value="2012/12/5 晚上9:42"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-2485255846590807758</id><published>2012-12-05T09:19:26.139+08:00</published><updated>2012-12-05T09:19:26.139+08:00</updated><title type='text'>Repository一開始的用意,的確只是隔離BLL與DAL,讓領域邏輯不相依DB。系統演進的過程中...</title><content type='html'>Repository一開始的用意,的確只是隔離BLL與DAL,讓領域邏輯不相依DB。系統演進的過程中就會發現,Repository除了隔離DB、讓BLL層更加的凝聚之外,也封裝的資料來源這個概念。<br /><br />也就是說系統之外的資料來源,都可以用Repository去隔離。例如說:別人的系統、公司內部的子系統、硬體設備,這些都可以當作DAL層的來源。</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/2485255846590807758'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/2485255846590807758'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1354670366139#c2485255846590807758' title=''/><author><name>Clark</name><uri>https://www.blogger.com/profile/13902532235164838469</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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1874098437"/><gd:extendedProperty name="blogger.displayTime" value="2012/12/5 上午9:19"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-4766593314871349730</id><published>2012-12-05T08:57:22.363+08:00</published><updated>2012-12-05T08:57:22.363+08:00</updated><title type='text'>IT Player, 我昨天才從一位老朋友那裏聽到一件正在發生的事情:原本用得好好的 Oracle,...</title><content type='html'>IT Player, 我昨天才從一位老朋友那裏聽到一件正在發生的事情:原本用得好好的 Oracle,客戶嫌她「太慢」,而開始慎重考慮把資料庫換成 Sybase。他們做的是專案,客戶說了算。或許真的世事難料,原本以為不可能替換的東西,還是有那麼一絲機率會發生 XD<br />至於把 Oracle 換成 Sybase 的原因是嫌 Oracle 太慢,這又是另一則故事(笑話)了 Orz</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/4766593314871349730'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/4766593314871349730'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1354669042363#c4766593314871349730' 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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1825873726"/><gd:extendedProperty name="blogger.displayTime" value="2012/12/5 上午8:57"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-4899971337608489953</id><published>2012-12-03T10:11:23.090+08:00</published><updated>2012-12-03T10:11:23.090+08:00</updated><title type='text'></title><content type='html'>作者已經移除這則留言。</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/4899971337608489953'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/4899971337608489953'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1354500683090#c4899971337608489953' title=''/><author><name>被軟體開發耽誤的廚工</name><uri>https://www.blogger.com/profile/00144958407872087293</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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name='blogger.contentRemoved' value='true'/><gd:extendedProperty name="blogger.itemClass" value="pid-218799269"/><gd:extendedProperty name="blogger.displayTime" value="2012/12/3 上午10:11"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-2918330475785767367</id><published>2012-12-03T10:11:09.005+08:00</published><updated>2012-12-03T10:11:09.005+08:00</updated><title type='text'>其實大多數所謂的要切換 persistence layer 的終極目標,大多只是為了 &quot;要...</title><content type='html'>其實大多數所謂的要切換 persistence layer 的終極目標,大多只是為了 &quot;要能夠用讓系統配合不同的 RDBMS&quot;。<br /><br />專案不太需要,產品才有可能。<br />只要搞清楚,persistence layer 的更換真正意義是什麼,要真的是換 RDBMS 的話。<br /><br />只要設計得宜,EF / NHibernate 這些東西甚至不需要出現。(有當然更好,節省開發時間)。</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/2918330475785767367'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/2918330475785767367'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1354500669005#c2918330475785767367' title=''/><author><name>被軟體開發耽誤的廚工</name><uri>https://www.blogger.com/profile/00144958407872087293</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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-218799269"/><gd:extendedProperty name="blogger.displayTime" value="2012/12/3 上午10:11"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-3004113583470193906</id><published>2012-12-03T08:24:21.390+08:00</published><updated>2012-12-03T08:24:21.390+08:00</updated><title type='text'>嗯,了解。Thanks ^^
順便一提,為了平衡報導,我正在整理另一篇支持 Repository 的...</title><content type='html'>嗯,了解。Thanks ^^<br />順便一提,為了平衡報導,我正在整理另一篇支持 Repository 的筆記。</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/3004113583470193906'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/3004113583470193906'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1354494261390#c3004113583470193906' 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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1825873726"/><gd:extendedProperty name="blogger.displayTime" value="2012/12/3 上午8:24"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-7434815653741645284</id><published>2012-12-01T15:17:15.630+08:00</published><updated>2012-12-01T15:17:15.630+08:00</updated><title type='text'>IUserRepository
-EFUserRepository
-SqlUserReposito...</title><content type='html'>IUserRepository<br />-EFUserRepository<br />-SqlUserRepository<br />目前的專案都是採用上列這樣的命名規則,因為採用EFUserProvider少了代表邊界物件的語意。<br /><br />至於先前文章中會撰寫為UserRepositoryProvider這樣落落長的名稱,<br />是因為考量UserRepository中有時會封裝一些計算的功能,<br />為了跟DI進來的邊界物件作區隔,<br />所以額外加上了Provider尾字再隔離出去一層。<br /><br />但是現在回頭看,覺得自己有點畫蛇添足阿。XD<br /></content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/7434815653741645284'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/7434815653741645284'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1354346235630#c7434815653741645284' title=''/><author><name>Clark</name><uri>https://www.blogger.com/profile/13902532235164838469</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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1874098437"/><gd:extendedProperty name="blogger.displayTime" value="2012/12/1 下午3:17"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-4534347578791135897</id><published>2012-11-30T12:13:06.834+08:00</published><updated>2012-11-30T12:13:06.834+08:00</updated><title type='text'>嗯,我想是的。只是有個小小疑問:EFUserRepositoryProvider 如果叫做 EFUs...</title><content type='html'>嗯,我想是的。只是有個小小疑問:EFUserRepositoryProvider 如果叫做 EFUserProvider 會不會比較恰當?因為這些 XyzRepositoryProvider 類別都是提供 Xyz 物件,而不是提供特定實作的 Repository。<br />關於 Provider 的設計模式,也許改天我會再整理一篇筆記,不過目前腦袋還很混沌,想法還很模糊...隨緣吧 ^^</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/4534347578791135897'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/4534347578791135897'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1354248786834#c4534347578791135897' 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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1825873726"/><gd:extendedProperty name="blogger.displayTime" value="2012/11/30 中午12:13"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-3423475157813929970</id><published>2012-11-30T11:55:00.817+08:00</published><updated>2012-11-30T11:55:00.817+08:00</updated><title type='text'>採用ORM不牴觸的說,例如EFUserRepositoryProvider。:D
</title><content type='html'>採用ORM不牴觸的說,例如EFUserRepositoryProvider。:D<br /></content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/3423475157813929970'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/3423475157813929970'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1354247700817#c3423475157813929970' title=''/><author><name>Clark</name><uri>https://www.blogger.com/profile/13902532235164838469</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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1874098437"/><gd:extendedProperty name="blogger.displayTime" value="2012/11/30 上午11:55"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-5187875120993188266</id><published>2012-11-30T08:15:30.759+08:00</published><updated>2012-11-30T08:15:30.759+08:00</updated><title type='text'>感謝 Clark 的分享!
我發現你有一篇文章詳細說明了你在留言中提到的設計方式,還提供了範例程式,...</title><content type='html'>感謝 Clark 的分享!<br />我發現你有一篇文章詳細說明了你在留言中提到的設計方式,還提供了範例程式,對於評估是否採用 Repository 也很有幫助,所以我將你的那篇文章加入本文的延伸閱讀清單了。<br />我的觀察是,BLL 裡面將會有一層薄薄的 Repository(例如 UserRepository、ProductRepoitory....等等),在 DAL 裡面對應的 Repository 類別才提供了對應的實作,例如你的範例中的 SqlUserRepositoryProvider。然後再透過相依性注入的方式將這兩層黏起來。 <br />如果實際專案的需求會要切換後端資料來源,這樣的設計我想是個不錯的選擇。如果沒有這樣的需求,而且已經決定採用 ORM 的情況下,就得斟酌是否值得引進這個抽象層,畢竟它會增加初期開發的 coding 成本,以及為應用程式加入不少類別(意味著複雜性也可能升高)。<br />Thanks :)</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/5187875120993188266'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/5187875120993188266'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1354234530759#c5187875120993188266' 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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1825873726"/><gd:extendedProperty name="blogger.displayTime" value="2012/11/30 上午8:15"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-9115155884286301982</id><published>2012-11-30T00:53:41.269+08:00</published><updated>2012-11-30T00:53:41.269+08:00</updated><title type='text'>Repository的設計概念,主要是做為領域層與資料對應層之間的媒介。
這個「媒介」的意思如果單純...</title><content type='html'>Repository的設計概念,主要是做為領域層與資料對應層之間的媒介。<br />這個「媒介」的意思如果單純看做資料查詢的物件,在設計的時候會顯得綁手綁腳,因為很多功能都跟EF等等框架重疊了。<br /><br />但是換個角度把Repository看做一個IoC的實做,相依的方向是資料對應層相依領域層。<br />也就是說Repository是作為系統邊界的存在,而這個系統邊界是存在領域層與資料對應層之間。<br />套用Repository最主要的工作,讓整個領域層更加的凝聚。<br /><br />以這樣的角度去思考「泛型 Repository」、「aggregate root」就會發現,這些做法是以資料對應層的角度去實做,而不是以領域層的角度去設計。<br />基本上從本質就是有問題的設計,因為資料對應層的工作可以由EF、NHibernate來提供不需要Repository。<br />Repository應該只需要設計出領域層需要的介面就夠了。<br /><br />簡單說Repository的用意是隔離相依,讓領域層不相依任何其他的層,提高整個領域層的重用性、可測試性。 ^^</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/9115155884286301982'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/5725866946975517405/comments/default/9115155884286301982'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2012/11/repository-yagni.html?showComment=1354208021269#c9115155884286301982' title=''/><author><name>Clark</name><uri>https://www.blogger.com/profile/13902532235164838469</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/2012/11/repository-yagni.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-5725866946975517405' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/5725866946975517405' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1874098437"/><gd:extendedProperty name="blogger.displayTime" value="2012/11/30 凌晨12:53"/></entry></feed>