An application server is designed to make it easier for developers to focus on developing the business logic in their applications (usually through components) and to develop three-tier applications. Application servers connect database information (usually coming from a database server) and the end-user or client program (often running in a Web browser) with sophisticated features like Connection Management, Transaction Management, and Security Management. But application servers are not limited to these features. Depending on their usage, application servers also need to be scalable and robust. To address these requirements, many application servers offer additional features, such as clustering and failover, load balancing, and so on. The following sections describe some of these application server features. Business Logic ComponentsComponents are the "building blocks" of applications. Business logic components are the pieces of code written by a developer that perform business functions such as validation or calculations on the data or accessing and processing data from the database. The application server provides a well-defined environment for developing and deploying application business logic components. Moreover, the application server provides features such as resource reusability, transactions, security, and so on to the application components, thereby removing the burden on the developer to code these in the components. Connection ManagementConnecting to a database for accessing enterprise data is an expensive operation for an application server. The application server minimizes repetitive opening and closing of database connections by application components by maintaining a pool of connections that is shared among all the application components. Whenever a database operation is required by any application component, it obtains a connection from the application server connection pool. All database activities (such as retrieving or persisting data) are carried out using this connection. At the end of the operation, the connection is returned to the server pool. Transaction ManagementA transaction is a unified series of steps in a program and is an indivisible unit of work. Transactions are sequences of operations on resources operations such as read, write, or update that transform one consistent state of the system into a new consistent state. Data changes occurring as a result of transaction execution can be either committed after a successful execution or rolled back in case of a system failure. Transaction management involves maintaining the integrity of data manipulated by transactions during system failures. Because multiple application components and resources participate in a transaction, it is necessary for the Transaction Manager within an application server to establish and maintain the state of the transaction as it occurs. This is done using a transaction context an association between the transactional operations on the resources and the components invoking the operations. Security ManagementApplication servers provide the ability to define authentication information, access control, and an authentication mechanism to enable access to resources within or outside the application server. Application servers also have methods to reuse the existing security and authentication mechanisms, such as the operating system authentication, digital certificates, and so on. Component Instance PoolingHigh-end application servers also provide advanced features such as component instance pooling. Because component creation or instantiation is an expensive task, servers provide component pooling (similar to connection pooling) to provide better performance. Load Balancing and Fail-safe MechanismsQuite often, to handle a huge load of user requests, multiple application servers are grouped together, often on different machines, with a single point of entry for incoming user requests. This is called clustering. Clustering enables harnessing of the processing power of multiple machines to service user requests. Load balancing involves the use of additional software, such as a request dispatcher that routes requests to the least-busy server that it identifies in the cluster. Thus, it enhances scalability of the deployed applications by ensuring a good response time for user requests by the application server cluster. Normally, load balancing is supported by sophisticated application servers with specialized software. Fail-safe mechanisms in a server cluster consist of rerouting incoming requests to another application server in the cluster in case a server in the cluster fails. This failure can be either a software failure or a hardware failure. Advanced fail-safe techniques, such as maintaining the session integrity across servers in a cluster, are also provided by some application servers. This is done by storing the session data of all servers in the cluster in a persistent storage such as a database. Declarative and Programmatic ApproachesApplication components executing within an application server utilize the features you just studied in two ways:
Now you will take a look at what WebLogic Server 7.0 offers. |