tags:

views:

179

answers:

4

Hi,

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

+1  A: 

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.

bpapa
+1 except for the awesome part.
Chris Lively
A: 

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

nullpointer
OK I think what you are asking about then is Spring vs. Enterprise Java? There actually is a book with this very title (Java with J2EE I think it's called?) by Rod Johnson, one of the guys behind the Spring framework.
bpapa
you can use Spring with Websphere, it's not really one or the other...
Chochos
A: 

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.

%

duffymo
A: 

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.

%

duffymo