Search code examples
breezebreeze-sharp

Should the Entity implement IEditableObject?


I have yet to fully understand the need to implement IEditableObject for an entity. I can only think about it's use when an entity has to revert the changes back to it's previous state, for example a Reset/Revert behavior on a dialog.

Consider the same above scenario where the user has to revert the entity state on a CRUD screen to it's beginning state. Does an entity derived from BreezeSharp BaseEntity support the rollback feature already? Or should the client implement it's own state management, so don't depend on the BreezeSharp for the same?


Solution

  • The reason that breeze implements IEditableObject is that many UI suites offer substantially greater functionality to objects that implement IEditableObject and all of the requirements of IEditableObject are already part of the breeze Entity implementation anyway, so the actually implementation is simply an exercise in delegation.

    If you are using Breeze.sharp, I can't imagine why you would want to implement your own state management since Breeze already implements most of what I think of as state management. What is it that you need that Breeze does not provide in this area?