Creating CalendarEntry Instances

Let’s look at the design. The Factory we are considering now has its site on Calendar and is used to create CalendarEntry instances. The CollabOvation team takes us through the implementation.


Here’s a test developed to demonstrate how the Calendar Factory Method should be used:

public class CalendarTest extends DomainTest {     private CalendarEntry calendarEntry;     private CalendarEntryId calendarEntryId;     ...     public void testCreateCalendarEntry() throws Exception {         Calendar calendar = this.calendarFixture();         DomainRegistry.calendarRepository().add(calendar); ...

Get Implementing Domain-Driven Design now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.