Previous Next Contents Index


Designing Applications

This section describes the relationships between files used in creating applications to run on the Netscape Application Server.

The following topics are described in this section:


Parts of an Application
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:

Application Layer
Objects Used
Data access layer
Query files, data models, and JDBC RowSet classes
Presentation layer
Java servlets for the presentation logic; JavaServer Pages and HTML files for the presentation layout.
Business layer
Enterprise Java Beans

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.


Assembling the Pieces
To create an application, you assemble files that execute the presentation logic, business logic, and data access logic that the application requires. Assembling files means either creating new files or locating existing files to add to a project, which is a container for your files during development. A project also lists the files you will deploy as an application, after development is completed. The process of creating projects with Netscape Application Builder is described in Creating and Managing Projects.

Types of Files in a Project
In developing an application, you assemble the following types of files:

File Description
File Suffix
HTML pages and templates
.html, .htm
JavaServer Pages
.jsp
JavaScript
.js
Image files
.gif, .jpg, .jpeg
Servlets, EJBs, and other Java code
.java, .ebx, .class
Query files
.gxq
Data models
.kdm
Connection files
.props
NTV files
.ntv

How Files Relate to Each Other
You use Netscape Application Builder to create a project that ties its files together. The files in a project are related as follows:

Although you can use Netscape Application Builder to manually define the relationships between files, one of the benefits of Netscape Application Builder is its automated code generation wizards. Wizards guide you in creating sets of related files to perform commonly needed actions.

For example, many applications require login functionality, which derives from the interaction of several files. Using the Login wizard, you can quickly create the needed files, with the links between them automatically defined. For more information on wizards, see Using Wizards to Generate Project Files.


Getting Started
The general process of creating a project is described in Creating and Managing Projects. However, before you launch Netscape Application Builder, the following conditions must be in place:

Understand the Netscape Application Server Environment
Because you will be deploying applications to the Netscape Application Server, it is important that you understand the role of these applications within a three-tiered environment. Before using Netscape Application Builder, it is recommended that you become familiar with the concepts presented in the Programmer's Guide.

Define the Application Environment
What type of application do you want to design? Possible variations include: Internet, intranet, and extranet.

Some examples are shown in the following table:

Application Type
Examples
Internet
E-Commerce, Financial, Security, Portal, Internet Service Provider (ISP).
Intranet
Human Resources self-service, Sales force automation, internal help desk
Extranet
Supply chain management, insurance quotes, car dealership management
Workgroup
Accounting reports, RFE management

Define the Application Requirements
Once you've defined the application type, the next step is to gather the requirements of that application. Requirements are often determined by answering questions about the application's purpose or functionality. For example:

The previous list is only a sample of questions to consider. For more information on gathering application requirements, see Identifying Application Requirements.

Define the User Interface
Defining the user interface determines the page flow, which affects how an end-user navigates through the application. You define page flow by deciding what files will call other files. The general principle of page flow is shown in the previous figure.

The following questions can guide your decisions about user interface design:

Netscape Application Builder provides several wizards that make it easy to create some of the more common page designs. In addition, NAB includes a "project map" feature to verify page flow. In HTML Flow view, the project map displays web page relationships the way the end user will experience them. In File Dependencies view, the project map displays the relationships of all files, not just those seen by the end user.

For additional information on application design, see Guidelines for Effective Development.

Set Up the Data Sources
A data source can be any of the following examples:

Most web applications access a data source in some way; for example, when they display query results or when they allow users to update account information.

In the case of a relational database, a database administrator or data architect sets up and manages access at your site. Similarly for non-relational data sources, it is assumed that these systems are available and that they provide access to clients.

If there is one or more data sources for you to work with, you will need to specify which data source(s) to access, and which connection protocols to use. These tasks are described in Creating Data Access Logic.

 

© Copyright 1999 Netscape Communications Corp.