Saturday, September 24, 2011

J2EE Introduction for beginners

J2EE - Java 2 Enterprise Edition is one of the 3 java platforms, the other being J2SE and J2ME. It is set of specifications or standards consisting of many APIs useful for building java based enterprise applications. At such it is not some software to be installed but is just a bundle of many technologies having set of APIs.

J2EE applications are java applications that span over LAN, WAN and broader. They are used when it comes to distributed environment and disparate systems and also when in need to make use of its technologies.

J2EE technologies are broadly classified into two categories:
1. Component technologies
2. Service technologies

Kinds of J2EE Components:
Client Side Comonents -> includes applets
Web Components -> includes servelets and JSPs
Business Components -> includes EJB
Web components and Business components run on Server Side...

Kinds of J2EE Services:
JNDI -> Java Naming and Directory service
JMS -> java Messaging Service
JTA -> Java Transaction API
JAAS -> Java Authentication and Authorization Service
Java Mail

J2EE is meant for building the 3 layers of java based enterprise application. The layers being:
1. Presentation Layer
2. Service/Business Layer
3. Data Access Layer

We have been talking on java based enterprise application... To clear you on it:
A computer application used to manage business services of an enterprise is called enterprise application and if the application is coded in java and is deployed into J2EE compliant application server then it becomes java based.

Any enterprise application generally covers 4 main tasks:
1. providing user interface(UI) to the user.
2. processing of data according to some business logic(rules)
3. interacting with database(data access)
4. storing of data
These tasks are logically divided into 4 layers
A. Presentation layer
B. Business/Service layer
C. Data Access Layer
D. Data Layer

J2EE developers are responsible for the first 3 layers while the data layer is the responsibility of database administrator(DBA). Hope you are clear on the layers... Remember they are just the logical division. Now coming to actual or physical division...

The physical partition of enterprise application is known as 'tier'. The enterprise application can be single-tier, two-tier, three-tier, n-tier or distributed-tier depending on number of computing systems on which the layers are installed.

Presentation Layer is the user interface part of the application. If the app is web based then Servelets and JSPs are used to build it on server side. The main design patterns used in this layer are Front Controller, Model-View-Controller(MVC), Composite View.

Business/Service Layer is nothing but a code that processes data according to business logic(rules). Some important design patterns used in this layer are Service Locator, Business Delegate, Session Facade. Job of service layer is to receive the business request from presentation layer or some other service layer, communicate with data access layer to get the enterprise data, process that data using defined business rules, return the result to the requested component

Data Access layer is again a code which communicates with the database. It performs CRUD(Create, Read, Update, Delete). Therefore it is just a code communicating with database specific APIs such as JDBC. The design patterns used are Data Access Object(DTO), Data Transfer Object(DTO), Value Object. Can you guess what its job is??? It receives request from service layer, communicates with the database to perform the requested operations and sends the result back to service layer.

So now you clear on J2EE basics.

We already know what is the job of service layer but in order for it to implement it, it needs some capabilities... like transactional capability, distributed computing capability, security implementation capability.
To have these capabilities we make use of J2EE technologies(both components and services). Just scroll up and read the first three paragraphs... This should make it clear for you.

No comments:

Post a Comment