14 Overview of Enterprise Application

Pravin Jain

What do we understand by Enterprise Application?

 

To understand it let us begin with comparison of small application or application used at a smaller level and how the requirements change when the application has to be used by an enterprise.

 

For example, let us consider the banking domain. Suppose we have to develop an application for a single bank with a single branch, then the requirements are as follows.

 

Business Logic for the application. But when we have to develop the application for the multinational bank, what can be the changes in the requirements? Do you think there can be any changes in the business logic? No it does not require any change in the business logic, then what is different here? What are the requirements for an enterprise? The thing we are trying to look in this module is the kind of requirements which are new, which arise because of the size of the application, the size of the usage of the application, because it is an enterprise where the application has to be used, the requirements are not related to the domain here.

 

What we are trying to address here is we have common requirements for all enterprise applications, it is not dependent upon the domain to be used. So the purpose of this module is to understand what kind of problems are there and how the problems need to be solved, what are the problems arising due to size of the usage, because the enterprise wants to use this application. So if we are doing development for an enterprise then what are the needs?

 

The needs are related to:

  1. High Volume/High Scale
  2. Scalability
  3. Powerful databases
  4. To be in network application
  5. secured

These are the common things but not related to the domain for which we are developing, so what we have is lot of frameworks and specifications which talks about solving these common issues, these are not the issues which are related to the domain but common across all the domain.

 

So let us look into the common problems that has been solved in the enterprise application and how the solution is given.

 

So if we talk about single bank lets say then we might not think of the different tiers and you might have single program doing all the jobs like taking care of the presentation part, business logic part, data management and so on all the things bundled into a single program, you have not separated all the things, they are tightly bound together. But if you want to use it for an enterprise then design needs to be much better now, such a poor design will not work. We need more flexibility, scalability, mainly we would like to scale the application and if we want to scale the application then we need to divide our application into various tiers. One important tier will be the business tier where all the business logic components will be available which would be domain specific. Then we will have client tier, the client will be the separate machine and not the same machine where the business logic should be used.

 

Nowadays the offered client is web based. So these requirements are not just for enterprises but even the small businesses would use this kind of design where we would like to divide our application into various tiers.

 

So another important tier is client tier where presentation is taken care of. So we will have a client tier where we might use a browser, someone may opt for standalone GUI application which would then be interacting with the business tier or standalone java application or non java application when we want to use it with java enterprise application.

 

So we might have client tier a browser in case if it is a web based. In case, if we are using browser as a client tier then for the web you will have another tier which is web tier where we will have the components which would handle the interaction from a browser or any kind of a web client.

 

So we will have one tier which is a client tier and another tier with which the interaction will take place and that will be a web tier. The web tier would have the components to handle the request coming from a client, but there purpose is to provide http/web based interaction.

 

The purpose here is to accept the request and give proper response. But for giving the response, it should go through and interact with the business tier. So there is the separate tier i.e. business tier which in turn will have the components which are having the business logic. So management of these components which are having the business logics is another aspect to be taken care of. Business tier require a lot of data to be processed so some persistence or data related tier needs to be there. So basically for any enterprise application or normal application it is a good practice to divide the application into these kind of four tiers i.e.

  1. Client Tier
  2. Web Tier
  3. Business Tier
  4. Data Tier

So the way the interaction takes place is like we have client as a browser trying to interact with the web tier, In the web tier there should be some components which can accept the request from the browser which further interact with the business logic which is available in the business tier fetch the results and gives appropriate response back to the browser or whatever the web client is.

 

The business tier here is not at all responsible for the presentation but have the business logics. This is purely dependent upon the domain. So this is the tier i.e business tier where the developer should be spending more energy. Of course it will be required from the business tier to be persisting lots of data and to be able to retrieving those data. For that we have a separate tier from which the business tier can take help and that is in the form of data tier.

 

So now lets look into what we have as far as java technology is concerned.

 

Java Enterprise Edition?

 

We have our java enterprise edition. So what is this java enterprise edition? It is a specification/standard which will help for developing application following good design pattern, where we can divide our application into these kind of different four tiers.

 

What is JavaEE composed of?

 

It is a mega specification which in turn is made up of smaller specifications.

 

The main specification which the javaEE offers is EJB specifications. EJB specification is addressing the business tier. EJB specification is about how to manage the business components and not about developing the business components, developing a business component is going to be done by developer. But how do i manage these business components because when we talk of an enterprise, In an enterprise there will be so many clients who will have to be responded to. So we need to scale up the number of clients we can address. So to be able to service so many clients, we might have a need of pooling for lots of business components, it is not a single business component for a particular kind of a business logic. The same business logic may have to be available for multiple clients simultaneously, so we need something like pooling. Like pooling of our business components. so such things will be made available to us through EJB container.

 

So EJB is going to be our business component. But managing EJB is going to be done by what we call as EJB container

 

There is a specification about EJB in javaEE.

 

Like EJB specifications which addressed the business tier there are other specifications which take care of may be messaging, like we want messaging between various components of our business logic for which we have again another specification, JMS specification.

 

So there is a standardization on how a messaging should be handled. So there should be a standard of addressing a message. So the main purpose of javaEE is to provide a standard to address all the issues of enterprise application.

 

So we have got specifications for EJBs, JMS, Messaging services. Similarly we have to manage different business objects to be stored. They may be stored in a hierarchial structure for which we have different directory services like someone might use LDAP, someone might use ADS of windows environment. To access any kind of directory services JaveEE has separate specifications called JNDI specifications.

 

