Skip to main content
Composite Entity

Also known as

  • Coarse-Grained Entity

Intent

The Composite Entity design pattern is aimed at managing a set of interrelated persistent objects as if they were a single entity. It is commonly used in the context of Enterprise JavaBeans (EJB) and similar enterprise frameworks to represent graph-based data structures within business models, enabling clients to treat them as a single unit.


iluwatarAbout 2 minStructuralClient-serverData accessEnterprise patterns
Data Access Object

Also known as

  • Data Access Layer
  • DAO

Intent

The Data Access Object (DAO) design pattern aims to separate the application's business logic from the persistence layer, typically a database or any other storage mechanism. By using DAOs, the application can access and manipulate data without being dependent on the specific database implementation details.


iluwatarAbout 3 minStructuralData accessLayered architecturePersistence
Data Locality

Also known as

  • Cache-Friendly Design
  • Data-Oriented Design

Intent

The Data Locality design pattern aims to minimize data access times and improve cache utilization by arranging data in memory to take advantage of spatial locality. This pattern is particularly useful in high-performance computing and game development where access speed is crucial.


iluwatarAbout 3 minPerformance optimizationCachingData accessGame programmingMemory managementPerformance
Data Mapper

Also known as

  • Object-Relational Mapping (ORM)

Intent

The Data Mapper pattern aims to create an abstraction layer between the database and the business logic, allowing them to evolve independently. It maps data from the database objects to in-memory data structures and vice versa, minimizing direct dependencies between the application's core logic and the underlying database structure.


iluwatarAbout 3 minBehavioralData accessDecouplingObject mappingPersistence
Embedded Value

Also known as

  • Aggregate Mapping
  • Composer
  • Inline Value
  • Integrated Value

Intent

The Embedded Value design pattern aims to enhance performance and reduce memory overhead by storing frequently accessed immutable data directly within the object that uses it, rather than separately.


iluwatarAbout 2 minBehavioralData accessEnterprise patternsOptimizationPerformance
Identity Map

Intent

Ensures that each object gets loaded only once by keeping every loaded object in a map.
Looks up objects using the map when referring to them.

Explanation

Real world example

We are writing a program which the user may use to find the records of a given person in a database.


iluwatarAbout 3 minBehavioralPerformanceData access
Metadata Mapping

Intent

Holds details of object-relational mapping in the metadata.

Explanation

Real world example

Hibernate ORM Tool uses Metadata Mapping Pattern to specify the mapping between classes and tables either using XML or annotations in code.


iluwatarAbout 2 minArchitecturalData access
Optimistic Offline Lock

Intent

Provide an ability to avoid concurrent changes of one record in relational databases.

Explanation

Each transaction during object modifying checks equation of object's version before start of transaction
and before commit itself.

Real world example


iluwatarAbout 2 minConcurrencyData access
Private Class Data

Intent

Private Class Data design pattern seeks to reduce exposure of attributes by limiting their
visibility. It reduces the number of class attributes by encapsulating them in single Data object.

Explanation

Real world example

Imagine you are cooking a stew for your family for dinner. You want to prevent your family members
from consuming the stew by tasting it while you are cooking, otherwise there will be no more stew
for dinner later.


iluwatarAbout 2 minIdiomData access
Repository

Intent

Repository layer is added between the domain and data mapping layers to isolate domain objects from
details of the database access code and to minimize scattering and duplication of query code. The
Repository pattern is especially useful in systems where number of domain classes is large or heavy
querying is utilized.


iluwatarAbout 2 minArchitecturalData access