View Javadoc

1   package se.citerus.dddsample.domain.shared;
2   
3   import java.io.Serializable;
4   
5   /**
6    * A value object, as described in the DDD book.
7    * 
8    */
9   public interface ValueObject<T> extends Serializable {
10  
11    /**
12     * Value objects compare by the values of their attributes, they don't have an identity.
13     *
14     * @param other The other value object.
15     * @return <code>true</code> if the given value object's and this value object's attributes are the same.
16     */
17    boolean sameValueAs(T other);
18  
19  }