A fresh graduate confused by the Java EE jargon Spring, Struts, JSF, EJB, Jboss, JMS, - spring

As we all know that we rarely get a chance to learn whats out there in the enterprise world when it comes to college. In my experience I have always seen people learning Core Java and may be some other languages and when they graduate they have no Idea about this enterprise jargon. I am in that boat now. I am a recent graduate with a programming job and I often get confused about all the jargon which appear in the news an discussions. I believe all the frameworks mentioned have a purpose at the time of creation which is intended to fill a void.
I am sure that many of you would have gone through this in the early stage of your career. Is there anything out there a blog post, book , video or forum discussion which helped you to understand how all these frameworks weave together to form a application.
A detailed article would be most appreciated. I tried to look for one but I could them in bits and pieces but not a comprehensive article.

You could google/wikipedia them 1 by 1.
From wikipedia
Java EE
"Java Platform, Enterprise Edition or Java EE is a widely used platform for server programming in the Java programming language. The Java platform (Enterprise Edition) differs from the Java Standard Edition Platform (Java SE) in that it adds libraries which provide functionality to deploy fault-tolerant, distributed, multi-tier Java software, based largely on modular components running on an application server."
The Spring framework is sort of an alternative to Java EE.
Spring
Struts
"Apache Struts is an open-source web application framework for developing Java EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt a model-view-controller (MVC) architecture. It was originally created by Craig McClanahan and donated to the Apache Foundation in May, 2000. Formerly located under the Apache Jakarta Project and known as Jakarta Struts, it became a top level Apache project in 2005."
and so on. Research at your liesure...

You don't need all of these frameworks for completing your application. Even though many frameworks provide integration and support for each other, you don't have to use them all. I suggest you go layer by layer. Spring has uses in almost all layers, Struts is mostly an MVC framework. Spring MVC (one part of Spring) and Struts fill the same void. Tiles is a view layer framework. I think FreeMarker, Velocity and Tapestry are also view layer frameworks. JBOSS is an application server.
Spring and EJB 2.x were competitors. Again, EJB is meant for some of the more complicated applications, find more on this from the creator of Spring who wrote an entire book on why EJBs are not suitable for all web applications, which laid the basis for what was to become Spring later on. Though now, the latest EJB version 3.x seems to be getting good reviews. You haven't even mentioned Hibernate and iBatis for the ORM needs of your web-app.
I suggest you get used to the plethora of frameworks in the enterprise java world. If anything, it shows that the java world is alive and active.

Related

Spring vs EJB (advantage and disadvantage) [duplicate]

This question already has answers here:
When is it necessary or convenient to use Spring or EJB3 or all of them together?
(2 answers)
Closed 6 years ago.
I am currently preparing my final project study. I have to develop a distributed application for the management of human resources, but on my benchmark for technologies to use I found it confusing to decide between Spring or the EJB 3.1.
I do not know which will be the best suitable and easiest to use. I am a beginner for both technologies and therefore I hope so someone can help me.
You do not choose between EJB and Spring, you actually choose between Java EE and Spring because EJB is only a part of Java EE which includes also other components like JMS, Servlets, JSP, JSF, CDI, etc. In its early days (J2EE 1.4) programming model of enterprise edition of Java had a lot of flaws and deficiencies, but the most important ones were that it was tedious and verbose with a lot of boiler-plate code and tons of xml configurations. Spring was introduced as an alternative framework favoring convention-over-configuration principle. In other words, in Spring there were some sensible defaults that could be reconfigured if you need it. Java EE 5 introduced significant changes adopting the same convention-over-configuration principle from Spring, drastically reducing code amount and complexity required to get things going, so in this area Spring does not hold any sensible advantage any more.
It is also important to bear in mind that Java EE is just a specification. To build a real world app you need an implementation and there are plenty of them today - Glassfish, JBoss, TomcatEE, etc. all provide different implementations of Java EE specification introducing additional complexity - I mean, now you have to choose which Java EE implementation to choose. You can contrast that with Spring which comes from a single source.
Both frameworks gives you pretty much similar functionality. All support transactions, ORM, provide tools for building business logic, support CDI, AOP. In both Spring and Java EE you can only use the parts that you need, in other words you don't have to use the whole framework. You can even use them together - they can interoperate. Thanks to introduction of embeddable containers you now can even use Java EE features you need in areas like desktop applications which traditionally were the realm of Spring.
But one area where Java EE still lacks behind Spring is comfortable testability. It is not easy to write unit tests for EJB - for this you have to use a special third-party framework (Arquillian) and write some boilerplate code inside your tests (e.g. for building the test deployment package and deploying it onto the container, etc.). In fact, Java EE lacks any support for testing EJBs out of the box. In contrast, Spring is built with testability and TDD in mind. Testing Spring beans is easy since Spring includes bundled support for both testing (unit testing, integration testing) of all parts of the application as well as mocking.

Whats the difference between Spring and Spring MVC?

