A Quick Start

EJB- Simple Introduction:

 We all know that the Enterprise Applications are developed with the set of layers like 3-tier or n-tier architecture. Based on the requirement,we develop our project with some set of  the layers. But Commonly we can find 3-tier architecture in most of the Java Enterprise Application.
                                     
                                         1.Presentation Layer
                                         2.Business Layer
                                         3.Persistance Layer

Persentation layer  is responsible for user interface in which user can interact(html and jsp)

Business Layer is responsible for performing our business operation. Here the EJB comes into play.

Persistance Layer is resposible for storing data into the database.



Why We need Ejb in our Business Layer?
                             
              There is lot of answer for this, for simplicty I can say that it helps us to concentrate only on our Business logic, If you are not understand this now don't worry  it will be clear while we seeing  its features.

              There are Several features like TransactionSecurityPortabilityReusability ,Concurrency etc. For the basic understanding we will look into Transactionality

Transactionality:

              Suppose Consider that We are doing transaction from Account A to Account B.

First Operation: What we do in the database side, we debit some amount from Account A
Second Operation: we add that amount into Account B Holder Account ,

Just assume that after performing the First Operation some problem has occured In this situation Account B won't gets amount debited from Account A,then it is totally wrong rite????????

How We can handle this situation?

               Solution: First Operation need to be roll back,We can write our own logic for this but it is programmer burden.To Reduce the burden EJB provides set of the API's which handle this situation.

I hope your doubt got cleared  for the line Concentrate only on Business Logic.

Java Enterprise Application are web-enabled and java based which tells that write once and run in any java based server.

While talking about server,Question comes to our mind, In Which server I should deploy my application, Either Application Server or Web-server.

Application Server is the place where we should deploy our application.

Why Application Server for EJB?
                Applicaton Server contains EJB Container which supports  features like transaction,security,portability,reusability etc

What is EJB Container?
                Ejb container is nothing but the predefined set of API's (usually called as Ejb Components) which help us to provide all the Ejb features for our business layer.


I hope it is Informative:-)

In  Next Blog We will see Types of EJB Components...........









               
             







Share this

Related Posts

First