Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DDD aggregates vs GoF's facade

Other than implementation details, are DDD aggregates similar to GoF's facade ?

like image 628
Jacques René Mesrine Avatar asked Apr 13 '09 08:04

Jacques René Mesrine


1 Answers

A GoF Façade, much like a real façade, hides the underlying implementation complexity by creating another abstraction; it hides a complex and generally separate system (or subsystem) behind a simple to use interface. For example, façade for a game might have the methods start, update and pause; completely hiding the implementation of the game, but providing a high-level way to interact with it.

The DDD aggregate on the other hand is a way of specifying a "has-a" relation between objects that have a stronger correlation than normal references. They can be seen as nodes in a tree of domain objects and they are generally treated as a single unit in terms of data exchange.

like image 75
Jasper Bekkers Avatar answered Sep 29 '22 01:09

Jasper Bekkers