views:

209

answers:

3

Based the accepted answer to this question I've setup a NetBeans/tomcat environment. In testing this setup I'm trying to create a Java Web/Web application, but is stumped by the a choice of frameworks for this test-app.

The choices are:

  • Spring Web MVC 2.5
  • JavaServer Faces
  • Struts 1.3.8
  • Hibernate 3.2.5

In my reading-up (googling & SO) and fairly quickly got lost in the woods, so I am considering just picking one and if it doesn't pan out, to later switch/migrate to a different one. Would such an approach be feasible?


Background on the project

(Must be Java-based due to legacy code)
It uses a self-signed applet to do client-side rendering & interaction;
Servlets retrieve data-sets requested from the client;
Database may be on some remote server, so I intend to use JDBC for accessing it;

The legacy system was CORBA (ACE/TAO) based with lots of C++ modules that need to be translated to Java, and the existing Java-modules (fortunately few) that make CORBA-calls need to be changed to use the newly translated Java-modules.

If you can come up with better approach to handle this project, please tell me.

(This project has all the hallmarks of what I like: it is interesting, challenging, and I learn something new)

+1  A: 

I think it is a good idea to just pick up the minimum, and add as needed. Chances are that you gain simplicity that way.

An idea could be to start with Spring as your "grand scheme of things", and integration technology. Then add complements as needed:

  • persistence : Hibernate
  • javaScript : pick a js library that goes well with the Spring MVC module you're using
KLE
+3  A: 

Well first of all it can't hurt to take a close look at the whole Spring Framework in general. The documentation is quite good starting at the very basic module working it's way up to the web MVC layer (where you can decide if you want to use it, e.g. Struts Integration is possible, too - but I found Struts always to be a hassle anyway). Hibernate is the probably most popular Object Relation Mapper framework. It is used to store, query and retrieve you Domain Model Objects (everything that you want to store in the database) but doesn't have anything to do with the web layer.

I personally don't like JSF (another specification monster that takes way more time to get into it than it needs to). If you favour a widget based approach (putting you page together with componentes instead of outputting plain old HTML) you might want to have a look at Google Web Toolkit.

Another Spring sollution is GRails. It is really fun to use and even if you have to learn another (scripting) language (called Groovy) you can still use all your Java legacy classe in the Framework because Groovy classes are compatible with Java classes (and vice versa).

And btw. I thought that CORBA is a technology / protocol / standard that especially allows you to access methods and objects independently of the language. Wikipedia:

The Common Object Request Broker Architecture (CORBA) is a standard defined by the Object Management Group (OMG) that enables software components written in multiple computer languages and running on multiple computers to work together, i.e. it supports multiple platforms.

So why do you have to translate the C++ modules to talk to Java?

Daff
For enhancement/maintenance reasons: the CORBA-related C++ code is unfeasible to uphold (it is old technology anyway: difficult to get hold of libs, it uses 4 year old stuff); for skills reasons: easier to get hold of Java skills than CORBA boffins...
slashmais
Well ok if its worth it and actually possible. I recently connected a 10year old C math library via JNI to a Java webapp. It was the better choice because rewriting it would take ages and it does what it does anyway. But I get your point. Just try to keep it as interoperable as possible this time ;)
Daff
Spring seems to be the way to go - seems to offer all the others as well
slashmais
Yepp many developers aggree, that it is the state of the art at the moment, especially because of the seamless integration with many other Frameworks.
Daff
+3  A: 

First of all, cross Hibernate off your list - while you'd be advised to use it if you've got an ORM requirement it's not related to the web-tier.

Then I think you've two choices:

  • Spring MVC and JSF
  • Struts

Heading down either route is going to commit you to that/those API(s) and a switch at a later date is never going to be painless.

My advice would be:

  • use Spring MVC - you'll likely be using Spring anyway and so it's a natural choice.
  • ignore JSF, write the HTML yourself, using JSTL to render beans.
  • use JQuery/JavaScript to enrich the user experience.
  • use Hibernate for object persistence.
Nick Holt
Ja, Daff gave links to the Spring documentation - that's what convinced me. Thanks for confirming.
slashmais
@slashmais: no worries :-)
Nick Holt