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.

  1. isnapshotservice
  2. isnapshottable - country implements indicate can create countrysnapshot
  3. 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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -