Thursday, April 28, 2011

J2EE Part 1

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




tiered-Architecture_thumb2                                  

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.


Lets talk more on layers... 
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 :)


Let me tell you more on business/service layer and then you can have your coffee break :)
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. 


Coffee Break
J2EE is not a software but is a set of standards/specifications having APIs to make java enterprise app.
Provides a standard for developing multi-tier enterprise services.
It is useful for building apps that span over LAN and needs to make use of its technologies.
It is platform independent.
J2EE technologies include components and services.
Business logic is organized into reusable components... so J2EE is helpful.
Layers are logical divisions of J2EE while tiers are physical partitions depending on number of computing systems used.
The J2EE platform uses a multitiered distributed application model. Application logic is divided into components according to function, and the various application components that make up a J2EE application are installed on different machines depending on the tier in the multitiered J2EE environment to which the application component belongs.

12 comments:

  1. Help me much!! thanks dear..:)

    ReplyDelete
  2. Thank you all for your encouragement. I am glad this could help you. You will be seeing more on j2ee this month onwards.

    ReplyDelete
  3. Good one , i really enjoyed reading and understood clearly
    Keep going

    ReplyDelete
  4. Dude, many many thanks, such a good explanation

    Please, keep on it, we will be glad all the time.

    ReplyDelete
  5. ITZ too helpfull for me thankz for updating ....:)

    ReplyDelete
  6. i really enjoyed reading and understood clearly
    Help me much thanks dear..:)

    ReplyDelete
  7. Help me alot clear understanding of this standard.

    ReplyDelete