I know this is not a programmatic questions.
I am a n00b to this area coming from Java EE background and could not find the difference between the two online (may be I am not a good surfer)
Could someone please share the info?
Spring is a framework alternative to Java EE with three parts:
Dependency injection
Aspect oriented programming.
Libraries for web MVC, persistence, messaging, etc.
Spring MVC is for web MVC. It's one of the many libraries built into Spring. You can use other alternatives (e.g. Struts, SEAM, etc.) if you wish and still use Spring.
spring is enterprise framework designed to solve all your problems for enterprise applications. At present they call it as Spring IO, which can be found at spring.io website.
However, Spring MVC is a framework part of the whole stack available to solve the enterprise solutions. This is framework for writing web applications.

Spring information about start and video references

I am very very new to Spring and I don't even know Java EE. Can I proceed with Spring? If not , then how and what things do I have to gain before moving to Spring?
Please also guide me spring flavour and the best books for the specified flavours.
Please also give brief about each flavor so that I can gain knowledge about what is used for what.
You don't need to learn Java EE for learning Spring. Spring is not Java EE and Java EE is not spring. You can develop Java EE application using spring and without spring.
From the wikipedia : The Spring Framework is an open source application framework and inversion of control container for the Java platform.
Before moving to spring, you should be acquinted with design patterns. Effective Java and Head First Design Pattern is a good book to start. You can also find multiple source online.
Once you through about design pattern. You can find the Spring very much easy and its uses.
Start with Spring core. Then move to the other sub-projects of spring.
Documentation in Spring Source is best place to start..
You have to first learn Java EE especially JSP and Servlets. Get some detailed information on MVC pattern. You also require some hands-on knowledge on Web servers. Then you can move on to learn Spring.
This is a very subjective question; what teaching aides work best depend on the individual. As far as videos go, I would start with youtube with the springsource channel for Spring related information, and even some Java EE 101 type stuff. Also have a look at slideshare.net for presentations on various Java EE and Spring topics. good luck!

How to best apply Spring, Spring MVC and Hibernate frameworks

I'm an individual programmer, developer and I see a huge demand for the frameworks: Spring, Spring MVC, webflow, and Hibernate. Popular today: Spring MVC, webflow, GWT.
I've been going through the tutorials, and the technology looks awesome !
What I would like to know, is.. It's used in corporate sites, why not for smaller sites. How can I apply these frameworks in building websites ?
I can't imaging doing any kind of serious website building without a modern CMS or Portal framework (whether in Java/php-opensource), And yes, MVC gives you the validation and authentication hooks to be used.
All the demo's on Spring, cover some elementary, contrived example.
If I learn these technologies (and I'm well on my way), how do I put them into practice, and in what context (no pun intented) do I use them ?
I don't want to rebuild a CMS system, but I'd like to employ these frameworks effectively.
You should have a look at Magnolia/Blossom.
Magnolia is a Java (JCR) based Repository, and Blossom some kind of Spring integration.
I used it in one of my project, it worked. (Not all Spring 3.0 Features worked - for example I was not able to map two or more urls to one controller), but it worked) And I was not able to find any other mature Spring based CMS.
At least I belive the power of Spring MVC is more in web based applications than in simple web sites.

App Servers or Web Server for Spring Framework

first of all: that might be a newbie question. However after few searches I cannot find anything that would bring me further.
Basically what would be the reasons to choose an app server over a Spring framework to develop a medium complex web application? I am fairly new to Spring, did some hard core WebSphere for few years. While reading about Spring I see that it comes with a good bunch of features (transactions, persistence, messaging, connectors etc). Is Spring hard to scale or manage in a clustered environment?
Any comments welcome.
Thanks
Spring is awesome.
Your terminology is way off though. Spring is a Framework. It's a library that you use to write a web application.
An app Server is what your application runs in. You need both. For example, use the Spring Framework to create an app that runs in the Tomcat app server.
EAR files aren't a requirement for doing Java EE development.
It's not either/or: if you deploy a Java EE application you need a container of some kind.
I've deployed Spring apps on Tomcat and WebLogic. I think WebLogic is the best Java EE app server on the market. My decision about whether to deploy to it or not would be based strictly on availability.
You've seen that Spring has their own Java EE container now. It forks Tomcat and marries it with OSGi and Spring. I haven't tried it yet, but if the quality is similar to their framework it will be very promising indeed.
Are you really asking "When would I write an application using Spring? When should I choose EJB3?"
My preference these days is Spring. I can do persistence, transactions, messaging, web services, and everything else I need.
Bpapa,
you got me there, yes the terminology is wrong. I meant Spring + web container vs. App Servers. Surely the web app has to be deployed somewhere. I guess that shifts the question to the server side features as per my first post.
Topology example: Spring + Tomcat vs. WebSphere.
As a side note: people argue if Tomcat is an app server, many consider it rather a web container. You could not deploy an EAR file to Tomcat, can you? All it takes is a WAR, am I right? But that gets too academic.
Thanks a lot
Rod Johnson's "Expert 1:1 Java EE Development Without EJBs" is the basis for Spring. It's an excellent book, but I'd say it's a bit out of date now. The book was written with EJB2 in mind. It was published before Spring became an open source project. The framework is up to version 3.0 now, so I'd say that the book is of historical interest only. I'd recommend a more modern take on the question that takes Spring 3.0 and EJB3 into account.
%

Resources