Enterprise JavaBeans (EJBs) and XML

In a way, Enterprise JavaBeans are the big brother to JavaBeans. Enterprise JavaBeans are to server-side Java what JavaBeans are to client-side Java. However, EJBs and JavaBeans are not parents, children, or ancestors of one another. The EJB 1.0 specification describes many things about EJB, but does not require that each and every visible property have appropriate getPropertyName and setPropertyName methods, as a JavaBean must.

So what is an Enterprise JavaBean, or as they are more commonly referred to, an EJB? An EJB is a component just like a JavaBean. However, it's a distributed component, distributed in the sense that when you access an EJB you are accessing a remote instance of a class locally. However, that class is really living (running) on a server somewhere; you only have an instance of interface class that knows how to reference that remote object, but it's still not the remote object. As we shall see when we apply XML to EJBs, Enterprise JavaBeans are significantly more complex than JavaBeans and have significantly different uses. EJBs also have a lifecycle services interface used to create, delete, and otherwise manipulate the lifetime of an EJB. EJBs come in any of three separate and distinct flavors (Stateful, Stateless, and Entity), as opposed to JavaBeans'single flavor. Finally and most importantly EJBs are distributed objects!

As with JavaBeans, we won't get into an in-depth discussion of Enterprise JavaBeans, but we will look at the basics of EJBs and a special case—Bean-Managed Persistence (BMP) EJBs—and how we can develop base classes for BMP EJBs that can store and retrieve their state from XML.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.178.157