In the Netscape Application Server environment, an application can contain three types of programming layers. As the developer, you use or create objects to deliver each specific layer, as listed in the following table:
The relationships among the objects which represent the various application layers are shown in the following figure and are explained in the three sections that follow.
Data Access Layer
Data access logic determines what types of back-end data sources (if any) the application accesses, such as a relational database or a legacy system. In this guide, it is assumed that a data source already exists for use with your application, and that there is someone at your site, such as a database administrator, who manages it. Netscape Application Builder enables you to access your data sources via data models and data access query files.
To legacy systems, your code may need to call into an extension. Netscape Application Server includes prebuilt extensions. These extensions allow an application to communicate with transaction-processing systems such as CICS/IMS, IBM MQ Series, and BEA Tuxedo. Additional prebuilt extensions allow communication with ERP systems such as SAP R/3. If you need to create a custom extension, use Netscape Extension Builder.
Relational Data Sources
If the application accesses a relational database, you use queries to access the data. To use a query, create two types of files:
You cannot create a query without a data model. Every query file depends on a data model, but not necessarily the same data model.
A query can be loaded into a NASRowSet object. For more information regarding the NASRowSet class, see Creating Data Access Logic In addition, for information about how to use the NASRowSet object programmatically, see Working with Row Sets.
Nonrelational Data Sources
If the application is required to access a nonrelational data source, you must write Java code to communicate with the data source. In some cases, you can call into an extension that is prebuilt into Netscape Application Server. In other cases, you may want to build a custom extension using Netscape Extension Builder.
Presentation Layer
The presentation layer handles the presentation logic and layout of the application. The following sections introduce these concepts.
About Presentation Logic
Presentation logic controls and processes the data generated from application users by invoking Enterprise JavaBeans to perform business logic functions, and then generating a dynamic page that sets up the next user interaction. Presentation logic is processed by servlets on the Netscape Application Server. Servlets handle such tasks as page-to-page navigation, session management, simple input validation, and the tying together of business logic.
About Presentation Layout
Presentation layout determines how users experience the application. Typically they use a web browser and navigate from page to page (HTML pages or JavaServer Pages). For example, suppose a user is viewing the left web page in the previous figure. As a result of a user action, such as pressing a Submit button, the web browser displays the page on the right. The intervening processing remains transparent to the user.
Business Logic Layer
Business logic maintains the application-specific processing and business rules of an application. Using Netscape Application Builder, you implement your business logic via Enterprise JavaBeans (EJBs).
The application components designed for your business logic connect the components designed for the presentation layer (servlets, HTML pages, and JavaServer Pages) to the components designed to implement the data access layer (data models, queries, and JDBC RowSet calls).
Enterprise JavaBeans
In the Netscape application model, you design session and entity EJBs to implement the various types of business logic, such as transactions, security, and remote access. For more information, see Creating Business Logic.
|