Pattern: Time Travel. github
Pattern | Summary |
---|---|
Version History | You have an object whose changes you need to track. Split the object into two parts. One part is immutable. One is a snapshot of the changeable state |
Perspective | Create a Perspective object to represent a point of view into the history of a versioned object. |
Effective Date | Separately record the date on which the system should act as if a version is valid. |
* [x] Create method pay: and pay in class Contract class * [x] `testNaivePayToday` Test GREEN * [x] Define the ContractVersion (we omit the Constructor Method #pay: * [x] Implement the 2 visible methods in Contract: `#versionAt:put:` and `#versionAt:`. * [x] `testPayToday` GREEN * [x] `testPayLastMonth` GREEN ContractVersion (accessing class):
pay: anInteger ^ (self new) pay:anInteger.
DOT FROM lambda-browsing
http://www.manfred-lange.com/publications/TimeTravel.pdf Wayback Machine has 38 captures 8 Dec 2004 - 30 Dec 2021 We start our time travel with the capture from DEC 08 2004
https://web.archive.org/web/20041208183938/http://www.manfred-lange.com/publications/TimeTravel.pdf