Multi-tier Applications
There is a way to make the benefits of client/server outweigh
the drawbacks. The multi-tier client/server architecture provides
an environment which supports all the benefits of both the one-tier
approach and the two-tier approach, and also supports the goals
of a flexible architecture.
The three tiers refer to the three logical component parts of
an application, not to the number of machines used by the application.
The multi-tier application model splits an application into its
three logical component types-presentation logic, business logic,
and data access logic, where there may be any number of each of
the component types within an application. The application components
communicate with each other using an abstract interface, which
hides the underlying function performed by the component. This
infrastructure provides location, security, and communication
services for the application components.
Object Reuse in Other Applications
The advantages of a multi-tier environment extend beyond the life-cycle
of a single application. In fact, what is being built is not actually
an application: it is a collection of client and server modules
that communicate through standardized, abstract interfaces and,
when combined, they behave like an integrated application system.
Each module is actually a shareable, reusable object that can
be included in other application systems. This plug-and-play versatility
is useful when an IT department needs to support different but
related parts of the business.
For example, a strategic application within a sales department
should be able to view inventory information and interface with
the order entry system. Therefore, the sales application could
include business and data access objects from the inventory and
order entry applications. These objects could also be reused in
a strategic scheduling application for the manufacturing department.
Abstract Interface
The object-oriented concepts of encapsulation and abstraction
are fundamental to the multi-tier architecture and to application
flexibility. Each application component can be viewed as an encapsulated
object-a data structure with a set of operations or methods that
can be used to manipulate the data. The data within the object
can only be manipulated by using one of the defined operations.
The operations are invoked using an abstract interface. The abstract
interface identifies the operation to be performed and defines
the input and output parameters that are required to perform the
operation.
An abstract interface masks the actual application logic performed
within the application object. The abstract interface allows the
object to be viewed as a black box by the outside world. More
to the point, the application logic within the object can be modified
or replaced without impacting the other application objects that
interface with it. As long as the operation, the input, and the
output parameters do not change, no modifications need to be made
in any other component.
Easier System Maintenance
The most obvious advantage of a multi-tier architecture is ease
of maintenance. Since application functions are isolated within
small granular application objects, application logic can be modified
much more easily than ever before. For example, one function that
is performed by a financial application is to project post-tax
earnings. The algorithms of this function change periodically
as tax regulations change. Normally, changing tax regulations
requires significant modifications to the entire financial application.
By isolating these business rules into an autonomous business
object, the algorithms can change to match the tax regulations
without adversely affecting the rest of the application.
A More Effective Use of Data And Networks
A more subtle advantage of the multi-tier architecture results
from the fact that the application logic is no longer tied directly
to the database structures or a particular DBMS. Individual application
objects work with their own encapsulated data structures, which
may correspond to a database structure, or may be a data structure
derived from a number of different data sources. When application
objects communicate, they only need to send the data parameters
as specified in the abstract interface rather than entire database
records, thereby reducing network traffic. The data access objects
are the only application components that interface directly with
the databases. Conceivably, a database could be completely migrated
from one DBMS to another without adversely affecting the entire
application: only the data access logic would need to be modified.
This autonomy provides IT departments with the ability to better
react to either business or technological changes.
The abstraction of the data access logic leads to another significant
benefit. The concept of data can be extended to include sequential
files, indexed files, nonrelational databases, data feeds, and
even legacy application systems. There are no limitations based
on the capabilities of SQL. A set of data access modules can be
developed to provide access to these legacy environments, with
a convenient set of abstract interfaces that are accessible from
anywhere throughout the enterprise. The abstract model also proves
valuable when migrating legacy data structures to relational systems.
In a multi-tier world, a data access module that accesses legacy
data today can be replaced by a data access module that accesses
relational data tomorrow, without affecting the rest of the application.
Higher Developer Productivity through Specialization
With two-tier methodologies, each programmer must develop all
aspects of an application, including presentation, business, and
data access logic. This approach does not exploit the fact that
most programmers excel in certain tasks and not in others, and
that they are more productive when they are specialized.
In a multi-tier world, programmers who have excellent user interface
skills can concentrate on developing powerful presentation components,
and they don't need to know, nor do they care, about the inner
workings of the application's business logic or how the data is
accessed from a database. Meanwhile, database analysts who know
the best ways to access data from a database do not need to be
concerned with how the data is presented to an end user. Business
analysts can concentrate on developing business algorithms. When
a business component requires data, it calls the appropriate interface
to call the data access component.
Distributed Computing Infrastructure
Integral to the workings of the multi-tier architecture is a distributed
computing infrastructure. A distributed computing infrastructure
provides the services that allow the application components to
be transparently distributed across any number of physical systems,
a concept often referred to as partitioning.
The partitioning of application components across a number of
different systems introduces a new spectrum of technological issues:
- Where should a server run?
- How many copies of the server should be running?
- How does a client know where the server is running?
- How does a client learn of the existence of a new replica
of a server?
- How do you transfer requests between a client and a server?
- How do you manage security across the distributed environment?
In the two-tier environment, communications are accomplished using
the DBMS connectivity environment. The developer must identify
the location of the database system within the application, and
the client application and/or the database system performs the
necessary security checks. Conversely, in the multi-tier environment,
communications are performed through an abstract interface. The
abstract interface does not indicate the actual location of the
requested server object. The application programmer does not need
to directly address these issues. Server location, security checks,
and communications should be handled dynamically at run time by
a distributed computing infrastructure.
A dynamic distributed computing infrastructure allows the distributed
application environment to be reconfigured to accommodate additional
users, increased workloads, or unexpected hardware failures as
they happen, without loss of service. Physical partitioning of
application systems is the most effective means to support scalability,
reliability, and availability issues. As additional users are
added to the system, CPU utilization exceeds acceptable levels,
or database connections overwhelm memory, server modules can be
shifted to alternate machines or can be replicated across a number
of machines. Physical partitioning maximizes hardware utilization
because partially idle machines can be incorporated into a load-balancing
mechanism. Overall system load can be spread evenly across a number
of different machines. Because each application component can
be replicated independently, virtually any server machine can
be used to run some part of the application for some set of users.
Service distribution and replication do more than eliminate processing
bottlenecks. They also provide a mechanism for fault tolerance
and increased system availability. The replication of services
removes any single point of failure. If a particular process encounters
a problem, a replica can handle subsequent service requests. If
a server machine unexpectedly shuts down or an entire network
subnet becomes unavailable, the requests can be directed to application
replicas on other systems.
Obviously, the distributed computing infrastructure that enables
application partitioning, transparency, security, scalability,
reliability, availability, and manageability is a critical component
for the development and deployment of mission-critical, multi-tier
client/server applications. There are three major services which
must be provided by the distributed computing infrastructure:
- Directory Service
A directory service maintains a dynamic list of all application
services throughout the enterprise. Whenever a client makes a
request, the directory service locates an application service
which can handle the request and tells the client how to communicate
with the service.
- Security Service
A security service maintains a registry of all authorized users
throughout the enterprise and keeps track of which functions each
user or groups of users are allowed to perform. The security service
provides a single login service for all systems throughout the
enterprise. Once a user is authenticated by the security service,
he is authenticated on all systems.
- Application Management Service
An application management service maintains a dynamic configuration
of application services. It is responsible for starting the appropriate
application services on the appropriate machines and monitoring
the application services to ensure that they are available and
performing within required parameters. If any application services
are lost, the management service must restart the service or perform
some other appropriate action, according to the configuration.
As load increases or decreases, the management service can start
or stop replica services on various nodes throughout the enterprise.
Borland is able to provide these three services via Delphi 3 Client/Server
and Borland MIDAS. The three key broker technologies available in Delphi
3 and Borland MIDAS-the Business Object Broker
, the Remote DataBroker,
and the ConstraintBroker-provide a solution to these distributed
computing challenges. For a complete discussion of the Borland MIDAS broker
technologies, please refer to the Borland MIDAS Overview white paper.
Summary
A multi-tier application architecture is the most effective and
comprehensive system architecture available for developers. It
overcomes the limitations imposed by one-tier and two-tier structures
without compromising any part of the development process. The
benefits of a multi-tier system can be summarized as:
- Object reuse and sharing for minimal recoding time
- Abstract interface for flexibility
- Easier system maintenance
- Effective use of data and networks
- High developer productivity
- Distributed computing infrastructure allowing for transparency,
security, scalability, reliability, and availability.
With Delphi 3 Client/Server and Borland MIDAS, Borland provides tools
to enable the multi-tier application developer to take advantage
of the benefits inherent in this infrastructure.