org.nakedobjects.object
Interface NakedObject

All Superinterfaces:
Naked, java.io.Serializable
All Known Subinterfaces:
Aggregate, NakedCollection
All Known Implementing Classes:
AbstractNakedCollection, AbstractNakedObject, InternalCollection

public interface NakedObject
extends Naked, java.io.Serializable

Definition of an naked reference object.

A basic implementation is defined in AbstractNakedObject and its subclass, NakedObject.

A naked reference object must do the following

An expressive object should be java.lang.Observable object so it can notified others of changes to itself. This interface therefore defines the Observable methods to ensure [how does it do this?] this happens.

See Also:
NakedObject, AbstractNakedObject

Method Summary
 void addObserver(java.util.Observer o)
          Deprecated.  
 java.lang.String contextualTitle()
          Returns a label identifying the object along with a label detailing the context of an object
 int countObservers()
          Deprecated.  
 void created()
          Called when the object is first created to intialised the object.
 void deleted()
          Called when the object is delete, after it is removed from the object store.
 void deleteObserver(java.util.Observer o)
          Deprecated.  
 void destroy()
          Called when a the system destoys an object - permenantly removes it from the object store.
 java.lang.String getCollectiveName()
          Returns the name a collection of these NakedInterfaces should be given
 java.lang.String getIdString()
          The objects descriptive id for dislaying to a user.
 NakedClass getNakedClass()
          Returns the NakedClass that represents this object.
 NakedObjectStore getObjectStore()
           
 java.lang.Object getOid()
          The objects unique id.
 boolean hasChanged()
           
 java.awt.Image iconImage(int size)
          Returns an Image to use as icon when displaying an object of this type.
 boolean isFinder()
          Returns true if the object is used for finding objects.
 boolean isLookupElement(java.lang.String arg)
          returns true if the current object is a valid lookup element.
 boolean isPersistent()
          returns true if the object is being held by the object store.
 boolean isResolved()
          returns true when the object has been completely read into memory and all it attributes can be accessed.
 void makeFinder()
           
 void makePersistent()
           
 void objectChanged()
          When the state of this object changes, e.g., an attribute is set, then this method should be called so that it is persisted and a message is propogated to the users of this object within the system.
 void resolve()
          Resolves the current object ensuring all its attributes are available in memory.
 void setChangedAndNotifyObservers()
          Deprecated.  
 void setOid(java.lang.Object oid)
          Sets the OID for this object.
 void setResolved()
          sets the object's resolved state to true
 
Methods inherited from interface org.nakedobjects.object.Naked
about, copyObject, getClassName, getFullClassName, getObjectHelpText, isEmpty, isSameAs, isValid, summary, title
 

Method Detail

addObserver

public void addObserver(java.util.Observer o)
Deprecated.  

Adds an Observer to the list of objects that this object will notify when a change occurs


contextualTitle

public java.lang.String contextualTitle()
Returns a label identifying the object along with a label detailing the context of an object


countObservers

public int countObservers()
Deprecated.  

Returns a count of the number of registered observers


created

public void created()
Called when the object is first created to intialised the object. This will not be called when the object is recreated when retrieved from the object store.


deleted

public void deleted()
Called when the object is delete, after it is removed from the object store.


deleteObserver

public void deleteObserver(java.util.Observer o)
Deprecated.  

Removes an Observer from the list of observing objects

See Also:
addObserver(java.util.Observer)

destroy

public void destroy()
             throws ObjectStoreException
Called when a the system destoys an object - permenantly removes it from the object store.

Throws:
ObjectStoreException

getCollectiveName

public java.lang.String getCollectiveName()
Returns the name a collection of these NakedInterfaces should be given


getIdString

public java.lang.String getIdString()
The objects descriptive id for dislaying to a user.


getNakedClass

public NakedClass getNakedClass()
Returns the NakedClass that represents this object.


getObjectStore

public NakedObjectStore getObjectStore()

getOid

public java.lang.Object getOid()
The objects unique id. This id allows the object to added to, stored by, and retrieved from the object store.


hasChanged

public boolean hasChanged()

iconImage

public java.awt.Image iconImage(int size)
Returns an Image to use as icon when displaying an object of this type. The image returned can depend on the state of the object. I.e., this method can be expected to be called repeatedly so the view of an object is consistent with its state.

Parameters:
size - the image should be, in pixels

isFinder

public boolean isFinder()
Returns true if the object is used for finding objects. An object cannot be a finder object and persistent.


isLookupElement

public boolean isLookupElement(java.lang.String arg)
returns true if the current object is a valid lookup element.


isPersistent

public boolean isPersistent()
returns true if the object is being held by the object store.


isResolved

public boolean isResolved()
returns true when the object has been completely read into memory and all it attributes can be accessed.


objectChanged

public void objectChanged()
When the state of this object changes, e.g., an attribute is set, then this method should be called so that it is persisted and a message is propogated to the users of this object within the system.


makeFinder

public void makeFinder()

makePersistent

public void makePersistent()
                    throws ObjectStoreException
Throws:
ObjectStoreException

resolve

public void resolve()
Resolves the current object ensuring all its attributes are available in memory.


setChangedAndNotifyObservers

public void setChangedAndNotifyObservers()
Deprecated.  

Notifies all observers of this object that it has changed.


setOid

public void setOid(java.lang.Object oid)
Sets the OID for this object. This id must be unique.


setResolved

public void setResolved()
sets the object's resolved state to true