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

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.

你可能感兴趣的:(framework)