Soon I will have to start a web project for a company, and I now need to choose a technology to build the app. I'm thinking about using Java, hence I'd like to find a framework that will help me building the app (I'm used to PHP framework such as CakePHP & CodeIgniter).
What I don't understand is that it seems to exist a lot of framework and technologies that don't have the same goal. Action framework, Component framework ... what can I do with one I can't do with another ? It seems a java web app should be developped by mixing a lots of different technologies, hence I'm a bit lost ... I've had a look at differents java frameworks, such as JSF, Stripes, Struts2, Tapestry, Wicket and Spring. About the later, I don't quiet see what are the different parts of this framework, what can it do for me and what it can't. What can I take from Spring and what I don't need...
Hence : what do I need to build a java web application ?
I've already used JSF for a basic CRUD app, but I'm trying to find something that may better suits my need. The app we'll have to build will be both a community platform as well as a merchant site, with sensible datas to protect :)
About the ORM, I guess I'll just go with Hibernate ... Also I've heard about Maven or Ant, in what way can they help me ?
Any advice/guideline would be much appreciated :-) Thanks in advance.
Edit : what my needs are : a java framework that is :
The app to be build is both a
full specs aren't finished yet.
This is a very tough question to answer, having been in your situation recently I will try to give some insight. Basically, with Java there is a ton of choice for frameworks and no one can really tell you which one is best-fit for you, what we can do is give you a breakdown of some of the technologies.
The following is what I have come across in search of the same answers you want.
Java has a bunch of technologies that try to provide a full-stack solution. These technologies can be broken up into other technologies but work well when you use them together.
Basically, there are 3 tiers to web applications, the presentation, business and data tier. The presentation tier is the front end, what the user sees. You can generally mix and match technologies for these three layers. You could for example use a stripes front-end with the Spring framework for IOC and Hibernate as your ORM.
There are many great technologies that you can use for the presentation layer, including Spring-MVC, STRUTS, Stripes, Wicket, JSF/SEAM and Tapestry among a few. Most of these use a JSP for the view using JSTL, with the exception of wicket which actually full separates the html from the logic by using Java "components" (POJOS). There are benefits and drawbacks to both approaches. The benefit of the wicket approach is that you have static typechecking and a complete separation of the html so you can hand it off to your designer.
For the business layer generally people use some sort of Inversion of Control framework (IOC) for Dependency Injection (DI). The popular frameworks for IOC are Spring and Seam, these have associated technologies like Spring-security and generally are supported by the other technologies. Google Guice seems to be popular for a straight DI framework.
Finally, for the data layer most people tend to use Hibernate or JPA. There are others, but I have no experience with them and cannot offer any more information.
Tapestry is another framework that attempts to be a full stack from what I understand and takes a wicket like (or I guess Wicket takes a tapestry-like) approach. Grails is yet another full-stack framework using Groovy and built on top of Spring and Hibernate. If you like Rails, Grails is pretty good.
Most of these technologies have a lot of information available and very active mailing lists / IRC chatrooms. What you need to do is take a look at them and then decide which approach is the right one for you. No one here is able to tell you what you will like.
If you want a recommendation, I would like to one day use a Wicket/Guice/Hibernate stack.
My favourite is definitely Spring. The new Spring MVC 2.5 is easy and quick to set up, lots of annotations to help you wire your controllers declaratively which saves you a lot of typing. It also integrates with the Spring container which is definitely my favourite light-weight J2EE replacement container. I usually combine SpringMVC with simple JSP, but there are a lot of other view techs to choose from. For persistence I usually use Hibernate. Might be worthwhile to take a look at Spring ROO which is kind of like Grails without Groovy. Spring Security offers a nice and easy declarative way of doing security and integrates into a whole bunch of authentication technologies.
Maven and ant are both build tools while maven also handles dependencies for you. You "just" set up descriptors that describe the libraries you want and the version requirements, and maven will download all libraries and their dependencies for you. It forces you to follow a certain project layout, though. For ant there's ivy which does dependencies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With