NHibernate和Spring.NET的结合在企业级应用中确实很有帮助!

发布于 2024-07-10 05:44:28 字数 134 浏览 9 评论 0原文

在项目中使用过 Spring.NET 和 NHibernate 的软件开发人员有何看法? 在我工作的公司的几个项目中,我们非常广泛地使用了这些第三方工具,并且获得了巨大的生产力。 需要注意的是,对于初级 .Net 开发人员来说,掌握这个概念有点困难。

What are the opinions of the software developers who have used Spring.NET and NHibernate in their projects? In couple of our projects in the company where I work, we have used these third party tools very extensively and we have gained tremendous productivity. A little caveat is that it is a little challenging for junior .Net Developer to grasp the concept.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

棒棒糖 2024-07-17 05:44:28

Imo、Spring.Net 和 NHibernate 齐头并进:如果你掌握了学习曲线,当 Spring 用于(几乎透明)时,你会感到非常高兴 NHibernate 的事务处理、依赖注入以及 Db:Provider 处理。

Imo, Spring.Net and NHibernate go hand in hand: If you master the learning curve you will be very pleased when Spring is used for (almost transparent) transaction handling for NHibernate, Dependency Injection as well as Db:Provider handling.

一抹苦笑 2024-07-17 05:44:28

NHibernate(或类似的 ORM)对于“绿地”开发非常有帮助,其中可以正确设计领域对象模型,然后可以通过代码生成数据库模式和 NHibernate 映射以匹配模型。 另一方面,NHibernate 可能很难应用于遗留或标准化程度较差的数据库。 尽管它支持处理一些不寻常的数据结构,但这些技术的学习曲线要​​高得多。

关于 Spring.Net 我不能说太多,只是在 2007 年,我们的团队试图将其实现到现有的复杂解决方案中来处理数据库事务和实体验证,但我们在工作一周后放弃了这个想法。 我们的常驻 Spring/Java 专家得出的结论是,Spring.Net 比 Spring 落后几个版本,而且还不够成熟,无法处理我们项目中的用例。 免责声明:不确定 Spring.Net 的版本是什么,所以最近情况可能有所改善。

NHibernate (or similar ORM's) can be extremely helpful with "greenfield" development, where the domain object model can be designed properly, and then the database schema and NHibernate mappings can be code-generated to match the model. On the other hand, NHibernate can be very tough to apply to a legacy or poorly normalized database. Although it has support for handling some unusual data structures, the learning curve is much higher for those techniques.

I can't say much about Spring.Net except that in 2007, our team tried to implement it into an existing, complex solution to handle DB transactions and entity validation, but we scrapped the idea after a week of work. Our resident Spring/Java expert concluded that Spring.Net was a couple versions behind Spring and wasn't mature enough to handle the use cases in our project. Disclaimer: not sure what version of Spring.Net that was, so things may have improved recently.

久而酒知 2024-07-17 05:44:28

使用 spring.net/nHibernate 有很多好处。

对于数据访问,您可以充分利用 nHibernate ORM 的延迟加载、数据库独立编程、轻松保存、加载、更新、删除实体。 无需编写任何查询即可执行此操作。 这就是为什么在设计数据库和开发之后,如果在任何开发状态下需要进行任何更改,则很容易更改。

依赖注入(DI)有助于分离 UI 和业务逻辑。 这就是为什么您可以随时更改图形用户界面而不破坏任何业务逻辑。 同样,如果您需要对业务逻辑进行任何更改,则只需要构建业务层。 而且它也是可配置的。

面向方面编程(AOP)是Spring.Net的另一个特性。 它有助于记录应用程序,动态方法拦截允许对方法调用进行更多控制。 它使授权应用程序变得容易。 声明式事务管理是管理事务的一个很好的功能。 您不需要编写启动停止数据库连接的代码。 只需在配置文件中写入您想要维护事务的方法即可。 因此,在大型项目中,它将节省大量时间,并为您提供事务管理方面的更大灵活性。

Spring Webservice 很容易在客户端编写和使用。 不需要添加任何自定义属性,没有 WSDL。 您可以拦截每个方法调用,您可以添加建议,例如日志记录建议、身份验证/授权建议。

总体而言,它节省了大约 33% 的开发时间,使应用程序更具可维护性、高度可配置性。

There has lot of benefits using spring.net/nHibernate.

For data access you are able to take full advantage of nHibernate ORM with lazy loading, database independent programming, easy save load update delete your entities. No need to write any query to do that. That is why after designing a database and after development if any change is required at any state of development it is very much easy to change.

Dependency Injection(DI) helps to separate the UI and business logic. That is why any time you are able to change your graphical user interface without breaking any business logic. Same way if you need any change at business logic then need only build business layer. And it is also configurable.

Aspect Oriented Programming (AOP) is another feature of Spring.Net. It helps logging application, dynamic method interception allow more control over method call. It makes easy to authorize application. Declarative transaction management is a nice feature to manage transactions. You do not need to write code for start stop database connection. Just write at configuration file at which method you want to maintain transaction. So at large scale project it will save lot of time and will give you more flexibility over transaction management.

Spring webservice is very easy to write and consume from a client. Not need to add any custom attribute, no WSDL. You can intercept every method call, you are able to add advice like logging advice, authentication/authorization advice.

Overall it save approximately 33% of development time, make application more maintainable, highly configurable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文