Enterprise Java PatternsEnterprise Java PatternsEnterprise Java Patterns Post a pattern Post a pattern Post a pattern More patterns More patterns More patterns Active Threads Active Threads Active Threads

Replace Indexing With Iteration

Posted by: Santiago Valdarrama on May 24, 2005 8 comments last post: April 24, 2006 updated
You are iterating over a collection or array in a ugly old manner.

Solution: Replace the iteration code with a for-each loop

Persistence Model – Using Abstract Connection factory Pattern

Posted by: r k on April 28, 2005 5 comments last post: January 11, 2006 updated
We have a Problem of Data Access to Multiple Data Sources (Siebel,Active Directory , Oracle ) simlatenously.

IConnection Interface, which will encapsulate the methods for Data Operation, Add, Update, delete, execute and get. Different type of connection can have the concrete implementation differently

Sponsored Links



Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts


Persistent Domain Objects Pattern.

Posted by: Irakli Nadareishvili on April 19, 2005 13 comments last post: July 15, 2005 updated
Persistent Domain Objects Pattern gives a solution to the, often-observed, tight-coupling of the persistence and application logic code. PDO decouples those by extracting the details of the persistence implementation and hiding it behind an interface, employing Dependency Injection techniques. The resulting code is cleaner, easier to test, more extensible.

Refactoring: Introduce Adapter

Posted by: Archimedes Trajano on March 05, 2005 7 comments last post: March 03, 2006 updated
This refactoring introduces an adapter to the code to move data extraction logic to the adapter.

ViewState Pattern

Posted by: Ryan Chok on February 27, 2005 12 comments last post: September 02, 2005 updated
This pattern implements the idea of viewstate used in ASP.NET application. It addresses the problem of storing the viewing state at the presentation layer especially when dynamic complex user interaction is required.

Synchronizing Data Access Object

Posted by: Ricardo Gladwell on February 10, 2005 9 comments last post: January 09, 2006 updated
Problem: synchronizing CRUD operations over mutiple data sources (i.e. multiple databases)

Solution: The Synchronizing Data Access Object (SDAO) design pattern adds a second layer of abstraction. Extending the traditional Data Access Object design pattern, the SDAO acts on multiple Data Sources, rather than one specific DataSource.

Cross Domain Cookie Provider

Posted by: Matt Pouttu-Clarke on January 19, 2005 12 comments last post: September 14, 2005 updated
This web pattern defines a cross domain cookie provider to get around the two dot rule for cookie domains. The pattern is implemented using pure HTTP and is totally transparent to all upstream and downstream participants. Useful for implementing single sign on, browser tagging, or sessioning. Cross domain cookies cannot contain volatile data.

Avoiding anemic domain models with Hibernate

Posted by: Bill Schneider on January 09, 2005 5 comments last post: August 08, 2005 updated
Unlike EJB CMP, Hibernate allows you to persist private fields and proprerties in objects. This allows you to encapsulate some domain (business) logic in your persistent objects, avoiding the anemic domain model" antipattern.

"Profile-based" MVC applications

Posted by: Remi Vankeisbelck on December 21, 2004 11 comments last post: May 03, 2005 updated
This pattern (it's more of a framework, based on a simple concept) adresses multi-profile (users, roles, groups, etc) access to applications. It allows to define "actions" that will be executed at run-time for some "objects" in the application and for some "profiles".
This allows for example to have custom web pages upon who's browsing them with a clear design.

EJBServices class - encapsulating EJBHomes jndi names & classes

Posted by: Alon Agmon on November 21, 2004 5 comments last post: August 09, 2005 updated
a combination of known patterns (Service Locator, business delegate and EJB home factory) with a little extra,
the EJBServices class encapsulates ejb's Jndi Names and Home Clases

Generic Timer using EJB Command pattern

Posted by: Dejan Krsmanovic on November 20, 2004 0 comments last post: November 20, 2004 updated
This pattern combines EJB Command pattern with EJB 2.1 Timer service. With it you can execute arbitrary scheduled tasks with just one Session bean.

Generic Query Object (GQO) Best Practice

Posted by: Reza Asadollahi on October 08, 2004 26 comments last post: December 17, 2004 updated
Forget DAO classes since now. Use GQO best practice to avoid unnecessary development of DAO classes and also gain more.

More patterns
J2EE PatternsJ2EE PatternsJ2EE Patterns
Patterns

We are proud to provide this patterns/strategies repository to the community. Feel free to post any useful design tips you know!

EJB Design Patterns PDFEJB Design Patterns PDFEJB Design Patterns PDF

EJB Design Patterns is now available for free download in PDF format. The book contains a catalog of twenty advanced EJB patterns and provides strategies for mapping application requirements to patterns-driven design, J2EE development best practices, and more. EJB Design Patterns was the #2 book at Java One 2002, and held the #1 Java book position on Amazon.com for weeks since the book was released in March. Download your PDF here.
Useful patterns around the webUseful patterns around the webUseful patterns around the web
Patterns

EntityBeansAsDomainObjects

This essential pattern describes how to model your entity beans.

The Aggregate Entity pattern

How to make an entity bean a facade to a set of dependent objects.

EJB Unit Testing Strategies

Every guru should use unit testing.

Other Patterns sitesOther Patterns sitesOther Patterns sites

Portland Patterns Repository

The original reference site for patterns. Frequented by the gang of 4 and their mentors (Kent Beck, Ward Cunningham).

Sun Java Center Patterns

A catalogue of J2EE design patterns from Suns Consulting Division.

IBM Patterns for e-Business

A catalogue of high level business, architectural and topological patterns for large scale systems.

J2EE Blueprints Patterns

Design Patterns from the J2EE Blueprints, Suns authoritative guide to J2EE development.


News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Articles | Media kit | About
All Content Copyright ©2005 TheServerSide Privacy Policy