Created
February 19, 2013 01:45
-
-
Save kinopyo/4982401 to your computer and use it in GitHub Desktop.
Temporal Patterns, source code from http://martinfowler.com/eaaDev/timeNarrative.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Customer... | |
private TemporalCollection addresses = new SingleTemporalCollection(); | |
public Address getAddress(MfDate date) { | |
return (Address) addresses.get(date); | |
} | |
public Address getAddress() { | |
return getAddress(MfDate.today()); | |
} | |
public void putAddress(MfDate date, Address value) { | |
addresses.put(date, value); | |
} | |
class CustomerSnapshot... | |
private Customer base; | |
private MfDate validDate; | |
public CustomerSnapshot (Customer base, MfDate validDate) { | |
this.base = base; | |
this.validDate = validDate; | |
} | |
public Address getAddress() { | |
return base.getAddress(validDate); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment