
Chapter 1 Introduction to Jaguar CTS
Terminology and concepts
This section explains some of the basic concepts and terminology
associated with developing component-based Jaguar applications in
a three-tier environment. It is intended primarily to provide you
with enough information to complete the tutorials and begin using
Jaguar Manager. For detailed information on Jaguar application development,
see the Jaguar CTS Programmer's Guide.
Terminology
A Jaguar application consists of one or more packages and
a client application or applet. Packages consist of components,
and components are made up of one or more methods.
- Jaguar can host,
manage, and execute components such as ActiveX programmable objects,
JavaBeans, or CORBA-compliant components. In the Jaguar environment,
a component
is simply an application
object
that consists of one or more methods. Jaguar components
typically execute business logic, access data sources, and return
results to the client. Clients (applets) create an instance of a
component and execute methods associated with that component. Components
run only within a Jaguar server.
- A package
is
a collection of components that work together to provide a service
or some aspect of your application's business logic. A
package defines a boundary of trust
within
which components can easily communicate. Each package acts as a
unit of distribution, grouping together application resources for
ease of deployment and management.
Jaguar
supports the following types of components:
- A stub
is
a Java class or a C++ stub generated by Jaguar
Manager and acts as a proxy object
for a Jaguar
component. A stub is compiled and linked with your Java applets
or client application. A stub communicates with Jaguar to instantiate
and invoke a method on a component in the middle tier. Stubs make
a remote Jaguar component appear local to the client.
- A skeleton
acts
as the interface between the Jaguar runtime environment and the
user code that implements the method. Skeletons are compiled and linked
with each of the components, and at runtime they enable Jaguar to locate
and invoke an appropriate method.
- Jaguar
transparently maintains a session
between a
client application and the Jaguar server. Unlike a typical HTTP
scenario, where a new connection is created for each request and
response, sessions allow a browser to maintain a connection with
the server across a multiple request-response cycle.
Concepts
You can develop and distribute a Jaguar application across
the network.
Jaguar
CTS implements a three-tier
or multitier
distributed
computing architecture. In this model, three distinct elements work
together to give users access to data:
- Client-side
applet or application
- Middle-tier components
- The back-end database
Java applets are downloaded to clients, which instantiate
components on the server. Client applications are installed on client
machines, from which they also instantiate components on the server.
An applet or application manages presentation and interaction
with an end user. Middle-tier components, which run in Jaguar CTS,
handle much of the application processing. Finally, the database
stores, manages, and processes data.
If the client is an applet, users find and launch applications
from traditional HTML pages. Instead of simply loading a static
page, Jaguar downloads an executable applet to the individual's
browser. If the client is an already-installed application, the
user launches the application from his or her machine. Clients communicate
directly with an application component running in the middle tier.
Server components access data from one or more databases, apply business
logic, and return results to the client applet for display.
When a proxy object
is created on the client applet, it instantiates a corresponding
component registered with the Jaguar server. On the server side, a
component is instantiated in response to a request from the proxy
object running in the client environment. A method on a component
is executed when it is invoked by a proxy object on the client applet.
Developing a Jaguar application
There are three basic steps involved in creating and deploying
a Jaguar application that employs a Java applet as a client. For
information on other types of Jaguar clients, see the Jaguar
CTS Programmer's Guide.
To create and deploy a Jaguar application:
-
Define packages, components, and methods.
The Jaguar Manager is Jaguar's GUI interface that allows
you to easily define the packages, components, and methods that
Jaguar clients use to run an application. Jaguar Manager generates:
- Client-side stub files - Stubs contain
interface information used by the client to invoke Jaguar component
methods.
- Server-side skeleton files - Skeletons
provide the interface information of each component method.
-
Once you have generated the stubs and skeletons,
write the Java classes that, once linked with the stub files, form
the basis of your downloadable applet.
Develop the server-side components that link with the skeletons
to form the business logic of your servlet. Jaguar supports many
of the integrated development environment (IDE) tools available
today.
-
Deploy the application. You can register components
on any Jaguar server. Because Jaguar CTS is also a Web server, you
can write an HTML page for your applet and install it on Jaguar.
Jaguar runtime environment
A typical Jaguar application has an applet or HTML page associated
with it. Once you build and deploy such an application, it runs
in the following fashion:
- Jaguar
receives an HTTP request and downloads the requested HTML page or
applet. Included with the applet are the Java stubs, which through a
proxy, instantiate components and invoke the methods on those components.
- The client establishes a session with Jaguar. The
session, unlike an HTTP connection, allows the client and Jaguar
to maintain a connection throughout the transaction.
- The client creates a component instance through
a client-side proxy. The proxy used depends on the type of component
being instantiated. Jaguar validates the user against the component's
access list. If the user is validated, the dispatcher checks the
location and status of the component and creates an instance.
- The client invokes the component's business
logic by executing its methods.
- The component may interact with remote databases.
If it does:
- The component obtains a connection
to the database using Jaguar's connection caching feature.
- Jaguar checks the component's transaction
property. If the component is marked as transactional, Jaguar ensures
that remote-database commands execute as part of a larger transaction.
- Jaguar returns the results from the database to
the client.
- The client indicates that it has completed the operation.
Jaguar destroys the component instance or returns it to a pool for
future client instantiations. The client disconnects from Jaguar.
Copyright © 2000 Sybase, Inc. All rights reserved.
|
|