JNDI is useful for accessing business components which are available through the directory services. Some client looks up and want to locate any business components then directory services are commonly used for it. So we have many specifications like this. As far as web tier is concerned in JavaEE we have a separate specification, and to handle the request from the client we have a separate specification called servlet specifications, it is a servlet specification which handles the request, interacts with the business tier and interacting with the EJBs. The results from the EJB may be available to the servlet in the form of JavaBeans Components.

 

Java Beans again is another specifications which is part of the JavaEE specifications. Do not get confused between EJBs i.e. Enterprise Java Beans and plain Java Beans components with some getter setter methods.

 

EJB is not about getter and setter but it is about components which are business components which are going to be managed in a EJB container, and Java Beans are simple plain java components with properties, getter setter methods for which there are separate specifications. As far as data tier is concerned the business component wants to do some persistence, so if it wants to use persistence for data tier it might use JDBC. So we have specifications for JDBC.

 

Another specification which is becoming more popular nowadays is JPA i.e. Java Persistence API specifications. JPA is very useful since we dont have to worry much about the structure of the tables i.e. how the tables are going to be created, dont have to look into the details of the tables. The developers have to more concentrate on the logic part, the kind of classes to be used, the kind of objects to be created rather than worrying about what kind of table developer have to create, how to fetch the data from the table to create my object, if there is an object how do i persist and put the entry into the table, so persisting object that aspect can be taken care by JPA. So JPA is another specification which is also a part of the JavaEE specification.

 

So, JavaEE is a huge specification. Let us come back to the web tier, In the web tier there is a servlet but like servlet there is another aspect in the web tier. The web tier is also responsible for giving a response, it is not only responsible for accepting a request and doing some processing, Accessing the business tier, after getting a result from the business tier, the result has to be presented back to the client to a browser. So, the presentation in a browser is also important. To address that issue of presenting to a browser, Servlet may be a very tedious thing, so we have one more specification in our web tier which is related to a presentation in a browser, this is the JSP specification.

 

JSP is concentrating more on presentation aspect i.e. how to present our results. So in the web tier for JavaEE, we have servlet specification, JSP specification. Again in JSP we have further components which are used as a part of JSPs.

 

It is a presentation tier which is the job not normally done by java developer but it is going to be designed by some web designers and we know that web designers are more use to tags, it all started with the html. So, web presentation normally starts with html which is nothing but lots of tags. So continuing on those lines of providing tags there is a provision of adding new tags, there is provision of having your own tags which are over and above the ones available from html.

 

So lots of tags has been provided as part of the JSP specifications. There is also one more specification which addresses the issue of providing some kind of standard tags for the jsp and that is what we have as JSTL.

 

To make things more simpler for the web designer where the web designer may not have much knowledge about java programming language. So as far as JSP is concerned within JSP one thing is that, a web designer will be able to use lot of tags which are available to him through the JSTL specifications.

 

So we have one specification for the JSTL. We also have another specifications which is about an expression language which is very simple kind of a specification.

 

Expression Language is a very simple way to use the various java objects directly in the web page, not worrying much about java syntax and the web designer should be able to use the objects directly and very easily. So we have specification for expression language also.

 

So if you look at javaEE, it is nothing but the specifications which is made up of a lot of other specifications. It is composed of lots of other small specifications.

 

There are many specification but we have seen only the most commonly used ones. The purpose of javaEE is to provide some kind of standards which would help developer to easily develop enterprise application. So that is the main purpose of javaEE.

 

It provides mainly an environment in which infrastructure is provided for enterprise application. So what we use here is known as an application server, a common term used here is an application server. So a JavaEE programmer would be the one who is dependent upon an application server.

 

An application server is simply an implementation of all the specifications which are covered by the JavaEE specifications. So JavaEE is a standard/specification composed of small specifications.

 

So JavaEE is a standard and not a readymade product it is just a specification. So, what we have is we have a lot of options in terms of implementations of these specifications.

 

There are lot of vendors who provide this kind of implementation of the specifications. for eg.: we have WebSphere which comes from IBM, we have JRun, JBoss, Glassfish, etc.

 

So like this we have lots of implementations. So one can search and according to the requirements like i need something from the open source, in the open source we need something which has more features. So we may have these application servers which are nothing but implementation of the javaEE specifications. Each implementation will have to implement the standards atleast. They may have their own advantages.

 

So as far as a developer is concerned or where the application needs to be deployed is concerned there are lot of options for the end user, he can choose what implementation he wants to go for. The developer can develop his components by following the standards. It becomes very easy for the developer if he follows the standards for development. He can shift his application from one application server to another kind of application server.

 

You might have deployed your application on Websphere and someone says i would like to use JBoss to deploy this application then you dont have to wait for changes. There is no changes as far as all servlets, components etc runs as

 

it is on another server. That is the big advantage you get with the javaEE as a specifications and not as a product.

 

So application server provides an infrastructure for enterprise application. So the development becomes easier and so the maintenance. Actually forcing programmer to follow a better design. Programmer have now already started thinking about placing their components into various tiers rather than creating an application which is tightly coupled. so it provides more flexibility.

 

Suggested Reading:

  1. Java Server Programming for Professionals by Ivan Bayross, Sharanam Shah, Cynhthia Bayross and Vaishali Shah Shroff Publishers and Distributros.
  2. Java EE 7 Essentials: Enterprise Developer Handbook by Arun Gupta, O’Reilly
  3. https://docs.oracle.com/javaee/7/tutorial/overview.htm#BNAAW