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

Designing a More Sophisticated Process

Still, we may desire to design a more sophisticated process. In cases where multiple completion steps are necessary, it works best to have a more elaborate state machine. To address such needs, here’s the definition of a Process interface:

package com.saasovation.common.domain.model.process; import java.util.Date; public interface Process {     public enum ProcessCompletionType {         NotCompleted,         CompletedNormally,         TimedOut     }     public long allowableDuration();     public boolean canTimeout();     public long currentDuration();     public String description();     public boolean didProcessingComplete();     public void informTimeout(Date aTimedOutDate); ...

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