|
Three years ago I've suggested a light architecture for Web/J2EE applications that was based on a Servlet container with transaction processing, Message Oriented Middleware, and a DBMS: http://java.sys-con.com/node/204697 . This piece was a part of an old and semi-serious Gas Station series published at Java Developer's Journal.
Even though during the last three years I was predominantly involved with the client side part, I've been watching closely what's happening in the Java EE domain.
Today, I was discussing an architecture of a new Flex/Java application with a colleague, and we came up with even lighter architecture: Flex-AMF protocol-JavaServlet+Transaction support library-DBMS with potential introduction of asynchronous messaging, if need be. I want to stress - only if there will be a need to scale, adding it on the protocol level so the application developers won't even notice it. We've learned how to seriously scale well designed Jetty's servlet container empowered by Adobe's BlazeDS ( it's a pity that Jetty-based early draftsof JSR 315 has been buried, which deserves a separate article).
No EJB or Spring container, no Hibernate either - just tried and true SQL/JDBC.
After the conversation was over, I've had this deja vu feeling and recalled that old article. On one hand, I still believe that this is the right way to architect Web applications, but on the other hand I know that it'll be a tough sell - selling an architecture at a gas station is not the same as selling to Wall Street IT architects. This application will be developed for large corporate clients, which implies that I'll need to present and defend this architecture in front of the architecture groups of these corporations.
EJB are out of style these days. In the Java world, the buzzwords of the first decade of this Century are Spring and Hibernate. If the PowerPoint won't include such boxes on the architectural diagram, most likely the enterprise architects won't approve it. Now I need to decide if I want to be 100% honest and jeopardize more efficient design, or be street smart, add these two boxes to the slide show, and when the project will be approved, quietly or with a fist fight remove them one by one.
I need to be very careful.
I need to think hard.
I need to consult with sales people.
I need to be smart.
I need to be politically correct.
Repeat.
i have given up on EJB long ago. Its simply too complicated and
unproductive. Looks good on paper but...
I guess Spring and Hibernate are the new kids on the block. My perception
is that Spring and Hibernate too is getting a little too complicated.
It's Law of Add-Ons and Complexities
"If a simple architecture works; invariably it will attract attentions and
someone will come along and put more add-ons and complexities over time and
will be its demise..."
Ben,
Neither Spring nor Hibernate are new kids. Both are very mature products. I
can agree with you that both looks complex from first sight, but this is a
false impression, at least for Hibernate:
1. You may use it even now (3.x) as good old Hibernate 2.0 with no
annotations or any other new stuff.
2. You may use it with Hibernate annotations
3. You may use it with standard JPA annotations (and optionally mix
Hibernate annotations when functionality is not covered by JPA)
4. You may use it with EntityManager and your code will be JPA compliant
(i.e. no references to Hibernate at all). Note that (3) does not mandate
(4)
5. You may add full-text search a top of any option
6. Etc...
Yakov, ok.
Valery, your arguments are poor.
Yakov,
Not buying this answer either.
Yakov,
Imaging you have a team of strong Java developers and, say an Oracle
person with excellent SQL skills. Would you recommend for a Web application
a this architecture: a servlet container, JOTM and possibly MOM if need be?
Valery has some good arguments and offered a wonderful contribution to the
discussion. It's too bad that you did not respond to her points directly,
rather engaging her in a semi-confrontational manner, as she likely would
have continued to participate. This would have allowed users like myself
who ended up on this page to further benefit from the exchange.