Use ejb3.o to simplify original EJB development: Debu panda
We introduce EJB to construct distributed components. It was born to solve all the problems and complexity of CORBA. After several important version updates and many new features, EJB has become the core of J2EE. In the early days, many developers were addicted to using ejbs in their projects even without any significance. While they discovered that the project they were using had no qualitative changes, it became a trend to condemn EJB.
The development of ejbs has never been simpler or even more complicated in earlier EJB version specifications. EJB is compared to an elephant due to its complexity and heavyweight features. Developers feel that EJB is like an extra layer of sweet syrup on a donut. Today, when low carb and Atkins diet are widely used, the EJB expert committee has no choice but to publish EJB specifications that reflect low carb to simplify EJB development. At the javaone conference, ejb3.0 Expert Committee released an example map of the first lightweight model known as ejb3.0, which is a public specification.
At first glance, it seems very good to see the new EJB model. In this article, we will discuss how ejb3.0 uses a smaller and sophisticated assembly to attract developers. In the next article, we will discuss how ejb3.0 simplifies the persistence model.
Defects
Before we begin to discuss the new features brought about by ejb3.0, let's first analyze the complexity and complexity of the current EJB model.
- The current EJB model requires many component interfaces and many unnecessary rollback methods.
- The Component Interface needs to implement ejbobject or ejblocalobject and handle many unnecessary exceptions.
- The description of EJB deployment is complex and error-prone.
- The development and management of container persistence management based on the EJB model is too complicated. Many basic features are not taken into account. For example, the standard method for defining a primary key using database sequences and ejbql is very limited.
- EJB components are not object-oriented. For example, there are too many restrictions when using inheritance and polymorphism.
- One major drawback of EJB is that you cannot test an EJB model from the EJB container and cannot debug an EJB in the container. This is a terrible thing for developers.
If you use EJB, you need to be familiar with the complex process of calling and searching for EJB. Obviously, you only need to use EJB in the program, but you must know the detailed details of JNDI.