com.ebmwebsourcing.geasytools.modeleditor.modelmanager.client
Interface HasModelManager
- All Known Subinterfaces:
- ModelProxy
public interface HasModelManager
Marker interface to enable historization on a model
- Author:
- nfleury
|
Method Summary |
void |
copy(java.lang.Object object)
Copying a model means change the state of the actual one but setters
shouldn't be used while copying fields. |
HasModelManager |
getClone()
Clones are used to store the state of actual object at a specific moment. |
getClone
HasModelManager getClone()
- Clones are used to store the state of actual object at a specific moment.
All fields of current object have to be copied to the new clone.Otherwise that
may lead to some inconsistencies in actual object history.
Important: Do not use GWT.create() while instantiating the new clone, use new
keyword.
Ex: MyTypeToClone clone = new MyTypeToclone();
Rather than: MyTypeToClone clone = GWT.create(MyTypeToclone.class);
Important: While cloning a list, only the list itself has to be a new instance,
meaning the content of the list should'nt have to be cloned
- Returns:
HasModelManager that is a clone of actual object.
copy
void copy(java.lang.Object object)
- Copying a model means change the state of the actual one but setters
shouldn't be used while copying fields. Otherwise that may lead to some
inconsistencies in actual object history.
Use fields directly to copy the passed object :
Ex: this.myField = objectToCopy.getMyField()
Rather than: this.setMyField(objectToCopy.getMyField());
Important: While copying a list from the passed object
the actual model list must be replaced by a new list:
Ex:this.dummyModels = new ArrayList();
Important: While copying a field that have a mutable type,
the concerned type have to be copied to.
Ex:if (mtocopy.getDummyModel()!=null) this.dummyModel.copy(mtocopy.getDummyModel());
- Parameters:
object - The object to copy
Copyright © 2010-2011 Petals Link. All Rights Reserved.