Multi Tier applications

S

Saeid Bagheri

Dear friends
I want to know a bout multi tier applications, whats the meaning of layers,
for example whaty is Data access layer? i cannot understand the concept.
is layes just specific classes ? of different projects? what is the benefit?
can you please let me know an example?

Thanks
 
K

Kevin Spencer

There are several basic logical parts to almost any application:

1. Stored data
Data is stored in a database or the file system. Some data may be
changed by the application
2. Business rules and business logic
This is the code that ensures that the "business rules" are followed. It
encompasses the logic and processing that manipulates data.
3. User interface
This is the part that humans interact with. It can also be a programming
interface, which is somewhat different, but is still an interface that is
used to communicate with the program, input and output.

In the beginning, an application was simply a long stream of consecutive
instructions. But over time, software has evolved and become very complex,
including things like multi-tasking, threading, object-orientation, and
multiple interfaces.

The concept of "tiers" or "layers" is an idea that incorporates several
philosophical concepts. One is reusability. When the parts of an application
are not as dependent upon other parts, they can be reused easily in another
application. This began with function libraries in DLLs, and has continued
and evolved. If you've ever heard the term "loose coupling," that is the
idea. Each part of an application is as independent as possible, so that it
can be changed without having to rewrite the entire app, and so that it may
be used in other software.

Since almost all applications use some form of data store, be it a database,
file system, or what-have-you. Databases are quite commonly used. Therefore,
having a set of classes (or a class library) that can interact with all
sorts of databases while providing the same programming interface is a good
idea. In order to minimize dependencies, the "Data Layer" or "Data Tier" is
designed to know nothing about the data it works with. It knows how to fetch
it, change it, create it, delete it, etc., but whatever uses the Data Tier
must tell the Data Tier what it needs to do. In addition, the Data Tier does
not manipulate data, because data can be manipulated in myriad ways.

It is the "Business Tier" that manipulates the data. It knows all the
business rules, what the internal dependencies are, what sorts of
computations and calculations to make, etc. It doesn't have to know anything
about where the data comes from. After all, you might change that at some
point. It gets the data from the Data Tier. It employs the Data Tier to do
all the storage requirements. In addition, it only has a programming
interface, no user interface. This is because quite often the functionality
provided by the Business Tier may be exposed via a large variety of
interfaces, and any of these may change at any time. It may be exposed in a
desktop application, a web application, a web service, etc. Therefore, the
Business Tier only manages the "business" of the application.

The "Presentation Tier" is the top-level tier. It knows nothing about where
the data comes from. It does not know any of the business rules. It merely
serves as an interface between the Business Tier and the user, or the
client. It knows all the rules about how to present the data, take input,
give output, etc. All it knows about the Business Tier is the programming
interface it interacts with.

All of these together, combined with application of the basic principles
involved, makes for software that can be changed, updated, and maintained
much more easily.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Expect the unaccepted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top