Java论坛网»Java技术»A Question about Layered Prorgamming

A Question about Layered Prorgamming

问?:
Now I worked in a small company, in the company, we use struts and a home-made persistent layer framework, we wrote business logic and sql in action, and call the persistent layer framework which we made. And I know this is wrong, because we must separate business logic from action, but I can't see any advance from which , and if we do so, we must maintain more. Even struts they hate to use ( not include me). Does anyone can explain me why layered program so important?
答!: 1:
分层的重要性在于解耦.

通常来说 "数据库访问层" 的数据访问方式是稳定的.它的变化比较缓慢.
而 "业务逻辑层" 的业务变化通常是比较快的.也就是说在一个系统中存在 不变 和 经常变 的模块.
如果"表示层"/ "数据库访问层" /"业务逻辑层"都写在一起,对于项目以后的维护修改将是一个恶梦.
而分层的好处就在于将职责不同的模块进行分离,降低它们之间的耦合度.使得系统更加灵活.

相关JAVA教程:
将java从windows迁移到linux
【请问】我要把JNDI学习的很通透才能学好EJB吗?
50分求助一下(大家推荐些Corba的资料吧)
求助:关于在sqlserver 2000存储过程返回记录集的问题
请问struts+hibernate+spring问题
研究过struts里的插件menu的朋友进来看看被~
非常奇怪double相加,会出现不准确的小数位,怎么解决?
有关环境变量的问题,请各位专家帮忙看看?
在Java和delphi中解析Blob数据生成xml文件,得到的结果不一致问题,有兴趣的请看,谢谢
JBOSS安全性,如何配置
XML文件中取值问题!急!急!急!急!急!急!急!
怎样设置JList内部组件的状态?