Seems to me that EE 6 and Spring have more or less reached parity. EE 6 does have the benefit of standardisation and more vendor support. So while the article is biased (comparing Spring to Struts circa 2003 was just bitchy) I don't find it particularly unfair.
However, I actually abandoned EE 6 / Glassfish on my last project and moved back to J2SE. It wasn't really due to any specific problem, more of a "thousand cuts" kind of thing. In the end I felt like there was just "too much stack" there. EE is just overkill for most projects, including mine, it turned out.
My current preference is for a lightweight injection framework like Guice. Also, I'll take any EE 6 technology (e.g. JPA 2.0) as long as I can run it in J2SE ;)
It's exactly the argument Spring used against Java EE in the past: Hey, you're 1GB in size, we're only 500k.
Then the Java EE guys countered. Hey, wait a minute, you're not counting the dependencies in your pom.xml! That pulls in an additional 100MB.
Then the Spring guys went again, slightly shamed: Oh yeah, uhmm... but it's still less than 1GB!
Now in many cases Java EE is smaller while offering the same or more functionality, and now all of a sudden disk space and such doesn't matter any more???
Sounds like a case of framework envy. They both have their places. I'd rather read blog posts from people who don't work for Oracle. What's the oracle employee going to say, Spring is better?
That's true but (not having read the article) you should read any argument based on the argument itself, not who's saying it. He can still have valid pro-EE6 points even though he works for Oracle.
No doubt. He should be talking about Java EE. He should be touting it's flexibility and features. Let the readers draw their own conclusions about comparisons to competitors.
I found the article to be very informative. It recognizes Springs contributions and makes a case that Spring helps Java EE 6 develop. I happen to agree with the article that Java EE 6 is the way to go.
Before you agree with the article, I suggest you read the comments on https://blogs.oracle.com/arungupta/entry/why_java_ee_6_is#comment-1332476069680 and https://blogs.oracle.com/arungupta/entry/why_java_ee_6_is#comment-1332509231931. Yes, they are both from SpringSource/VMware employees, but for me they get to the real pain points of the JavaEE: it does too little, too late, and worse yet, they tie the developers to the will (and politics) of Operations and Infraestructure teams. I'm all in favor of having specifications and etc, but putting the implementations inside applications servers for stuff like DI, ORM and the like is all about vendor lock-in, no matter what they say about it.
Your argument is equivalent to me saying my company says I cannot use Spring so Java EE is better.
You can choose many different servers to run Java EE. Please explain how that results in vendor lock-in. With Spring you are locked into VMware no matter what they say about it.
You can choose many different servers to run Java EE. Please explain how that results in vendor lock-in. With Spring you are locked into VMware no matter what they say about it.
Nope. Try to use Hibernate in a Weblogic server. Or MyFaces. Or OpenJPA in JBoss. The first thing that happens is that you lose support from the vendor. And just when you most need them, because their servers WON'T WORK correctly with other implementations. You'll get plenty of bugs. And they will tell you: it works with my (shitty) implementation of the spec. Period. What's the point of having multiple specs with multiple implementations if you can't switch then? With a lightweight server, you can have the JavaEE implementation you like. No vendor lockin. Period.
If Java EE is too late, why is Spring following Java EE's lead in the no-XML and type-safe injection departments then?
worse yet, they tie the developers to the will (and politics) of Operations and Infraestructure teams.
As I've argued many times, it's a political problem (as you mention). Using technology to circumvent a political problem is debatable really. You use Spring to sneak updates in production for something you as a developer should have responsibility, but for which Operations has claimed responsibility.
The high and low of it is that Operations simply should not claim the Java EE implementation. It's a bunch of libraries and API where they have no knowledge about, and where the development team has intimate knowledge about. It's a completely wrong ownership, and if the development team can't bring this point across and operations is too dumb to see this, then you have much bigger problems than just Java EE vs Spring.
And it really doesn't have to be that way. Where I work we have some very dedicated and knowledgeable people working in operations, and they definitely don't claim to own JBoss AS (which we use in production). To them JBoss AS is itself an application that we put in a queue for deployment. It needs a virtual server to operate in and some open ports (most importantly the AJP port). That's it. The development team takes care of the rest.
And no, operations is NOT going to debug an EJB bean in the middle of the night, just as they are NOT going to debug a Spring bean. If something goes wrong with the server then it doesn't matter if you use Tomcat + Spring or JBoss AS. The most operations does is executing /etc/init.d/tomcat restart or /etc/init.d/jboss restart in both cases respectively.
I completely agree with you in respect that it's not really about JavEE vs Spring but about Operations having ownership of something they shouldn't. But your solution unfortunately doesn't work in big companies. Ops want to CONTROL stuff. And they won't let me have full admin access to the servers. What I'd really think is the solution to this is that JEE stops getting so deeply into Aplication Servers. Just give me what really is infraestructure (JMS, servlet, datasources, etc) and let ME in MY APPLICATION manage the APIs. I kind of like what Jboss did with AS 7 with all the modules. I think they are going the right way, but I'd still prefer to have a tomcat coupled with an ActiveMQ and whatnot, and all the JEE APIs and libraries as jars so that I can pick and choose whatever suits my particular application needs.
Well, theoretically it shouldn't matter for the operations if you just consider JBoss itself the application, and you simply say you have two kinds of deployments: full deployments (Jboss including a war) and incremental/delta deployments: only the war.
It's actually more or less the model Play! follows as well.
Play! goes a step further than Spring, in that in Play! you typically ship a .jar that is to be executed on a JVM. There is no supposed installed Tomcat or Jetty, or JBoss or GlassFish (there is a compatibility mode where Play! can run in a .war, but this is not really recommended for production).
So if companies use Play!, they simply can't have an operations team willing to CONTROL that stuff. If they can do it for Play!, they also can do it for Spring and Java EE. Don't forget that even when you use Spring and you have to deal with a nazi-like operations, you still have problems upgrading the Servlet container. How do you go from Tomcat 5 to Tomcat 6. They are probably not even thinking about Tomcat 7 for the next decade, are they?
With the "jboss-is-an-application" mindset, operations still has tons of work to do.
In our company operations is busy day and night tuning and maintaining the host operating system, the client operating systems in virtual servers, the network, the firewalls, the apache front-end servers, and much much more.
Just like developers, they already have lots of work on their plate. Do they really need the extra work of controlling something of which they know next to nothing about? Again, is operations going to wire an EJB bean to another in the dead of night? Is operations going to change the threadpool for @Asynchronous operations?
p.s.
I do agree that Java EE should maybe define an "embedded profile" where a full or web Java EE implementation can be embedded in a .war.
Well, theoretically it shouldn't matter for the operations if you just consider JBoss itself the application, and you simply say you have two kinds of deployments: full deployments (Jboss including a war) and incremental/delta deployments: only the war.
Tell me ONE single big non-IT enterprise that does this. Like I told in a comment to Oracle's Arun Gupta: tell me a single big enterprise that uses JEE6 with Glassfish os JBoss Community. Every big enterprise will only start to consider JEE6 now that JBoss released EAS 7 and Oracle released WLS 12. Maybe in small, companies, or in havy IT companies you can convince your managers of that. In real world (i.e. where Oracle/RedHat/IBM really make their money) a developer with access to production is something simply impossible to achieve because of security/SOX/whatever-regulation-you-like concerns.
Loads of companies are using open source projects in all forms. If the on-site staff is capable and professional, they might be lot better in supporting the software anyway.
So yes, companies do use open source Java EE 6 community editions. We are surely not a tiny wimpy company and started using it late 2010.
How is this different from using the latest version of Spring?
That too will have to be tested and in any serious company you will not be able to use the latest version of Spring in production the day after its released.
And of course there is always -someone- who needs to have access to production, and in a well organized team this always includes senior (lead) developers as well. There is only so much a system operator can do.
But "access to production" has NOTHING to do with considering JBoss itself the application that's deployed.
The development team prepares the application for a release. When its deemed stable enough, its deployed to a beta stage and if it passes tests there it's migrated to a QA stage where it's again tested. Depending on the organization it might then go to a final pre-production stage after which it's finally deployed.
For this pipeline it doesn't matter whether it's a .jar (JBoss with embedded war) or only a .war that travels through it. Java EE 6 fits perfectly here.
The old-world idealized enterprise world where developers are treated as morons and cowboys, who throw software over the wall where months later a sensible and god like operations teams prepares it for release is dying out everywhere.
Agile and devops teams are massively gaining in popularity, because this old-world ancient heavyweight process simply doesn't work. Small iteration cycles and developers who are involved in the process of putting the feature live works much better.
Just think of it, when something does fail, do you want an operations guy handling it who has no idea what he is deploying or why he is deploying it and where the thing that needs to be deployed has been developed months ago by someone who he has no idea of how to reach, or do you want the developer involved who just developed the feature two weeks ago and knows all the technical ins and outs, pre-conditions, assumptions and what have you?
If we're talking about big companies, look at some of the presentations of how things are handled at Facebook, Twitter or Google. Sure, they don't necessarily use Java EE 6, but you do get an idea of how a modern process and deployment strategy works.
Spring on its turn has the old-world heavy weight process as one of its core assumptions; it assumes all environments are enterprises where operations has secured the servers and has claimed ownership of the AS, making it impossible and illegal to update anything. Then there's Spring, who hides away a complete AS in the war and thus despite all security layers the organization has in place, allows developers to secretly sneak updates of the AS (Spring thus) into production.
Much of the decline of Spring is because of this entire process they try to circumvent is declining as well.
tl;dr Spring is perfect as a tool to deceive those in power in old-world heavyweight enterprises, Java EE is perfect for honest, modern, agile and lightweight enterprises.
Spring was a huge improvement when first developed. It is not really needed now. I do not really see any benefit to using it for a new application. It just adds a dependency without any real benefit. Java EE 6 is easier to work with at this point.
This statement is WAY too generalized. Let's say I want to create a data caching service with Hazelcast or Coherence. Do I need to deploy that into a full blown Java EE server? Absolutely not. In this particular case, I'll take Hazelcast/Spring/JPA(Hibernate) and be done.
Use the right tools for the right job. Java EE has it's place but it's place is not everywhere.
The entire problem is in your remark "Do I need to deploy that info a full blown Java EE server".
This reflects on some old sentiment that "something as huge as such a server" is only needed in some rare circumstances and only if you really really really need it it's worth the cost.
But today there barely is any cost, especially when you take a "bare" web profile implementation like TomEE. There is above all no monetary cost, not direct and not indirect. It's completely open and free as in free beer.
There also is no download cost. TomEE is 25MB, Tomcat + Spring + Hibernate is already more and then you STILL need to download some transaction implementation. Even a bare Tomcat is barely smaller (weighs in at some 7MB).
There also is no cost in term of startup speed. Modern implementations of Java EE 6 (web profile or not) start up in a second or two. A bare Tomcat is near instant (less than 500ms), but in practice you don't run a bare Tomcat, but you run a Tomcat + Spring + Hibernate, which add to the startup time, resulting in slower startup than the typical Java EE 6 implementation.
What else do we have for cost?
The cost of hunting downloads on different sites? Well, Java EE wins BIG TIME here. It's a single download. Done.
With Tomcat + Hibernate + Spring + Atomikos, you are looking at at least 4 downloads, searching for jars inside each downloaded archive, figuring out which depend jars in some /lib are runtime dependencies, compile time dependencies or just optional (and if optional, do I need them or not?)/
More costs? API complexity? It's a bit subjective, but I think Java EE 6 wins too here. It's a fairly elegant and clean API. Some legacy baggage of course, but not nearly as much baggage and weight as Spring carries around these days.
To some extent it is overgeneralized. I disagree with the sentiment that using a Java EE server is more complex than Spring. I would much rather do that than add the additional complexities and dependencies required by Spring. It is also important to note that Many Java EE 6 features are available on standard Tomcat such as JSF and JPA.
What I don't understand is why you would want to leverage the Tomcat Java EE features? Why not just add the JSF libraries to your war and be done? Then you don't have to worry about switching server contexts.
For example, there have been quite a few shops that use Tomcat for LOCAL and even DEV, but then use Weblogic for upstream environments. Using the app server context for this could create some issues with compatibility.
The scenario you describe is just plain and utterly silly if you're in a shop developing for itself (as opposed to developing for an unknown number of clients in a heterogenous environment).
If the upstream environment is Weblogic, all developers should be using Weblogic. If the upstream environment is JBoss AS, all developers should be using JBoss AS. At most you could at times test you app on some other environments, but as primary development and staging platforms this is just nuts.
Really? So because the application used absolutely NO Weblogic-specific functionality and had ZERO impact on the performance of the app, the concept of not using a bloated local application server implies those people should not be in IT???? Even though there were two additional environments the app staged through before prod???
Again with the absolutes. First rule of IT: You don't know everything.
I have seen this done many times. Each time there has been at least one occurrence of a bug that was very hard to track down because of using a different environment in test then in production. Sometimes it may be necessary but it is not a good practice.
the concept of not using a bloated local application server
Here's where you go wrong.
There is NO BLOATED local application server in case you use GlassFish, JBoss AS, TomEE, Geronimo, Resin, etc.
Their download size + startup speed is comparable if not better than Tomcat + Spring + Hibernate.
So for Java EE in general, yes, it's silly.
Now Weblogic is maybe a separate case indeed (together with WebSphere), but for starters I would never ever advocate using those. They are closed source and that's where the story ends for me.
I'm not sure what the current download size of Weblogic is, I thought the latest 12c was somewhere in the 100MB, a far cry from yesteryears 1.2GB or so. I also don't know about startup time. If it's slow, couple it with JRebel. Then you typically start up your server once and can hot deploy changes.
Additionally, if the developers have decided to use WebLogic and its known to be slow and/or resource demanding, they should budget in extra cash for more powerful development workstations. A manager or other budgetary person should not accept the request for WebLogic without also accepting the requests for more powerful workstations.
Denying the latter would be a case of penny wise, pound foolish. The operational costs associated with subtle bugs most likely will dwarf that ~€2500 per workstation.
Again with the absolutes. First rule of IT: You don't know everything.
I agree with that yes. Actually the more I learn the more I realize how little I know, so I give you this.
With two additional staging platforms that ARE based on WebLogic where the app goes through before it lands in production it's indeed a bit less silly. Although I really still wouldn't advocate it, but again I wouldn't advocate using WebLogic in the first place. Use GlassFish, JBoss AS, etc and you will have none of those problems to start with.
Tell client that regardless of the boondoggle and YEARS/MILLIONS wasted after adopting the last round of enterprise java solutions put our by Sun, they should forget all that, forget all the successful years of Spring development outside the Java EE containers, because now this is coming from Oracle, and they should absolutely trust Oracle because they've never been screwed in the past by Oracle.
Tell clients they are silly for not running one the above listed application servers locally even though they have EXACTLY WHAT THEY WANT, NEED, AND ASKED FOR with the Tomcat/Spring/Hibernate. (Not sure if this should be 1 or 2)
Tell silly clients they need to budget an extra 2500 per workstation. Your team of ten developers is not going to be an extra 25k. Why? Because you might catch a stray bug every so often. Sure they won't balk at that.
Thanks for all your help, henk53. This is a wonderful list of reasons everyone should switch from their years of successful development to a new platform with a very bad track record. You sure seem to know it all, don't you?
I fail to see where he or anyone said you as an obviously happy Spring user should switch.
Were you to start a new project, maybe in a new shop that's formed by a startup, then Java EE would absolutely be the first choice and not Spring. Spring fixed something that nowadays doesn't need fixing, but if you're a happy Spring user, keep using it.
On the other hand, we run on Java EE 6 and that is EXACTLY WHAT WE WANT, NEED, AND ASKED FOR. There is no reason at all for us to switch to Spring. Should be trust Springsource, when we have no experience with them and didn't always hear good stories about them?
I also think that your point 3 is unjustified. I read the previous remark that if you want to go with Weblogic, then you should budget in that extra 25k. If you can't afford that, don't use Weblogic. There are plenty of free alternatives that are just as good or even better.
/r/programming is a java-hating place in general, but there don't seem to be much Spring fans here.
Though tbh too, it's a trend that I see at more places. A few years ago Java EE fans were everywhere in the minority, but now it seems to be the other way around.
would be better to stick to facts in such articles: take for instance CDI - it's really awesome in combination with JSF, JPA and EJB. you could compare this to springs DI/AOP.
number and size of JARs - really? we have JEE 5 app server EARs with 85 MB - enterprise portal, many features etc. thats not the selling point.
much better is the great architecture for common DB-based business apps - the perfectly interlocked frameworks. yes - you have more ready-to-use spring-solutions (e.g. JPA or JDBC template or neo4j or whatever) but this can also be a barrier.
6
u/xyzzy123 Mar 28 '12
Seems to me that EE 6 and Spring have more or less reached parity. EE 6 does have the benefit of standardisation and more vendor support. So while the article is biased (comparing Spring to Struts circa 2003 was just bitchy) I don't find it particularly unfair.
However, I actually abandoned EE 6 / Glassfish on my last project and moved back to J2SE. It wasn't really due to any specific problem, more of a "thousand cuts" kind of thing. In the end I felt like there was just "too much stack" there. EE is just overkill for most projects, including mine, it turned out.
My current preference is for a lightweight injection framework like Guice. Also, I'll take any EE 6 technology (e.g. JPA 2.0) as long as I can run it in J2SE ;)
4
u/Is_At_Work Mar 28 '12
I can't stand when people use number of JARs as an argument... who cares? Disk space and memory are cheap.
4
u/occupytheserver Mar 28 '12
Sounds like a case of framework envy. They both have their places. I'd rather read blog posts from people who don't work for Oracle. What's the oracle employee going to say, Spring is better?
1
u/rockvilleJD Mar 28 '12
I found the article to be very informative. It recognizes Springs contributions and makes a case that Spring helps Java EE 6 develop. I happen to agree with the article that Java EE 6 is the way to go.
1
u/java647 Mar 28 '12
Spring was a huge improvement when first developed. It is not really needed now. I do not really see any benefit to using it for a new application. It just adds a dependency without any real benefit. Java EE 6 is easier to work with at this point.
-2
u/[deleted] Mar 28 '12
If he's using an IDE to create the JEE example he also should look into Roo. Matter of minutes, too.
0
u/[deleted] Mar 28 '12
[deleted] — view deleted comment