By: Priya in EJB Tutorials on 2007年10月07日 [フレーム]
EJB is a Java API specification that provides a component architecture for the development and deployment of distributed business objects, but many Java programmers use EJB only for its database access and Java object-persistence capabilities. If your application is highly transactional, requires high availability, and is likely to have many concurrent users, you might want to consider using EJB.
EJB is a standard part of the Java EE and is therefore supported by all Java EE compliant application servers. Application servers that support EJB do so by providing an EJB container that hosts EJB components, just as a servlet container hosts servlets and JSPs. And just as servlet containers may be clustered to provide load balancing and fault tolerance for servlets, EJB containers can be clustered to provide the same functionality for distributed business objects. An EJB container can support three types of components: entity beans, session beans, and message beans. We won't discuss session and message beans because they aren't persistent. We'll focus on entity beans, which can be persisted to a data store by using one of the following two mechanisms:
The benefits provided by using EJB for persistence are many; here are some of the most significant:
One disadvantage of EJB is complexity. The technology is complex, and the learning curve is steep. To learn EJB development, you need to learn the EJB philosophy, the EJB API, recommended EJB patterns, EJB development tools, and the EJB deployment descriptors. To learn EJB deployment, you need to learn how to use the administration and deployment tools provided by the various Java EE application servers that you intend to support, each of which can vary quite significantly.
Another disadvantage of EJB is development overhead. When EJBs were first introduced, you needed to create at least three (often four) files for a single EJB. Tools such as XDoclet made the process easier, but until recently there was a lot of complexity in developing even simple beans. EJB 3.0, part of the latest Java Platform, Enterprise Edition 5 specification, has made steps to make the writing process easier, but there are still many issues to understand and consider. There is also considerable runtime overhead associated with using entity beans as the container interposes a variety of services for your beans. EJB does a lot for you, but with increased complexity and significant development overhead. Make sure that you really need the benefits provided by EJB before you commit to using it in your application.
This policy contains information about your privacy. By posting, you are declaring that you understand this policy:
This policy is subject to change at any time and without notice.
These terms and conditions contain rules about posting comments. By submitting a comment, you are declaring that you agree with these rules:
Failure to comply with these rules may result in being banned from submitting further comments.
These terms and conditions are subject to change at any time and without notice.
Most Viewed Articles (in EJB )
Difference Between Stateful and Stateless Session Beans
Difference Between Session and Entity Beans
Required Classes/Interfaces That Must Be Provided for an Enterprise JavaBeans Component
Steps to develop EJB Environment
Latest Articles (in EJB)
© 2023 Java-samples.com
Tutorial Archive: Data Science React Native Android AJAX ASP.net C C++ C# Cocoa Cloud Computing EJB Errors Java Certification Interview iPhone Javascript JSF JSP Java Beans J2ME JDBC Linux Mac OS X MySQL Perl PHP Python Ruby SAP VB.net EJB Struts Trends WebServices XML Office 365 Hibernate
Latest Tutorials on: Data Science React Native Android AJAX ASP.net C Cocoa C++ C# EJB Errors Java Certification Interview iPhone Javascript JSF JSP Java Beans J2ME JDBC Linux Mac OS X MySQL Perl PHP Python Ruby SAP VB.net EJB Struts Cloud Computing WebServices XML Office 365 Hibernate