oop - What is the name of this pattern? -
at first called in isnapshotservice, does
countrysnapshot snapshot = snapshotservice.createsnapshot<country, countrysnapshot>(country);
for work country must this
public class country : isnapshottable<countrysnapshot> { public countrysnapshot createsnapshot(isnapshotservice snapshotservice) { } }
and countrysnapshot must this
public class countrysnapshot : isnapshotfor<country> { }
i used name "snapshot" because intended service create immutable snapshots of classes end-of-period snapshot of system accounting purposes. has occurred me result not immutable snapshot, example stocklocation might create stockaudit (which not snapshot.)
so, keeping in mind no longer create snapshots need come better names these 3 interfaces.
- isnapshotservice
- isnapshottable - country implements indicate can create countrysnapshot
- isnapshotfor - countrysnapshot implements show created country
any suggestion welcome. thanks
seems lot memento. snapshot memento , snapshottable originator that's outsourced saving capabilities snapshotservice.
edit: agreed, not memento, although structure similar. case of either temporal object or - know - snapshot.
Comments
Post a Comment