O'Reilly logo

Implementing Domain-Driven Design by Vaughn Vernon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required