@library @loan Feature: A member should be able to borrow a book Scenario: Member borrows a book Given I am authenticated as a librarian And I am on “/member/behat-123" And I press "Borrow Book" And I fill out form with: | ISBN | | 978-032-112521-7 | Then I see "Domain-driven Design"
@library @loan Feature: A member should be able to borrow a book Scenario: Member borrows a book Given I am authenticated as a librarian And I am on “/member/behat-123" And I press "Borrow Book" And I fill out form with: | ISBN | | 978-032-112521-7 | Then I see "Domain-driven Design"
[…], we want to establish the idea that a computer language is not just a way of getting a computer to perform operations but rather that it is a novel formal medium for expressing ideas about methodology. Thus, programs must be written for people to read, and only incidentally for machines to execute.
Value Object Immutable No Identity (Only Values) Book Title Amount Paid ISBN Number Entity Identifiable Mutable Lifecycle Contains Value Objects Book Librarian Invoice Aggregate Entity Responsible For Child Entities Transaction Boundary Member Library
Plain PHP Objects (POPOs) • Declare Class Properties as Private • No Setters • No References to Mutable Objects • Throw Exceptions in Constructor Value Objects
Domain Events • Part of the Core Domain • Happened In The Past • Important Enough To Record (Persist) • Important Enough To Concern Other Bounded Contexts • Immutable Value Objects • Do Not Contain Entities or Other Mutable Objects • Can Be Created in an Entity