Enterprise Architecture styles
Before we look into J2EE architecture, it is necessary to consider the architectural styles of contemporary distributed applications – 2-tier, 3-tier, and n-tier architecture. The purpose of this section is mainly to enable the reader to recognize the scope of and place for these patterns.
Typically client-server systems are based on the 2-tier architecture, where there is a clear separation between the data and the presentation/business logic. Such systems are generally data-driven with the server most of time being database server, and the client being a graphical user interface to operate on data. While this approach allows us to share data across the enterprise, it does have many drawbacks.
Single-Tier Architecture
Simple software applications are written to run on a single computer. User inputs its verification, business logic and data accessed all these could be found together on single computer, this kind of architecture is called
Single Tier Architecture.
Because of all logic application services, the presentation, business rules and the data access layers exist in a single computing layer.
Advantage:
Single tier system is relatively easy to manage and data consistency is simple because data is stored at only one single location.
Disadvantage:
Two-Tier Architecture
§ Application which is divided into two separate tires, client machine and database server machine is called as Two – Tier architecture application.
§ The application includes the presentation and business logic. Data is accessed by connecting client machine to a database which is lying on another machine.
Thin Client :
With the two tier architecture, if the presentation manager resides only with the client tier then the client is called as thin client. Other presentation logic, application logic, business logic, data logic and database manager reside with the server side.
Thick Client :
Server Client Request Presentation Logic Presentation Manager Application Business Logic Database Logic Database Manager
with the server side.
Normal Client :
With the two tires architecture if the presentation manager and presentation logic reside with the client tier then the client is called as normal client. Others like application logic, business logic,
data logic and database manager reside with the server side.
Advantages :
Any changes made in data access logic will not affect the presentation and business logic. With the two tier architecture it is easy to develop an application.
Disadvantages :
One of the disadvantages of Two – tier architecture is that the application is expected to support a limited number of users. The reason is that each client requires its own connection and each connection requires CPU and memory. As the number of connections increases, the database performance degrades.
§ Another typical problem with a 2-tired approach is that of maintenance
§ Even the smallest of changes to an application might involve a complete rollout to the entire user base.
§ Even if it’s possible to automate the process, you are still faced with updating every single client installation.
Three Tier Architecture
Client Server Presentation Database Logic Logic Business Logic
§ The first tier is referred to as presentation layer and typically consists of a graphical user interface of some kind.
§ The middle tier, or business layer consists of the application or business logic.
§ And the third tier – the data layer – contains the data that is needed for the application
§ The middle tier (application logic ) is basically the code that the user calls upon to retrieve the desired data.
§ The presentation layer then receives the data and formats it for display.
§ This separation of application logic from the user interface adds enormous flexibility to the design of the application.
§ Multiple user interfaces can be built and deployed without ever changing the application logic, provided the application logic presents a clearly defined interface to the presentation layer.
§ J2EE provides several abstractions to meet the needs of each of these tiers.
§ The third tier contains the data that is needed for the application.
§ This data can consist of any source of information, including an enterprise database such as oracle or Sybase, a set of XML documents, or even a directory service.
§ In addition to the traditional relational database storage mechanism, there are many different sources of enterprise data that your applications can access.
Advantages :
It improves scalability since the application servers can be deployed on many machines. The database no longer requires a connection from every client – it only requires connections from a smaller number of application servers. It provides better reusability because client does not have direct access to the database.
Disadvantage :
It increases the complexity because to develop the three tier application is more difficult than developing a two tier applications.
N-Tier Architecture
As the title suggests, there is no hard and fast way to define the application layers for an n-tier system.
In fact, this kind of system can support a number of different configurations.
In an n-tier architecture the application logic is logically divided by function, rather than physically.
§ A user interface that handles the user’s interaction with the application – this can be a web browser running through a firewall, a heavier desktop application, or even a wireless device.
§ Presentation logic that defines what the user interface displays and how a user’s requests are handled. Depending on what user interfaces are supported, you may need to have slightly different versions of the presentation logic to handle the client appropriately.
§ Business logic that models the application’s business rules, often through interaction with the application’s data.
§ Infrastructure services that provide additional functionality required by the application components, such as messaging, transactional support.
§ The data layer where the enterprise’s data resides.
Advantages :
§ Separation of user interface logic and business logic is done. Business logic resides on small number of centralized machines (may be just one).
§ Easy to maintain, to manage, to scale, loosely coupled etc.
§ Additional features can be easily added.
Disadvantages :
§ It is having more complex structures and difficult to setup and maintain all the separated layers.
No comments:
Post a Comment