|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A Persister is responsible for saving and restoring models to and from a resource. It is recommended that all components in the IVC communicate their persistence needs to the Persistence layer instead of directly writing file readers and writers or establishing database connections. This ensures that the framework is 'aware' of all such processes at runtime. This awareness can be communicated to the user at all times; such transparency of operation is fundamental to the IVC. Delegating the persistence operations to the persistence layer also helps the algorithm implementations to concentrate on optimizing the algorithm itself and cleanly separates the algorithm from its data persistence functions.
IVC,
ResourceDescriptor| Method Summary | |
boolean |
canPersist(java.lang.Object model)
Determines if this persister can persist the given data model. |
boolean |
canRestore(ResourceDescriptor resource)
|
PropertyMap |
getPropertyMap()
Gets a property map describing this persister and file format (if applicable). |
void |
persist(java.lang.Object model,
ResourceDescriptor resource)
Persists a data model to a resource such as a file or database. |
java.lang.Object |
restore(ResourceDescriptor resource)
Restores a model from the specified resource. |
| Method Detail |
public void persist(java.lang.Object model,
ResourceDescriptor resource)
throws java.io.IOException,
PersistenceException
model - The model to be persisted.resource - The resource to persist the model to.
java.lang.Exception
java.io.IOException
PersistenceException
public java.lang.Object restore(ResourceDescriptor resource)
throws java.io.IOException,
java.lang.OutOfMemoryError,
PersistenceException
java.io.IOException
java.lang.OutOfMemoryError
PersistenceExceptionpublic boolean canPersist(java.lang.Object model)
model - The model for which persistence is desired.
public boolean canRestore(ResourceDescriptor resource)
resource - The resource from which restoration is desired.
An example of a resource is a file on disk.
public PropertyMap getPropertyMap()
edu.iu.iv.core.persistence.PersisterPropertyMap
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||