Why we are using Spring framework?
2006-04-27 22:21
218 查看
在众多j2ee框架中,spring作为一个轻型框架值得称赞的地方很多,就我认为,我觉得以下几点是使用他的理由:
1.IOC容器。提供了IOC容器来管理java类,对类之间的依赖性进行管理,逻辑性分明。其实这点并没有什么特色,近年来,IOC容器很多,所以现在的框架至少都需要实现这点。在自动初始化类属性等,我更喜欢hivemind的默认操作,spring需要自己声明自动化绑定。
2.对Bean的操作与逻辑验证(PropertyEditors)。这点可以把数据验证从web层提到数据层上来,“仁者见仁,智者见智”。
3.AOP集成容器(支持AspectJ)。对一些喜欢AOP编程或者有那方面的需求的用户来说,这点是比较令人兴奋的,因为AspectJ与spring的整合在spring2可以体现出来。
4.数据层:Transaction容器管理与DAO支持。这点对不喜欢使用那些ejb容器服务器的用户来说更完美了,这样j2ee应用程序也可以在tomcat/jetty等下部署,也可以享受到容器管理事务的好处。同时对数据层的实现提供了template等集成(包括hibernate,jdo等)。
5.其他集成(RMI,Web Services,EJBs,JMX,JMS等)。进一步集成支持j2ee的其他规范,提供各方面的操作。
其他:
MVC框架不是很喜欢,幸好spring framework对其组件不紧耦合,所以我们可以按自己的需要使用spring的各项功能。在web层的处理上,我比较喜欢的是事件驱动处理,因此可以选择tapestry来进行页面处理集成,同时tapestry可以很明显的分清页面设计与逻辑层的角色。而在request流模型的话,期待struct与webwork整合的结果。
1.IOC容器。提供了IOC容器来管理java类,对类之间的依赖性进行管理,逻辑性分明。其实这点并没有什么特色,近年来,IOC容器很多,所以现在的框架至少都需要实现这点。在自动初始化类属性等,我更喜欢hivemind的默认操作,spring需要自己声明自动化绑定。
2.对Bean的操作与逻辑验证(PropertyEditors)。这点可以把数据验证从web层提到数据层上来,“仁者见仁,智者见智”。
3.AOP集成容器(支持AspectJ)。对一些喜欢AOP编程或者有那方面的需求的用户来说,这点是比较令人兴奋的,因为AspectJ与spring的整合在spring2可以体现出来。
4.数据层:Transaction容器管理与DAO支持。这点对不喜欢使用那些ejb容器服务器的用户来说更完美了,这样j2ee应用程序也可以在tomcat/jetty等下部署,也可以享受到容器管理事务的好处。同时对数据层的实现提供了template等集成(包括hibernate,jdo等)。
5.其他集成(RMI,Web Services,EJBs,JMX,JMS等)。进一步集成支持j2ee的其他规范,提供各方面的操作。
其他:
MVC框架不是很喜欢,幸好spring framework对其组件不紧耦合,所以我们可以按自己的需要使用spring的各项功能。在web层的处理上,我比较喜欢的是事件驱动处理,因此可以选择tapestry来进行页面处理集成,同时tapestry可以很明显的分清页面设计与逻辑层的角色。而在request流模型的话,期待struct与webwork整合的结果。
相关文章推荐
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed
- 每日英语:Why Food Companies Are Fascinated by the Way We Eat
- why should we use requset_mem_region()before using ioremap()?
- 严重: Exception sending context initialized event to listener instance of class org.springframework.we
- [org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser] are only available on
- Oracle hidden costs revealed, Part2 – Using DTrace to find why writes in SYSTEM tablespace are slower than in others
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' mar
- Why we don’t recommend using List<T> in public APIs
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read
- Why Are We Overweight?我们为什么会肥胖?
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read
- How to call Oracle function or stored procedure using spring persistence framework?
- 严重: Exception sending context initialized event to listener instance of class org.springframework.we
- 异常积累:org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in
- Why We Serve: Combat Medic Saves Lives Using New Evacuation System
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read
- 异常积累:org.springframework.dao.InvalidDataAccessApiUsageException Write operations are not allowed in
- 严重: Exception sending context initialized event to listener instance of class org.springframework.we
- 严重: Exception sending context initialized event to listener instance of class org.springframework.we
- How to check which responsiblity we are using