Chapter 23. EJB 2.0 Programming Restrictions

   

The Purpose of the Restrictions

The restrictions that are placed on business methods of enterprise beans are there according to the EJB specification, to ensure that the bean is portable across different EJB 2.0 containers. Now portability is very important; however, it's not the only reason to adhere to these restrictions. The EJB server and container are designed for autonomy. In other words, the EJB server is reliant on itself to manage the resources and security for the environment. The purpose of this independence is to remove the necessity of the bean providers from having to deal with issues such as thread management, security, and scalability. The bean provider can concentrate on building the business logic for the application and let the server and container manage everything else. By following the rules set forth in this chapter, you increase the odds that your enterprise beans will be able to be installed in other compliant containers without modifying the bean. The restrictions are not just for the bean provider. The container providers also must adhere to the restrictions if they want to claim compliancy.

Although the EJB 2.0 Specification states some very specific restrictions, some restrictions in the specification provide wiggle room for developers and container providers to interpret the restrictions one way or another. Many EJB developers have asked for clarification on certain restrictions because they can be confusing. Some EJB containers actually have measures in place to prevent these restrictions from being violated, and other vendors don't enforce the restrictions as strongly. The best thing for you to do is not to violate them if you can avoid it.

Because the restrictions can be interpreted in different ways, we must say up front that we will take a strictly literal approach to these where necessary and then try to apply a little bit of common sense. Probably not everyone will agree with the strict view taken in this chapter. This topic is one of those that people feel passionate about and will go to great lengths to argue one way or another. So take the discussion of each restriction with a grain of salt and know that not everyone will agree, but you should at least be aware that these restrictions do exist and to some degree, you will have to adhere to them.



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