NShape Concepts
How Persistency Works

<< Click to Display Table of Contents >>

Navigation:  Concepts > Persistency >

NShape Concepts
How Persistency Works

Previous pageReturn to chapter overviewNext page

The basic concept behind the NShape persistency layer is, as mentioned in the overview, the independence of the implementations. In order to archive this goal, the repository implementation uses mainly five interfaces persisting objects:

IEntityType: Persistency counterpart of ShapeType / ModelObjectType. Defines name and namespace and provides constructor, properties and supported version of the persisted type.
IEntity: Provides a list of persisted properties and inner objects along with methods for loading, saving and deleting them.
IRepository: Along with the Project, the repository is in fact the only component that does always exist because if you do not create or link a repository component, the project creates one internally. The repository is a pure storage interface that does not check nor maintain consistency of its objects.
If you don't want or can't use the shipped implementations, you have to implement this interface in order to realize your own persistency solution.
Please check the chapters "The CachedRepository" and "The Stores" before you start implementing your own repository because in most cases a new store implementation is sufficient.
IRepositoryReader and IRepositoryWriter: These interfaces link the (store independent) IEntity implementations with the (store dependent) implementations of the IRepository interface or the Store class. They provide methods for reading/writing basic CLR data types from the underlying store.