How to create a Java application

Soon I will need to start a web project for the company, and now I need to choose the technology to create the application. I am thinking about using Java, so I would like to find a framework that will help me build the application (I use a PHP framework like CakePHP and CodeIgniter).

What I don't understand is that there seem to be many frameworks and technologies that do not have the same purpose. Action Framework, Component Framework ... what can I do with what I cannot do with another? It seems that a Java application should evolve by mixing a lot of different technologies, so I lost a little ... I looked at various java frameworks like JSF, Stripes, Struts2, Tapestry, Wicket and Spring. About the later, I do not understand what the different parts of this structure are, what it can do for me and what it cannot. What can I take from Spring and what I do not need ...

Therefore: what do I need to create a Java application?

I have already used JSF for a basic CRUD application, but I'm trying to find something that I like best. The application that we will need to create will be both a community platform and a seller’s site, with reasonable data for protection :)

About ORM, I think I’ll just switch from Hibernate ... I also heard about Maven or Ant, how can they help me?

Any advice / recommendations would be highly appreciated :-) Thanks in advance.

Edit: what are my needs: a java framework that:

  • well documented / easy to get help / as easy as possible ...
  • The more java the better
  • Ajax friendly / Ability to create a nice interface ...
  • Internationalization
  • However, as a student, the market ability of skills may be important ...

The build application is

  • Community site: web 2.0, CRUD
  • Ecommerce website

full specifications are not yet complete.

+4
source share
5 answers

This is a very difficult question to answer, being in your situation recently, I will try to give some idea. Basically, with Java there is a ton of choices for frameworks, and no one can really tell you which one is best for you, what we can do is give you a breakdown of some technologies.

The following is what I found in looking for the exact answers you want.

There are many technologies in Java that try to provide a full-stack solution. These technologies can be broken down into other technologies, but work well when you use them together.

Basically, there are 3 levels for web applications, presentation, business and data level. Presentation level is the interface that the user sees. You can combine and contrast technologies for these three layers. For example, you can use the front-end with the Spring interface for IOC and Hibernate as your ORM.

There are many great technologies you can use for the presentation layer, including Spring-MVC, STRUTS, Stripes, Wicket, JSF / SEAM and Tapestry among several. Most of them use JSPs for presentation using JSTL, with the exception of the gate, which actually completely separates the html from the logic using Java components (POJOS). There are advantages and disadvantages to both approaches. The advantage of the gate approach is that you have static type checking and full html separation so you can pass it to the designer.

For the business layer, people usually use some kind of management inversion structure (IOC) for Injection Dependency (DI). Spring and Seam are popular structures for IOCs; they have related technologies such as Spring-security and are generally supported by other technologies. Google Guice seems to be popular for the direct 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 I cannot provide more information.

Tapestry is another framework that tries to be a full stack of what I understand, and takes a gate like (or, I think, Wicket uses a tapestry-like approach). Grails is another full-featured infrastructure 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 and very active IRC mailing lists / chats. What you need to do is take a look at them and then decide which one is right for you. No one here can tell you what you like.

If you need a recommendation, I would like to use the Wicket / Guice / Hibernate stack once.

+9
source

My favorite is definitely Spring. The new Spring MVC 2.5 is simple and quick to set up, with a lot of annotations to help you advise your controllers declaratively, making printing a lot easier. It also integrates with the Spring container, which is by far my favorite J2EE light weight container. I usually combine SpringMVC with a simple JSP, but there are many other technical experts to choose from. For persistence, I usually use Hibernate. It might be worth taking a look at Spring ROO , which is similar to Grails without Groovy. Spring Security offers a pleasant and easy declarative way to provide security and integrates with 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 version requirements, and maven will download all the libraries and their dependencies for you. However, this forces you to follow a specific project layout. For ant there is ivy that fulfills dependencies.

+3
source

I suggest you take a look at Grails . Grails is a convention-coding web application framework based on a stack of proven Java frameworks (Spring, Hibernate, ...) and using Groovy ..

The beauty of Grails is that you need a little knowledge of Spring, Hibernate, etc. to get started. But after that, you will still have access to the full power of these frameworks, if necessary.

+2
source

Definitely use Spring for the back; there is a great community on the free support forum (you can also pay for more official support).

As for your decision to use Hibernate, you can program it against JPA to separate your application from Hibernate (which is one of several JPA implementations).

If you need an Ajax interface, take a look at the ZK framework; it is very easy to use without learning JavaScript and avoiding the use of plumbing libraries such as DWR.

+2
source

Other users recommending using Spring is a great idea. You will find that you will actually use several different frameworks because each infrastructure solves a slightly different problem.

I would suggest that you invest some time in every infrastructure or technology before jumping, but in the end you will want to make them work together. For example, you might need to install Struts + Spring + Hibernate. Setting them up can be a headache.

Therefore, I suggest you use AppFuse , which helps by creating a basic application with basic functions. This is a huge time saver. Of course, you need to understand the various structures customized for you, so this is not a magical solution.

+1
source

All Articles