|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Lesson 7
Objective
|
JDBC architectural models
Explain JDBC as it functions in two and n-tier system designs.
A two-tier database model is a graphical way of representing the relationship between an application and a database.
Client/server configuration
A traditional two-tier database model applies to a scenario where an application communicates directly with a database. The application is one tier, and the DBMS is the second. The main function of JDBC in a two-tier database model is to connect the application directly to the database. This two-tier model is commonly called a client/server configuration.
The JDBC driver delivers the user commands to the data source, and returns the results from the datasource to the user, as you see in the graphic below.
In the Java-related two-tier model, the piece added to the client is a JDBC driver.
This provides the request/response communication between the two tiers.
The benefit of the two-tier model is its simplicity. In situations where more flexibility is required developers turn to an n-tier model.
In its simplest form, an n-tier design has three tiers. Those three elements are:
The server is positioned in the middle of the model. Client applications communicate with the server via some type of middleware such as Java RMI or CORBA. The server communicates with the database using a database protocol such as JDBC--the same way the client communicated with the database in the two-tier model. This approach is flexible enough to allow for multiple servers and databases, hence the "n" reference as a way to represent an arbitrary number of those entities. The following MouseOver illustrates the functions of an n-tier model.
n-tier architectural model
Elements of n-tier architecture
The main function of JDBC in an n-tier database model is to allow the developer to split request/response processing into two portions of code. Part of the code processes on the client side, which is mostly data presentations. The other part processes on the server side, which consists of mostly business rules and database access modules. The elements of the n-tier architecture include presentation services (or the presentation layer),
process services (or the middle layer), and
business services (or the business layer). These services perform different functions, as explained in the following table.
The middleware ties all the tiers together. Any client/server architecture, whether two-tiered or n-tiered, requires middleware to provide the
communications link among the layers. Middleware is normally provided as generic toolsets that can be configured to support your particular set
of services.
Examples of these are
Physically, these three tiers can be implemented in a wide variety of ways, which is where multi-tier comes in. As illustrated in the following graphic, any of the services can be set up as multiple layers, with one service calling other services to perform specialist tasks. The following table describes the characteristics of an n-tier approach.
In the next lesson, you will begin to apply guidelines for defining the use of JDBC in a business solution. JDBC Architecture - Quiz
Click the Quiz link below to test your knowledge of JDBC architecture and models.
JDBC Architecture - Quiz |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
