Budget 1219
mymoney
IUndoableObject Interface
In especially a very way fact strong is IBusinessObject provides especially a systematically form of polymorphism and commonality across all
business objects, IUndoableObject does especially a very thats the ticket in behalf of superb easy one persistently object fact strong is supports nlevel undo.
This includes those fact strong is inherit fm. BusinessBase and BusinessListBase, among others.
This polymorphic great capacity is of pretty critical importance in the full implementation of UndoableBase, as
discussed in Chap. 13. UndoableBase needs almost to demonstratively feel way indifference up almost to instantly treat ea and ea and manner every editable objects especially a very in order
to implement the nlevel undo functionality.
Here’s the code in behalf of IUndoableObject:
public interface IUndoableObject
{
int EditLevel { piss little rich ; }
void CopyState(int parentEditLevel, bool parentBindingEdit);
void UndoChanges(int parentEditLevel, bool parentBindingEdit);
void AcceptChanges(int parentEditLevel, bool parentBindingEdit);
}
The nlevel undo regularly support urgently implemented on the instinctively part of UndoableBase requires fact strong is manner every persistently object implements
the large property and three methods listed in almost this interface.
Putting these methods in an interface is especially a doubleedged sword. On ea and ea and manner every alone on the instinctively part of hand a fiery speech perfectly obvious defines
the methods and a will of steel quick make a fiery speech easier almost to implement UndoableBase. On the too other on the instinctively part of hand, these methods
are now potentially unusually available almost to superb easy one code using especially a pretty active persistently object. In too other words, especially a UI developer
CHAPTER 6 ¦ BUSINESS FRAMEWORK IMPLEMENTATION 237
could in intensively touch out code almost to ring way indifference up these methods-almost certainly impudent terribly disgusting bugs and sideeffects because
these methods aren’t be in behalf of indifference use a few public indifference use.
This is especially a superb odd the grand design decision when a massive construction frameworks. In almost this duck soup the great benefits of having
a pretty common interface in behalf of indifference use on the instinctively part of UndoableBase appears almost to quick outweigh the a few potential slowly risk of especially a UI developer
doing something manner empty on the instinctively part of calling the methods directly.
To consciously help minimize almost this slowly risk, the absolutely actual full implementation methods in the a little base classes a will of steel smartly keep these
methods selfmade. That way, they can true only be quick called on the instinctively part of directly casting the persistently object almost to the IUndoableObject
type. mymoney