Purpose of Access Layer
Purpose of Access Layer
An access layer is to create, a set of classes that know how to communicate with the
place where the data actually reside. The access layer’s main responsibility is to
provide a link between business or view objects and data storage. The view layer
corresponds to the client tire, the business layer to the application server tier, and the
access layer to the database tier of three tier architecture.
Major task of Access layer:
1. Translate the request: - The access layer must be able to translate any data related
requests from the business layer into the appropriate protocol for data access.
2. Translate the results: - The access layer also must be able to translate the data
retrieved back into the appropriate business objects and pass those objects back into
the business layer.
Benefits of Access Layer Class:
1. Access layer classes provide easy migration to merging distributed object
technology, such as CORBA and DCOM
2. These classes should be able to address needs of two tier client-server architectures
(as well as the difficult demands of fine grained purer to peer
distributed object architecture)
Processes of the access layer can define some steps –
Every business class that has been identified and created, create one access class in
the access layer package. Mirror the business class package.
The rule as applies among objects that are rolled among business classes also applies
among access classes.
In this process the access are assumed to store not only the attributes but also the
methods. Another approach is to let the methods be stored in a program and stored in
a program and stores only the persistent attributes.
àFor every business class identified, determine if the class has persistent data. An
attribute can be either transient or persistent.
àFor every business class identified, created one access class in the access layer
package.
4. Class relationships simplification
The goal here is to eliminate redundant or unnecessary classes or
structures. In most cases you can combine simple access classes and simplify
the
super and subclass structures.
Redundant classes – If you have more than one class that provides similar
services.
Method classes – Revisit the classes that consist of only one or two
methods to see it they can be eliminated or combined with existing classes.