ActiveRecord與Castle ActiveRecord

來源:互聯網
上載者:User
    一、ActiveRecord與Castle ActiveRecord

    ActiveRecord是《Patterns of Enterprise Application Architecture》中描述的著名模式。基本上,當執行個體每一行的時候,所有的靜態方法會作用於全部紀錄。
    Castle ActiveRecord 是ActiveRecord 模式的一個實現,Castle ActiveRecord依賴Nhibernate來完成實際的映像。與單純的ActiveRecord 相比,Castle ActiveRecord具有以下特點:

    敏捷開發(它儘可能多地處理了映射和推斷,因此,對你的方案而言,當一些東西發生變化的時候,你不必去鑽研文檔或者處理大量的xml文檔)
    預定了像Create, Update, Save, Delete這樣的公用方法。
    容易實現像Find, FindAll, FindByName等此類的方法。
    繪畫和事務範圍(Session and transaction scopes that abstracts the ISession and translates them to a more natural idiom )
    使用Nhibernate,你繁瑣的配置工作多於複雜的映射,而使用ActiveRecord卻是推進你的生產力的一個保證,你不必再為編寫繁冗複雜的對應檔而頭疼,ActiveRecord封裝了NHibernate的操作,使用特性來代替對應檔,無論何時你需要,ActiveRecord都能給你一個Isession執行個體,它提供的簡潔的O/R映射會讓你為實現持久化資料層是那麼簡單而驚歎!

    Castle的官網是http://www.castleproject.org/,這裡的文章都參考於此。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.