Skip to content

Instantly share code, notes, and snippets.

@SeanTAllen
Created February 5, 2012 01:24
Show Gist options
  • Save SeanTAllen/1741776 to your computer and use it in GitHub Desktop.
Save SeanTAllen/1741776 to your computer and use it in GitHub Desktop.
interface Persistence
persist
Persister implements Persistence
object Foo
internal value A
internal value B
persistVia Persister
KeyValueHash 'A' => A, 'B' => B
Persister persist KeyValueHash
--
Foo doesnt expose internal state representation except via a generic agreed upon mechanism for anything like display, persist etc. Actual what for persist, display is handled by other objects. They just have a standard interface for accomplishing it which Foo can implement. There is no 'behavior' for Foo except how it interacts with objects that do things.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment