Skip to content

Instantly share code, notes, and snippets.

@laugri
Created December 2, 2018 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laugri/e6b994739bbc6c2074540ff3af7f0782 to your computer and use it in GitHub Desktop.
Save laugri/e6b994739bbc6c2074540ff3af7f0782 to your computer and use it in GitHub Desktop.
DDD Example - Aggregate.js
// Our ShoppingCart example of an Entity is actually also an aggregate.
class ShoppingCart {
id: ShoppingCartId;
items: Array<ShoppingCartItem>
addItem(item: ShoppingCartItem) {
// implementation
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment