FAQs about EJB (1)

Source: Internet
Author: User

I. What is the difference between EJB and J2EE?

A: Both J2EE and EJB are server specifications. However, EJB is actually a subset of J2EE. In other words, the J2EE server must contain an EJB container. Each J2EE server must contain an EJB container. In addition, a Web container that can run Servlet and JSP is required. In an image, EJB is for J2EE, for Mickey Mouse to Disney.

2. Can I use EJB components from an application server compatible with EJB?

A: No. EJB components cannot "survive" outside the EJB container ". There is no primary method for the EJB component. Even if you intentionally add such a primary method to your bean class, this bean is of little use in itself, most methods in enterprise beans are called by the container itself. If they are out of the server, these methods have no meaning. Remember, the most important thing about an EJB server is that it can provide you with all the important services (transactions, security, etc.). Without a server, you will have nothing except your basic logic. Moreover, if your business logic depends on containers, even if it is only your business logic, it will also fail if there is no server.

3. What is the difference between the conventional JavaBean and Enterprise JavaBean?

A: The word "JavaBean" indicates reusable components. Conventional non-Enterprise JavaBean is a reusable component that follows a naming convention. These general JavaBean can be used by development tools. Enterprise JavaBean is a reusable component, but its similarities with conventional JavaBean are limited to this. The "Bean" in the conventional JavaBean mainly refers to reusable during development, which simplifies or speeds up the association between the event of creating a bean and the method of another bean, or you can set the property value more conveniently. The conventional JavaBean runs in JVM, just like all normal Java classes. In contrast, "Bean" in enterprise beans means that it can be reused at runtime, and enterprise beans must run under the control of EJB containers.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.