NHibernate Best Practices with ASP.NET, 1.2nd Ed (1) 序言

来源:互联网 发布:mysql update select 编辑:程序博客网 时间:2024/05/01 08:44

Preface to the 1.2nd Edition(1.2版本序言)

(水平有限翻译难免出错,请海涵并斧正)

In March of 2006 I published my initial thoughts on NHibernate best practices with ASP.NET, generics and unit tests. I've been delighted to learn that these ideas have been implemented in a number of real-world scenarios with strong success. Since then, I've worked with many people to refine these ideas, learn from mistakes and leverage a more powerful version of NHibernate. Accordingly, although only a modest, yet important, amount of modification has been made to the underlying architecture, some other important factors have been updated and addressed in this article:  

20063,我发布了最初的Asp.Net NHibernate、泛型和单元测试的最佳方法例子.我非常开心地把这些方法应用到大量实际的项目上去并且获得巨大成功。自从那时开始,我和很多人一起提炼这些方法,一起从错误中学习并且补充了更多强大版本的NHibernate.因此,制作这个虽然经过适度但重要修改的架构,并且把其他一些重要的特性加入这边文章中
  • Quite simply, NHibernate is awesome. In the previous edition of this article, I assumed you already knew this...but I now try to convince the dissenters as well.
    十分肯定NHibernate 是可怕的.在文章的前个版本,我假设你已经知道这个….但现在我把这些变得更好
  • NHibernate 1.2 natively supports generics.
    NHibernate 1.2 支持泛型
  • NHibernate 1.2 natively supports nullable types.
    NHibernate 1.2 支持空类型
  • NHibernate 1.2 natively supports mapping attributes.
    NHibernate 1.2 支持Attribute方式 映射数据库
  • NHibernate 1.2 can communicate with stored procedures.
    NHibernate 1.2 能够使用存储过程
  • Using CallContext for ISession storage in ASP.NET was susceptible to failure under load.
    Asp.net 可以感知保存在CallContextISession装载失败
  • Exposing a publicly settable ID property created a point-of-susceptibility.
  • Providing automatic parent/child wiring, via Ayende's very helpful NHibernate.Generics, was more headache than help.
    提供自动的父/子关系装配,可以通过AVende’s的《more headache than help》获取Nhinbernate.Generics的帮助
  • Have you used Rhino Mocks 3.0, NUnitAsp, or Fit? Well, these are all discussed with an expanded emphasis on test-driven development. 
    是否有使用过Rhino Mocks 3.0, NUnitAsp, 或者 Fit? 很好,这里重点讨论 test-driven development.
  • As an alternative to my recommendations, also consider Castle Project's offerings such as MonoRail and/or ActiveRecord for a simple yet powerful out-of-the-box framework for ASP.NET. In fact, if it's technically feasible and you can generate buy-in on your team for these off-the-shelf tools, I would recommend using them over a ground-up solution. But even if you do use Castle Project facilities, this article should still have a lot of useful information for you! 
     作为我的推荐有个选择,考虑个使用Castle Project's offerings,如MonoRail ActiveRecord这些简单而强大的Asp.net框架。事实上,如果技术上可行并且你能够把这些框架带入你的团队从而代替自己开发的框架,那么我建议你使用这些框架应用在你的已有的解决方案中.但即使你使用更为简单Castle Project,这篇文章仍然可以给你很多有用的信息.
  • In addition to those listed above, there are other important refactorings and fixes throughout the article and the code. This edition is by no means just a light touch-up of the original article. 
    除了上面所述,这里有其他重要的重构和修正贯穿这篇文章和代码,这边文章绝非轻轻地修改了原文。
  • In addition to an overhaul of the original sample code, an expanded "enterprise" sample has been included demonstrating:
    • NHibernate with web services
    • NHibernate with multiple databases
    • Integration with Castle Windsor
    • A reusable data layer for the data access components.
    • A simple example of Model-View-Presenter
  • 增加了一个扩展了BaseExample的企业开发示例,其中包括:
    • NHibernate 用于WebService
    • NHibernate 用于不同的数据
    • 使用Castle Windsor进行注入式开发
    • 可重用数据访问层
    • 一个简单的 Model-View-Presenter 示例

A quick thanks goes out to those who have implemented my ideas in their own work and have given plenty of ideas for improvement and consideration! Now onto the 1.2nd edition...

  
非常感谢那些在自己工作中应用我的方法、给我改善建议以及体谅的人,现在开始1.2版本….