Download presentation
Presentation is loading. Please wait.
Published byDaniella George Modified over 9 years ago
1
J2EE Design Patterns Umer Farooq CS6704: Design Patterns & Component FrameworksApril 24, 2002
2
J2EE: Again? J2EE BluePrints team has catalogued design patterns Application in context of MVC Patterns: Data Access Object Fast-Lane Reader Front Controller Page-by-Page Iterator Session Façade Value Object …
3
Data Access Object Intent: Decouple business logic from data access logic and adapt the resource being accessed, so that the type of resource can change easily and independently. A.K.A. Data Access Component Business components rely on an underlying data source (such as a particular vendor database) and tie together business logic and data access logic Extensibility/Modification for a different data resource Limitations in reusability
4
Structure
5
OrderEJB.java public Integer ejbCreate (Collection lineItems, Address shipToAddr, Address billToAddr, String shipToFirstName, String shipToLastName, String billToFirstName, String billToLastName, CreditCard chargeCard, String carrier, String userId, double totalPrice, Locale locale) throws CreateException, OrderAppException { orderDetails = new MutableOrderModel ( -1, lineItems, shipToAddr, billToAddr, shipToFirstName, shipToLastName, billToFirstName, billToLastName, chargeCard, carrier, userId, Calendar.getInstance(), Order.PENDING, totalPrice, locale); //... OrderDAO dao = getDAO ( ); int id = dao.create(this.orderDetails); //... }
6
Fast-Lane Reader Intent: Accelerate read-only data access by not using enterprise beans. A.K.A. Bimodal Data Access Important to access a list of data efficiently In the interest of usability Access data from DAO, not EJB
7
Structure
8
The Tiered Approach
9
Patterns Roadmap Doing preprocessing or post-processing of your requests – DecoratingFilter Whether to implement your Controller as a servlet or JSP – FrontController Minimize coupling between business and resource tiers - ? Reduce number of entity beans and improve manageability – Aggregate Entity How to partition your View and Model – ViewHelper …
10
http://java.sun.com/blueprints/patterns/j2ee_patterns/catalo g.html http://java.sun.com/blueprints/patterns/j2ee_patterns/catalo g.html http://developer.java.sun.com/developer/technicalArticles/J 2EE/patterns/J2EEPatternsRelationships.html http://developer.java.sun.com/developer/technicalArticles/J 2EE/patterns/J2EEPatternsRelationships.html http://developer.java.sun.com/developer/restricted/patterns/ J2EEPatternsAtAGlance.html http://developer.java.sun.com/developer/restricted/patterns/ J2EEPatternsAtAGlance.html http://developer.java.sun.com/developer/technicalArticles/J 2EE/patterns/J2EEPatternsRoadmap.html http://developer.java.sun.com/developer/technicalArticles/J 2EE/patterns/J2EEPatternsRoadmap.html References
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.