- 2 minutes to read
In XAF applications, all data-aware manipulations are performed via the Object Space. The Object Space is an abstraction on the database context. The Object Space allows you to query or edit data in the transaction. Object Space is an ORM-independent implementation of the well-known Repository and Unit Of Work design patterns.
Object Space members are declared in the IObjectSpace interface. The BaseObjectSpace and CompositeObjectSpace classes implement the common code. XAF includes the following CompositeObjectSpace descendants:
- XPObjectSpace - used to access data via a Session when the XPO data model is used.
- EFObjectSpace - used to access data via a DbContext when the Entity Framework 6 data model is used;
- EFCoreObjectSpace - used to access data via a DbContext when the Entity Framework Core data model is used;
- NonPersistentObjectSpace - used to manage non-persistent objects that are not mapped to the database.
In most cases, you will access Object Space via the IObjectSpace interface and do not need to use these classes directly.
To see how you can access an IObjectSpace object to write business logic in various contexts, proceed to the Ways to Implement Business Logic topic. To learn about Object Space API, see Create, Read, Update and Delete Data.