Relationships

[Previous] [Next]

To recover a persistable object from a repository, a concrete repository reconstructs a concrete persistable object by retrieving the persistable object's state from an underlying data store such as a flat file or a Microsoft SQL Server database. The concrete repository then creates an instance of the persistable object, initializing the persistable object's state with data from the data store by means of its PersistableObject interface's WriteState method, and returns a reference to the concrete persistable object to the requesting client. (See Figure 11-1.)

click to view at full size.

Figure 11-1. This diagram depicts the steps taken to retrieve a persistable object from a repository.

To store a persistable object to a repository, a concrete persistable object (created by the client) is handed off to a concrete repository. The concrete repository extracts the state from the object by calling the object's PersistableObject interface's ReadState method and writing the results to an underlying data store. (See Figure 11-2.)

click to view at full size.

Figure 11-2. This diagram depicts the steps taken to store a persistable object to a repository.



Microsoft Visual Basic Design Patterns
Microsoft Visual Basic Design Patterns (Microsoft Professional Series)
ISBN: B00006L567
EAN: N/A
Year: 2000
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net