Friday, September 12, 2008

EJB With three tier structure, expecting a great future ahead

Java beans are Java objects and its  application determines the methods and properties available in an object using reflection. Its methods and properties can be determined by an application at run time and customize it's properties using the methods available for that object.

Description of Enterprise Java Bean (EJB) application development is incomplete without the  understanding of what a java session bean actually is. So Java session beans are Java components that run in either stand -alone EJB containers that are part of the standard java platform enterprise edition application servers. These java beans are typically used to model a particular task or use case such as input of customer information or executing a process that maintains a conversation state with a client application.
Most of the database driven applications are developed using open source technologies  having  a three-tier structure. The web application itself runs in the browser of a desktop or a laptop. Users can only access the front end of the application to input data or search strings. Java being platform independent allows applications to be accessed on any device say a pda ,cellphone or  telnet device.
EJB application development occurs by employing a three-tier architecture consisting of a front end known as the web container, an EJB container, the third tier being the database. This three-tier structure has proved to be immensely useful for enterprise application development.
EJB  container manages the server side components .Their similarity to Java Beans r is only to the extent that they both share the name Bean and both are customizable components. A normal Java Bean is basically an Intra-Process Component,where as an EJB is an Inter-Process Component. That means that an EJB component can be accessed and used by many processes existing in different JVM s.

In order for a container to be able to manage bean instances,EJB classes must implement certain interfaces that contain the call back methods that a container invokes to notify the bean instance of any change in it's properties or to inform the bean instance of any specific action that it has to take        
An EJB is written as if it is a single threaded application. In fact,EJB classes can never be multi threaded. They can not be threads themselves nor can they start any new thread. It is the job of the container to manage instances of EJB classes.
However all the  fields available in a class are  not directly accessible.  The application inspecting the java object can manipulate only those for which there are public methods available to get or set the fields of the object. Further, if an application has to create an object and set it's properties,the class defining the object must have a public default constructor which the application can call.
Hence  it is quiet important  for a normal Java object to qualify as a Java bean and the class that defines the object must have a public default constructor which should implement the serial interface if the bean state which has to be stored provided it should have methods that allows the  application builder to customize their properties.

For  this the server side application should monitor data on each bean instances and update the modified value of all bean instances. Again,providing a private bean instance to each client can be a load on system resources such as memory. To make a balance between performance and resource utilization,it becomes essential that  limited number of bean instances are shared among a larger number of clients,with the server side application managing the  problems related to consistency of data among all the shared bean instances.
Any of the above-mentioned technologies JSP,JSF, java servlets can be used to call a session bean. Since the Enterprise java bean container is connected to the database, it is capable of processing the queries of the users. Once the session bean is invoked , it processes the request and sends a feed back to the web application. The web application then formats the response as required and returns a response to the client end.

Being open source EJB application development is expecting a very bright future in the enterprise application development space in coming time.

A-1 Technology, an offshore software outsourcing company is working on java technology . Various small and large organizations can greatly benefit from this wonderful technology. A-1 technology has best in class resources for java technology that can help in leveraging the capabilities of java to reduce development cost and time to market.