Search This Blog

Thursday, October 25, 2012

XPO Session vs XAF ObjectSpace (for starters only)

I think that the explanation in the http://www.devexpress.com/issue=Q415894 ticket willl be helpful for people who get started with XAF:

"In XPO, if you use Session and want to save your changes, you should either call the Save method of your persistent object or use the CommitTransaction method of the Session class.
If you use UnitOfWork (it is a descendant of Session), then you should call its CommitChanges or CommitTransaction methods. You can also use the Save method to mark your persistent object as modified.
In XAF, there is a similar entity called ObjectSpace. It uses UnitOfWork internally when XPO is used for data access. To save data in an ObjectSpace, use its CommitChanges method.
To create a new object, use the CreateObject method of the ObjectSpace class. Of course, you can access the underlying XPO session via ((XPObjectSpace)theObjectSpace).Session .
So, these are the same scenarios, just implemented differently.
I hope this clarifies things for you."

These concepts are now more detailed in the XAF documentation at eXpressApp Framework > Concepts > Data Manipulation and Business Logic

No comments:

Post a Comment