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

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

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