问题描述
我第一次创建了Spring 3 / Hibernate 3.6应用程序体系结构,并且配置了所有部分,但需要更多关于业务层的正确体系结构设计的信息。请提供建议或资源链接,以便为我的控制器和DAO之间的独立业务层提供适当的设置建议。是否有任何建议的业务对象技术或通常使用的POJO?应用程序是否简单地用一个单独的文件夹进行划分,与我的控制器处于同一级别,用于业务对象?
这取决于应用程序的大小,业务对象的作用以及它们如何相互依赖。 >
通常,业务对象将驻留在一个或多个文件夹/包中,具体取决于
POJO通常会专门做这项工作当你有春天来处理交易和其他交叉问题。
我也看到了非常大的应用程序的设计,其中服务层和DAO被分离到不同的应用程序中以实现更松散的耦合。所以它真的取决于你如何布置应用程序结构的各种因素。
I'm setting up a Spring 3/Hibernate 3.6 application architecture for the first time and have all of the parts configured but need more information about the proper architecture design for a business layer. Please provide advice or links to resources that will suggest the appropriate setup for a separate business layer between my controllers and DAOs. Are there any suggested technologies for business objects or are POJOs normally used? Is the application simply divided with a separate folder, on the same level as my controllers, for business objects?
It depends on the size of your application, what your business objects do and how they depend on each other.
Typically the business objects will reside in one or more folders/packages depending on
- functionality, and
- their inter-dependence on each other
POJOs will normally do the job specially when you have Spring to take care of the transactionality and other cross cutting concerns.
I have also seen designs of very large applications where the services layer and DAOs are separated out into different applications for more loose coupling. So it really depends on various factors how you lay out the application structure.
这篇关于我的业务对象应该如何设置Spring / Hibernate项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!