[ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ]

Three or More Layers

Now lets look at a more complex design, the three layered model.

In this three-layered design we have introduced a layer titled Business Logic.  This layer is responsible for enforcing the business rules on the data.  The raw data is stored in the data storage layer.  The presentation layer is responsible for displaying the data to the user and for accepting input from the user.  The new business logic layer is responsible for formatting the data into information based on the business rules and for enforcing constraints on the user’s input based on the same business rules

Other Layers

This layered design can be carried further into 4, 5, and 6 to n layers.  Below is an example of a 4-layered design

It is this 4-layered design that we will be implementing later in this seminar.

Advantages

The advantages of the multiple-layered design are found in the maintenance and evolution stage of the application’s lifetime.  As technologies and functionality requirements change over time it is easier to adapt the multi-layered application than it is a single layered design.

The level of componentization achieved will directly influence the amount of effort needed to adapt the application the new re

quirements.  Consider the figure below;

Disadvantages

Since the design is more complex than the single or two layer design, the implementation will also be more complex.  When compared to pure VFP single layered design data access performance may be affected.  Because of the nature of the data access mechanisms the presentation layer’s user interface design may be affected.

Although these are listed as disadvantages, they can be more accurately described as effects of the multiple layered architecture.  This is because they may or may not have a negative impact, in fact, their impact may be positive.

Our Multi-Layered Design

The following diagram shows the multi-layered design that we will build in this seminar.  This design uses 4 layers divided into Presentation, Business Logic, Data Access, and Data Storage.

The concentric circles are used to demonstrate that the layers only communicate with the adjacent layer and never skip a layer.  That is the presentation layer only communicates with the business logic layer and the business logic layer only ever communicates with the data access layer.

Special problems to a distributed application

Our exercise in this seminar is to create an application architecture design that can be used to build applications that meet certain requirements.  The requirements are as follows:

  1. The applications are data centric in nature.
  2. The applications will be primarily used for the in house activities of our clients.
  3. The data in these applications must be available to other applications.
  4. The business rules developed during our project must be enforced regardless as to what application is accessing our data.
  5. Current applications being developed are our VFP applications only.
  6. Future applications that need to be anticipated are web based applications as well as other desktops applications that may or may not be developed using VFP.
  7. The data storage must be capable of scaling as the amount of data, applications, and users accessing it increases.
  8. It must be possible to have data stored in multiple databases simultaneously as some of our data requirements may be already established in existing applications.

In reviewing these requirements we can see that our architecture must be very flexible indeed.  While we can depend on the features of VFP for our current work, we cannot afford to force the architecture to require VFP for its implementation.  In other words, whatever architecture we design must be capable of being written in many different development languages.

In addition to the above issue we have to deal with the special needs of a web based data application in our architecture.  The web has some special issues related to it that simple LAN based applications don’t need to address.  One of the most important issues has to do with the simple fact that in a web situation the client machine is not constantly in contact with the server machine.  This means there is a “disconnected” environment in effect.

Also in the web situation our business rules code cannot hold any “state”.  This means that from one call to another the business objects cannot assume anything about the context in which they operating, they cannot assume records pointer positions, data values, or anything else.  Why, because they may be receiving calls from different clients sequentially.  Study the following two diagrams for a moment.

In the LAN configuration the clients are always connected to the server, and there are known number of clients.  In the Internet configuration the clients are not always connected, a client will connect, make a request, get a response and then disconnect from the server.  The types of connections can vary widely on the Internet.  Then number of clients is never really known by the server and can vary widely in a very short period of time.

[ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ]