Chapter 2: Developing an EAServer Application
An EAServer 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.
EAServer can host, manage, and execute components such as ActiveX programmable objects, JavaBeans, or CORBA-compliant components. In EAServer, a component is simply an application object that consists of one or more methods. EAServer 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 EAServer.
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.
EAServer supports the following types of components:
A stub is a Java class or a C++ stub generated by EAServer Manager and acts as a proxy object for an EAServer component. A stub is compiled and linked with your Java applets or client application. A stub communicates with EAServer to instantiate and invoke a method on a component in the middle tier. Stubs make a remote EAServer component appear local to the client.
A skeleton acts as the interface between the EAServer 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 EAServer to locate and invoke an appropriate method.
EAServer transparently maintains a session between a client application and EAServer. 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.
A Web application is a collection of static HTML pages, Java servlets, and JavaServer Pages. You can develop Web applications to provide a browser-based user interface as an alternative to standalone clients or Java applet clients.
You can develop and distribute an EAServer application across the network. EAServer 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
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, standalone application, or Web application manages presentation and interaction with an end user. Middle-tier components, which run in EAServer, 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, EAServer 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 EAServer. 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.
Web applications can call EAServer components using the same proxies as used by standalone Java clients and applet clients.
|Copyright © 2005. Sybase Inc. All rights reserved.|