What Are Horizontal Services?

   

Horizontal Services Provided by EJB

If you have read the previous chapters of this book and have not jumped ahead, you might be asking, "Doesn't an EJB server provide these horizontal services?". After all, most of them support some kind of logging and e-mail support. And can't JNDI be used to store properties that a distributed application can use? The answer to these questions is yes, but not entirely in a portable fashion. Because the EJB specification doesn't describe in detail how EJB vendors should handle some of these services in a nonproprietary way, it's up to the vendor to design and implement these services.

Of course, you can use these vendor services for your EJB applications, but the problem with this approach is that it leaves you dependent on that particular vendor's EJB services. If you suddenly need to support one or more other EJB servers, you can't count on them to have the same set of APIs to log or send e-mail, for example.

Although eventually you are always going to be tied to a vendor in one way or another, the idea is to limit the places where your application is vendor-dependent . One way in which you can limit your exposure to vendor dependencies is to try to use only the services offered by an EJB vendor that are specified by the specification. You take more risks of nonportability by using proprietary APIs that are not covered in the specification. Even though in some cases, it's exactly what you might need, you are better off finding a way to accomplish the task through portable means. For example, to perform distributed logging, we could use JMS and message-driven beans, rather than relying on a logging API that will only work for a particular vendor. We know that JMS and message-driven beans must be present in an EJB 2.0 “compliant server. This is one way to help ensure portability.



Special Edition Using Enterprise JavaBeans 2.0
Special Edition Using Enterprise JavaBeans 2.0
ISBN: 0789725673
EAN: 2147483647
Year: 2000
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net