Академический Документы
Профессиональный Документы
Культура Документы
0 and Spring
June 2008 presented by: Reza Ghaffaripour www.RezaGh.com
Topics?
WhatisEJB?
WhatisnewinEJB3.0?
Annotations
WhatisnewinEJB3.0?
Annotations
WhatisnewinEJB3.0?
Interceptors
Theruntimeservicesliketransactionandsecurityare applied to the bean objects at the method's invocationtime Theseservicesareoftenimplementedasthe interceptormethodsmanagedbythecontainer
Whatis(JavaPersistenceAPI)JPA?
JPA
@Entity @Table(name="BOOK_TABLE") publicclassBookimplementsSerializable{ privateStringbookId; privateStringtitle; publicBook(){} publicBook(StringbookId,Stringtitle,...){ } @Id publicStringgetBookId(){ } publicvoidsetBookId(Stringid){ this.bookId=id; } ... } returnthis.bookId; this.bookId=bookId; this.title=title;
@PersistenceContext EntityManager em; ... Book book = em.find(bookID); em.persist(book); em.remove(book); em.merge(book); ...
EJB3.0andSpringComparisonAspects Persistence Transaction StateManagement Messaging Remoting DependencyInjection Aspects XMLorAnnotation Standard
EJB3.0andSpring:Transaction
SpringsupportsJTA,JDBCandHibernatetransactions EJB3.0supportsJTAandcansupportothersifbasedonJTA
EJB3.0andSpring:StateManagement
EJB3.0andSpring:DependencyInjection
EJB3.0andSpring:XMLVersusAnnotation
EJB3.0andSpring:Standard
EJB3.0andSpringinthesameStack
Presentation Tier JSP Tags Spring Tags Controller Servlet Spring Controller Delegate\Facade EJB EJB Business Tier Spring POJO ** Integration Tier * *
*JPAorSpringwithHibernate/JDBC/... **SpringPOJOorEJB
TheEnd?
Questions?