`

与JEE6/EJB3.1相比, Spring framework 丧失了几乎所有的优势

    博客分类:
  • JEE
 
阅读更多

The Spring framework was a major competitor against the ejb technologies. But with EJB3.0/3.1 picked up all the good things, such as Dependecy Injection, Configuration Over Convention etc, Spring no longer has any advantages at all. Over the years, Spring has become over engineered and hard to use. 

 

For web applications, with JSF2.0, a backing bean would be easily injected with the @ManagedBean annotation. An EJB is a POJO, you can easily inject an EJB into your managed bean by annotation @EJB. You can easily inject your datasource with @Resource, You can easily inject a JPA persistence context with @PersistenceContext. You don't want to configure everything as a "bean" in all sorts of xml files in order to "inject" an object. This would dramatically ease the learning curve regarding web developemnt with JEE6. It proves SpringMVC to be redundant.

 

You don't need to programme with the JavaScript libraries directly, it's hard to maintain once the guy leaves the team.  Primefaces provides plenty of UI widgets for use and it hide the raw JavaScript from developers. As a result, your JSF pages are pretty simple and clean, thus easy to understand and maintain.

 

Why not adopt a JEE application server, such as JBoss and/or Glassfish? If you need transaction service, the application server provides it for you by default, an ejb method is transactional by default. You don't need to do anything, except write your busincess code. If you need messaging service, the application server provides it for you but default. If you need sheduling service, the application server provides it for your by default... This can go on and on, why just stick to a servlet container like Tomcat and then depends on Spring to put everything together manually? 

 

JDBC or JPA is straightfoward and there's no need to introduce extra API on top of it.

 

Flixibility is a lie, testable component is cheating, test driven developemnt is a joke.

Configuration is not programming, Java developement should use the Java prorgamming language, not xml.  

Face the reality, Sping has completed its mission and it will gradually become legacy technology.

 

Probably one could write a book like "JEE developement without Spring". Spring has contributed lots to the Java community. However, it also split the Java community. Java developers live a much harder life compared to .net developers. I personally hope that the Java community would simplify the platforms and tools and head to the same direction, so that Java developers would live a better life.

分享到:
评论

相关推荐

    javax.ejb-3.1.2.2.jar下载

    这个jar文件包含了编写和管理EJB所需的所有接口和类,使得开发人员可以利用EJB的强大功能来构建可扩展、可靠的后端服务。通过理解并熟练使用`javax.ejb`包中的元素,开发者可以有效地构建符合企业级标准的Java应用...

    java学习笔记2

    http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd ...

    patmdApp:病理诊所应用程序 Ver. 1.0 [JEE7 + EJB 3.1 + JPA 2.1 + JSF 2.2]

    1.0 [JEE7 + EJB 3.1 + JPA 2.1 + JSF 2.2]" 是一个基于Java Enterprise Edition (JEE) 平台开发的医疗信息化系统,特别针对病理诊所的管理需求。这个系统集成了多个关键的技术组件,包括Enterprise JavaBeans (EJB...

    spring_MVC框架

    http://www.springframework.org/schema/jee/spring-jee-2.5.xsd"> <!-- 其他配置项 --> </beans> ``` **3. 创建springMVCTemplet-servlet.xml文件** - 文件位置:同样位于`WEB-INF`目录下。 - 主要用途:...

    struts2 hibernate spring集成

    http://www.springframework.org/schema/jee/spring-jee-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd" default-lazy-init=...

    spring5.0_mvc_maven项目_HelloWorld实例

    6. **配置Web.xml**:配置DispatcherServlet,使其能够处理所有请求。 ```xml ... <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-...

    SSH集成手册.doc

    http://www.springframework.org/schema/jee/spring-jee-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd default-lazy-init=...

    Spring整合Redis完整实例代码

    本文将详细讲解如何将Spring与Redis进行整合,以实现高效的数据缓存。 首先,我们要构建项目的基础环境。在 Maven 项目中,我们需要在`pom.xml`文件中添加相应的依赖。Spring Data Redis 是 Spring 提供的用于操作 ...

    spring配置JNDI数据源

    http://www.springframework.org/schema/jee/spring-jee.xsd"> <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="java:comp/env/jdbc/...

    JEE6编程模型

    EJB 3.1 Lite是EJB 3.1的一个轻量级版本,它提供了与EJB 3.1相同的核心特性,但是进行了精简,去掉了某些复杂的功能,使得开发者更容易上手。 ManagedBeans是JEE6中的一个新概念,它允许开发者使用简单的Java类...

    spring framework schema

    8. **JEE Schema**: `jee` schema提供了与Java企业版(Java EE)相关的集成,如EJB、JNDI查找等功能,使Spring应用能更好地与Java EE服务器协同工作。 9. **WebSocket Schema**: `websocket` schema支持WebSocket...

    Create a Java EE 6 Application with JSF 2, EJB 3.1, JPA, and NetBeans IDE 7

    在本教程中,我们将深入探讨如何使用Java EE 6中的核心技术——JavaServer Faces 2.0 (JSF),Enterprise Java Beans 3.1 (包括Session Bean和Message-Driven Bean)以及Java Persistence API (JPA),结合NetBeans IDE...

    对SAE主从数据库连接的管理和封装.docx

    http://www.springframework.org/schema/jee/spring-jee-3.1.xsd"> <!-- 加载属性配置文件 --> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer...

    SpringMVC-SSH全注解

    http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd ...

    Spring各版本的xml约束

    4. `http://www.springframework.org/schema/jee`:处理Java EE集成,如JNDI查找、EJB引用等。 5. `http://www.springframework.org/schema/jdbc`:与数据库相关的配置,如数据源、事务管理等。 6. `...

    Reilly.Enterprise.JavaBeans.3.1.6th.Edition.2010

    《Reilly.Enterprise.JavaBeans.3.1.6th.Edition.2010》是针对JEE6(Java Enterprise Edition 6)平台的一本权威指南,特别关注于Enterprise JavaBeans(EJB)3.1版本。这本书由Oracle Corporation认证,为希望获得...

    struts2 + ejb3 + spring 整合了

    使用Spring的`<jee:jndi-lookup>`标签来查找和注入EJB3的会话bean。 最后,我们要整合Struts2。为此,添加Struts2的库到项目的类路径,并创建`struts.xml`配置文件。在该文件中,定义Action类、结果和拦截器栈。...

Global site tag (gtag.js) - Google Analytics