Skip to main content
Data Transfer Object

Also known as

  • Transfer Object
  • Value Object

Intent

The Data Transfer Object (DTO) pattern is used to transfer data between software application subsystems or layers, particularly in the context of network calls or database retrieval in Java applications. It reduces the number of method calls by aggregating the data in a single transfer.


iluwatarAbout 2 minStructuralClient-serverData transferLayered architectureOptimization
Double Buffer

Intent

The Double Buffer pattern aims to reduce the time necessary for rendering and displaying graphical or computational data by utilizing two buffers. One buffer is used for rendering the next frame or computing the next set of data, while the other is used to display the current frame or data set to the user.


iluwatarAbout 4 minBehavioralBufferingGame programmingOptimizationPerformance
Double-Checked Locking

Intent

The Double-Checked Locking pattern aims to reduce the overhead of acquiring a lock by first testing the locking criterion (the 'lock hint') without actually acquiring the lock. Only if the locking criterion check indicates that locking is necessary does the actual locking logic proceed.


iluwatarAbout 2 minConcurrencyOptimizationPerformance
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
Flyweight

Intent

The Flyweight pattern's primary intent is to reduce the number of objects created, decrease memory footprint and increase performance by sharing as much data as possible with similar objects.

Explanation

Real-world example

Alchemist's shop has shelves full of magic potions. Many of the potions are the same so there is no need to create a new object for each of them. Instead, one object instance can represent multiple shelf items so the memory footprint remains small.


iluwatarAbout 3 minStructuralGang of FourMemory managementObject compositionOptimizationPerformance