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.

Image

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 books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.