org.nakedobjects.metamodel.adapter.version
Interface Version

All Known Implementing Classes:
NullVersion, SerialNumberVersion, VersionUserAbstract, VersionUserAndTimeAbstract

public interface Version

Version marks a NakedObject as being a particular variant of that object.

This is normally done using some form of incrementing number or timestamp, which would be held within the implementing class. The numbers, timestamps, etc should change for each changed object, and the different() method shoud indicate that the two Version objects are different.

The user's name and a timestamp should alos be kept so that when an message is passed to the user it can be of the form "user has change object at time"


Method Summary
 boolean different(Version version)
          Compares this version against the specified version and returns true if they are different versions.
 java.util.Date getTime()
          Returns the time of the last change.
 java.lang.String getUser()
          Returns the user who made the last change.
 java.lang.String sequence()
          Returns the sequence for printing/display
 

Method Detail

different

boolean different(Version version)
Compares this version against the specified version and returns true if they are different versions.

This is use for optimistic checking, where the existence of a different version will normally cause a concurrency exception.


getUser

java.lang.String getUser()
Returns the user who made the last change.


getTime

java.util.Date getTime()
Returns the time of the last change.


sequence

java.lang.String sequence()
Returns the sequence for printing/display



Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.