EJB Server applications are composed of clients and an EJB Server that hosts components. The clients can run on different machines; the components execute on the host server machine as part of the EJB Server process. Components, in turn, connect to databases on the host server machine.
Building EJB Server applications is different from building standard client/server applications in that the parts of the application communicate with each other in a variation of traditional three-tiered architecture.
In traditional three-tiered architecture, the client resides on the first tier, the application server and components reside on the second tier, and remote databases reside on the third tier. In the EJB Server three-tiered architecture, see Figure 4-1, the databases reside on the same host as the EJB Server. They communicate using a Sybase high-speed JDBC driver through shared memory.
Executing methods on a component from the client or another component, retrieving data from databases, and other communications are managed by the EJB Server. EJB Server handles the details of transactions, threads, security, database connections, and network communication so that you can concentrate on writing the business logic and user interface for the components and clients.
Figure 4-1: EJB Server architecture
As in client/server applications, the client contains the user interface. Unlike client/server applications, however, business logic (such as stored procedures) is separate from both the clients and the database. Instead, business logic resides in the second tier as components that analyze data, perform computations, or retrieve information from data sources and process it. You design an EJB Server application by coding these tasks into an interface and into method prototypes.
A primary benefit of this model is that you can include pre-built components in the EJB Server application. If these components have been built outside EJB Server, you can import them using the Adaptive Server plug-in. Importing components adds their interfaces and method prototypes to EJB Server. The client and components are built from the same interface and method prototypes. You can build the client and components concurrently, as long as the client and component development teams notify each other if either of them changes the interface or method prototypes.