user3776671
user3776671

Reputation: 1

Java EE 7 architecture options for each tier

I want to develop a java web application using the java EE 7 technology. I also want to separate it into the 3 tiers (presentation, business logic and data persistence). As far as I know, I have 3 options for the presentaion layer. Those are: JSP 2.3, JSF 2.2 and Java Servlet 3.1

Which are the options for the other 2 tiers? I have to use compulsory EJB 3.2 for the logic business and JAVA Persistence for the data tier? Or I can use frameworks like Spring an Hibernate. Remember that I want to develop it making use of Java EE 7 technology.

Upvotes: -2

Views: 543

Answers (1)

Alexander Rühl
Alexander Rühl

Reputation: 6939

Basic recommendation is (also issuded by Adam Bien in every talk) to start with the basic Java EE API and only add frameworks if you really need them.

The current standard way to do Java EE server-side web applications is using JSF. Don't bother with JSPs anymore and servlets will usually be used under the hood.

As for the business tier, you can use EJB, which gives you many services of the container for free (e.g. transaction), but it is also ok, to only make use of CDI components for it - especialy if your target runtime environment is not a full application server, but for example only a Tomcat.

The persistence tier is clearly JPA.

But you don't have to necessarily think in separated tiers - following the principle to keep things simple, you can start with a component which is altogether a view handler for your JSF view, holding the business logic of your use case and persists entities accordingly - and then only extend the architecture if necessary.

Upvotes: 2

Related Questions