• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
From J2EE To Java EE (Jug Praga. Nov. 2006)
 

From J2EE To Java EE (Jug Praga. Nov. 2006)

on

  • 10,408 views

new features of JavaEE 5, how to migrate from J2EE 1.4 to Java EE 5

new features of JavaEE 5, how to migrate from J2EE 1.4 to Java EE 5

Statistics

Views

Total Views
10,408
Views on SlideShare
10,180
Embed Views
228

Actions

Likes
14
Downloads
754
Comments
0

12 Embeds 228

http://apconcursos.blogspot.com 159
http://innovationstartups.wordpress.com 21
http://www.slideshare.net 16
file:// 9
http://www.jugmilano.it 6
http://localhost:8080 5
http://www.linkedin.com 5
http://www.techgig.com 2
https://www.linkedin.com 2
http://static.slideshare.net 1
http://www.ninjaproxy.com 1
http://webcache.googleusercontent.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    From J2EE To Java EE (Jug Praga. Nov. 2006) From J2EE To Java EE (Jug Praga. Nov. 2006) Presentation Transcript

    • From J2EE to Java EE Filippo Diotalevi http://www.diotalevi.com filippo.diotalevi@jugmilano.it Novermber 23rd, 2006
    • Summary “... from J2ee to S+H, and back to Java EE..” 2001 2002 2003 2004 2005 2006 2007 ....... Java EE reference architecture? From J2EE to Java EE Tour – Jug Prague
    • Core J2ee Patterns - 2001-2003 The 'reference architecture' for J2EE applications Collection of patterns for the development of enterprise applications From J2EE to Java EE Tour – Jug Prague
    • Did you say... Patterns? From J2EE to Java EE Tour – Jug Prague
    • Did you say... patterns? From J2EE to Java EE Tour – Jug Prague
    • Core J2ee Patterns – Web Tier Client Intercepting Filters Front uses uses View Action Controller Controller Controller creates uses uses Context Object Taken from “Pattern per lo sviluppo di applicazioni J2ee”, Filippo Diotalevi, Webbit 2004 From J2EE to Java EE Tour – Jug Prague
    • Core J2ee Patterns – Business & Int. Tier Action Delegate Controller BO Service BO Service Facade DAO Context Object Locator BO DAO Facade BO DAO Service Delegate Action Dati ontroller Taken from “Pattern per lo sviluppo di applicazioni J2ee”, Filippo Diotalevi, Webbit 2004 From J2EE to Java EE Tour – Jug Prague
    • Core J2ee Patterns – Technology mappings Service delegates POJO Session Facades Session Stateless Bean Services Session Stateless Bean Persistence Entity Beans Service Locators JNDI From J2EE to Java EE Tour – Jug Prague
    • Core J2ee Patterns – Why? • Business Delegate: reduce coupling between presentation-tier and business services • Session Facade: encapsulate the complexity of interactions between the business objects participating in a workflow. The S.F. provides a uniform coarse-grained service access layer to clients • ServiceLocator: abstract all JNDI usage and to hide the complexities of initial context creation, EJB home object lookup, and EJB object re-creation From J2EE to Java EE Tour – Jug Prague
    • Core J2ee Patterns – Pros & Cons From J2EE to Java EE Tour – Jug Prague
    • Core J2ee Patterns – Pros & Cons Pros: • Standard based • Decoupled architecture • Easy to split work between team members • Highly documented From J2EE to Java EE Tour – Jug Prague
    • Core J2ee Patterns – Pros & Cons From J2EE to Java EE Tour – Jug Prague
    • Core J2ee Patterns – Pros & Cons Cons: • Complex • Verbouse • Can be inefficient • Complex • Did I say,, complex? From J2EE to Java EE Tour – Jug Prague
    • 2004-2006: “J2EE development without EJB”?!?! From J2EE to Java EE Tour – Jug Prague
    • 2004-2006: “J2EE development without EJB”?!?! From J2EE to Java EE Tour – Jug Prague
    • 2004-2006: The “Spring+Hibernate revolution” Powerful JavaBeans-based configuration management, applying Inversion-of- Control (IoC) principles From J2EE to Java EE Tour – Jug Prague
    • 2004-2006: The “Spring+Hibernate revolution” .. an object-relational mapping (ORM) solution for the Java language... From J2EE to Java EE Tour – Jug Prague
    • 2004-2006: The “Spring+Hibernate revolution” Mix together From J2EE to Java EE Tour – Jug Prague
    • 2004-2006: The “Spring+Hibernate revolution” 1/3 – Your favourite web framework 1/3 – Spring Framework 1/3 – Hibernate Simple, efficient and flexible architecture From J2EE to Java EE Tour – Jug Prague
    • Spring+Hibernate based architectures Your favourite Service Layer Integration Layer Web Framework here (es. Struts) Dependency injection Dependency injection Action Service DAO Dependency injection Dependency injection Action Service DAO From J2EE to Java EE Tour – Jug Prague
    • Pojo in action public class PersonHibernateDAO extends HibernateDaoSupport implements PersonDAO { public List listDocuments() { return this.getHibernateTemplate() .find(quot;from com.myapp.domain.Document order by codequot;); } public void deletePerson(Person person) { this.getHibernateTemplate().delete(person); } .... } public class TaxServiceImpl implements TaxService { private PersonDAO personDAO; public PersonDAO getPersonDAO() { return personDAO; } public void setPersonDAO(PersonDAO personDAO) { this.personDAO = personDAO; } public List findStudents(TaxStudentQueryParams params) { ...... From J2EE to Java EE Tour – Jug Prague
    • Dependy injection in action <bean id=quot;personDAOquot; class=quot;com.pnetx.pulse.dao.hibernate.PersonHibernateDAOquot;> <property name=quot;sessionFactoryquot;> <ref bean=quot;sessionFactoryquot;/> </property> </bean> <bean id=quot;taxServiceTargetquot; class=quot;com.pnetx.pulse.spring.services.TaxServiceImplquot;> <property name=quot;taxDAOquot;> <ref bean=quot;taxDAOquot;/> </property> <property name=quot;personDAOquot;> <ref bean=quot;personDAOquot;/> </property> <property name=quot;academicSemesterDAOquot;> <ref bean=quot;academicSemesterDAOquot;/> </property> <property name=quot;userManagerquot;> <ref bean=quot;userManagerquot;/> </property> </bean> From J2EE to Java EE Tour – Jug Prague
    • S+H Architecture – Pros & Cons From J2EE to Java EE Tour – Jug Prague
    • S+H Architecture – Pros & Cons Pros: • Really decoupled architecture • Lightweight (less patterns, less infrastructure) • Really powerful • Simple (see projects Appfuse or Equinox) From J2EE to Java EE Tour – Jug Prague
    • S+H Architecture – Pros & Cons From J2EE to Java EE Tour – Jug Prague
    • S+H Architecture – Pros & Cons Cons: • Non-standard • Less documented From J2EE to Java EE Tour – Jug Prague
    • Java EE 5 Crash Course From J2EE to Java EE Tour – Jug Prague
    • JavaEE5 Crash Course – 0' 00'' Java EE 5 released on May 2006 Mantra: “EOD – Easy of Development” From J2EE to Java EE Tour – Jug Prague
    • JavaEE5 Crash Course – 0' 29'' POJO From J2EE to Java EE Tour – Jug Prague
    • JavaEE5 Crash Course – 1' 12'' Annotations From J2EE to Java EE Tour – Jug Prague
    • JavaEE5 Crash Course – 2' 07'' Resource injection From J2EE to Java EE Tour – Jug Prague
    • JavaEE5 Crash Course – 2' 59'' EJB 3: • POJO Implementation • POJI Business Interface • Annotations • “Configuration by exception” • Java Persistence API • No more Home interfaces! From J2EE to Java EE Tour – Jug Prague
    • JavaEE5 Crash Course – 4'59'' EJB 3: @Stateless @Stateful @Entity @MessageDriven From J2EE to Java EE Tour – Jug Prague
    • JavaEE5 Crash Course – 5'34'' Java Persistence API: • EntityManager API • EJB QL • Query API From J2EE to Java EE Tour – Jug Prague
    • JavaEE5 Crash Course – 6'31'' • Java Persistence API (JSR-220) • EJB 3.0 (JSR-220) • JavaServer Faces 1.2 (JSR-252) • JSP 2.1 (JSR-245) • JAX-WS 2.0 (JSR-224) • JAXB 2.0(JSR-222) • Common Annotations (JSR-250) • StAX (JSR-173) From J2EE to Java EE Tour – Jug Prague
    • Java EE 5 Architecture • Inspired by S+H Architecture • Uses EJB 3.0 and dependency injection • All standard based From J2EE to Java EE Tour – Jug Prague
    • A reference architecture for Java EE 5 Dependency injection Service Delegate BO Data Access Object Put your DBA Service Delegate favourite web Data Access BO Object framework here Delegate Service Stateless NE W! Session Bean Stateless Entity JPA Session Bean From J2EE to Java EE Tour – Jug Prague
    • Services @Stateless public class PageManagerImplementation implements PageManager { @EJB public PageDao dao; public void save(Page pagina) { pagina.setLastModified(new Date()); dao.save(pagina); @Local } public interface PageManager //.. { } public void save(Page pagina); //.. } From J2EE to Java EE Tour – Jug Prague
    • Entities @Entity public class Page implements Serializable{ private String title, content; private Date lastModified; @Id public String getTitle() { return title; } @Temporal(TemporalType.DATE) public Date getLastModified() { return lastModified; } public String getContent() { return content; } //... setters and other methods follow... } From J2EE to Java EE Tour – Jug Prague
    • DAOs @Stateless public class PageDaoImplementation implements PageDao { @PersistenceContext EntityManager entityManager; public void save(Page pagina) { entityManager.merge(pagina); } //... public interface PaginaDao { } public void salva(Pagina pagina); //... } From J2EE to Java EE Tour – Jug Prague
    • Delegates? Java EE 5 dependency injection is less powerful and flexible than Spring d.i. Dependency injection can only be used by managed classes Use Spring to manage EJB services and inject them in the front end Ref. http://forum.springframework.org/archive/index.php/t-19669.html From J2EE to Java EE Tour – Jug Prague
    • @Questions? Thank you! From J2EE to Java EE Tour – Jug Prague
    • References • JSR 220: Enterprise JavaBeansTM 3.0 http://www.jcp.org/en/jsr/detail?id=220 • Glassfish website and documentation https://glassfish.dev.java.net • JBoss website and documentation http://www.jboss.org • Gavin King's “Entity Beans in EJB 3” http://hibernate.org/gavin/ebejb3.pdf • Kenneth Saks “Enterprise Java Bean 3.0” http://www.javasig.com/Archive/lectures/JavaSIG-EJB30.pdf • Filippo Diotalevi's “Java EE 5 – Step by Step” http://www.diotalevi.com/weblog/?page_id=125 From J2EE to Java EE Tour – Jug Prague
    • Filippo Diotalevi http://www.diotalevi.com filippo.diotalevi@jugmilano.it From J2EE to Java EE Tour – Jug Prague