An EJB 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.
EJB Server hosts, manages, and executes JavaBean components. In the EJB environment, a component is simply an application object that consists of one or more methods. JavaBeans 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 strictly within the EJB 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.
A stub is a Java class stub generated by the Adaptive Server plug-in for Sybase Central and acts as a proxy object for an EJB component. A stub is compiled and linked with your Java applets or client application. A stub communicates with EJB Server to instantiate and invoke a method on a component in the middle tier. Stubs make a remote EJB component appear local to the client.
A skeleton acts as the interface between the EJB 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 EJB Server to locate and invoke an appropriate method.
EJB Server transparently maintains a session between a client application and the EJB 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.