Monday, December 9, 2013

Difference Between EJB2 and EJB3

EJB2 vs EJB3 
EJB (Enterprise JavaBeans) is a Java API (Application Programming Interface) found within Java EE (Java Platform, Enterprise Edition) specification. EJB describes an architectural model for the development of enterprise applications. This is a managed server-side model that is able to capture the business logic of the enterprise application. IBM is EJB’s original creator who developed it in 1997. Sun Microsystems adopted it in 1999.
Before the introduction of EJB, it was found that solutions to problems found in back-end business code were frequently re-implemented by the programmers. As a result, EJB was introduced to address these common problems such as persistence, transactional integrity and security. EJB provides standard ways to handle these back end problems, by specifying how the application server should process transactions, integrate with JPA (Java Persistence API) services, handle concurrency control, handle JMS (Java Message Service) Events, resolve naming issues with JNDI (Java Naming and Directory Interface), develop secure programs with JCE (Java Cryptography Extension) and JAAS (Java Authentication and Authorization Service), deploy components, communicate remotely with RMI-IIOP (Java Remote Method Invocation interface over the Internet Inter-Orb Protocol), develop web services, invoke asynchronous methods and use the Timer service.
EJB2
EJB2 (EJB 2.0) was released on 22 August, 2001. It describes specification for developing distributed object-oriented applications in Java by combining tools developed by different vendors. One of the major goals of EJB2 was to allow programmers to develop enterprise applications more easily without having to understand low-level details, such as multi-threading and connection pooling. Another goal was to allow programmers to write a “Bean” once and run anywhere without recompilation (adhering to the “write once, run anywhere” slogan of the Java programming language). Furthermore, EJB2 intended to allow components developed by different vendors to easily interoperate, and allow vendors to write extensions for their products that can support EJBs.
EJB3
EJB3 (EJB 3.0) was released on 11 May, 2006. EJB3 made programmers life very easy by allowing them to use annotations in place of deployment descriptors that were used in previous versions. EJB3 contains a business interface and a specific entity bean that can implement that business interface, removing the need for using home/remote interfaces and the ejb-jar.xml file. Overall performance of EJB3 is much improved compared to EJB2, and there is a considerable increase in configurability, flexibility and portability in this release of EJB.
What is the difference between EJB2 and EJB3?
EJB3 has a noticeable improvement in configuration and performance over EJB2. One reason for this performance improvement is the use of the POJO (Plain Old Java Object) with metadata and XML Deployment Descriptors by EJB3 instead of JNDI lookups used in EJB2 for object references. Configuration of EJB3 is much simpler because the programmer does not need to implement Home/Remote interfaces and others (e.g. SessionBean), which removes the need to use container callback methods (such as ejbActivate and ejbStore).
Furthermore, EJB3 is better than EJB2 in the areas of flexibility and portability. For example, it is easy to convert EJB3 entities to DAO (Data Access Object) and vice versa because EJB3 entities are lightweight (as opposed to the heavyweight EJB2 entities, which implement above mentioned interfaces). Database queries written in EJB3 are very flexible because it uses a refined EJB-QL, in place of the older version of EJB-QL, which had several limitations. EJB3 removes all the portability issues of EJB2 (which uses entity beans for database access) by supporting more generalized JPA for all data transactions.
Unlike EJB2, which needs an EJB container to execute, EJB3 can be executed in an independent JVM (Java Virtual Machine) without having to use containers (this is possible because it does not implement standard interfaces). Unlike EJB2, EJB3 is easily pluggable with persistence providers offered by third parties. Another important difference between EJB3 and EJB2 is that EJB3 can use annotation based security, while EJB2 used deployment descriptors based security. This means that configuration and setup tasks are much easier in EJB3, and there is a considerable reduction in performance overheads compared to EJB2.

4 comments:

oakleyses said...

louis vuitton handbags, oakley sunglasses, louboutin, longchamp outlet, nike shoes, louis vuitton outlet stores, chanel handbags, burberry outlet, prada outlet, jordan shoes, tiffany and co, michael kors outlet, tory burch outlet, louis vuitton outlet, longchamp handbags, nike free, true religion jeans, michael kors outlet, kate spade outlet, polo ralph lauren outlet, tiffany and co, prada handbags, polo ralph lauren outlet, michael kors outlet, michael kors outlet, longchamp handbags, oakley sunglasses, ray ban sunglasses, kate spade handbags, burberry outlet, louis vuitton outlet, louboutin outlet, louboutin, coach factory outlet, air max, air max, coach outlet, gucci outlet, christian louboutin shoes, michael kors outlet, coach purses, ray ban sunglasses, michael kors outlet, louis vuitton, coach outlet store online, true religion jeans, oakley sunglasses cheap

oakleyses said...

ralph lauren, lululemon, air max, hollister, north face, nike air max, polo lacoste, vanessa bruno, timberland, vans pas cher, louboutin, louis vuitton, oakley pas cher, air max pas cher, nike roshe run, air max, true religion outlet, barbour, sac longchamp, air force, hollister, sac louis vuitton, nike free, polo ralph lauren, nike trainers, louis vuitton uk, nike roshe, sac hermes, longchamp, michael kors, sac burberry, sac guess, mulberry, new balance pas cher, converse pas cher, sac louis vuitton, hogan outlet, nike tn, north face, true religion outlet, ray ban pas cher, michael kors, air jordan, nike blazer, nike free pas cher, michael kors pas cher, abercrombie and fitch, ray ban sunglasses

oakleyses said...

mac cosmetics, mont blanc, marc jacobs, canada goose outlet, nike huarache, vans shoes, soccer jerseys, hollister, giuseppe zanotti, beats by dre, abercrombie and fitch, longchamp, insanity workout, celine handbags, bottega veneta, ghd, nfl jerseys, north face outlet, chi flat iron, ugg boots, birkin bag, ugg australia, canada goose, herve leger, ugg pas cher, rolex watches, valentino shoes, canada goose uk, canada goose, ferragamo shoes, canada goose, ugg boots, uggs outlet, north face jackets, soccer shoes, asics running shoes, new balance shoes, p90x, lululemon outlet, canada goose jackets, mcm handbags, instyler, babyliss pro, ugg, wedding dresses, jimmy choo outlet, reebok outlet, nike roshe run

oakleyses said...

parajumpers, karen millen, air max, converse, pandora charms, moncler, louboutin, moncler, links of london, lancel, juicy couture outlet, oakley, hollister, pandora charms, supra shoes, thomas sabo, canada goose, gucci, wedding dresses, timberland boots, swarovski crystal, air max, coach outlet store online, moncler, ray ban, canada goose, moncler, ugg, louis vuitton, swarovski, hollister, montre homme, moncler, hollister clothing store, ralph lauren, rolex watches, moncler outlet, moncler, iphone 6 cases, baseball bats, juicy couture outlet, toms shoes, vans, pandora jewelry, ugg, converse shoes