Loading...
Loading...
Use when creation of an aggregate or complex value object requires non-trivial work — phrases like "factory", "the constructor is doing too much", "construction has business meaning", "how do I create this aggregate", "constructor with twelve parameters". Defines when to introduce a factory and when a constructor or static creation method suffices.
npx skill4agent add yonatankarp/software-design-skills ddd-factoryOrderSubscriptionPlanCustomerOrder.placeFor(customer, items)Account.openFor(applicant)new Order(...)newOrder.placeFor(customer, items)SubscriptionFactorycreateFor(applicant, plan, paymentMethod)build()build()placeOrderopenAccountissueRefundcreatemakeinstantiateFooFactorycreate()Orderddd-entityddd-aggregateddd-repository