Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm Sender: cygwin-apps-owner AT cygwin DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Delivered-To: mailing list cygwin-apps AT cygwin DOT com content-class: urn:content-classes:message Subject: RE: setup.exe rebase patch MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Date: Fri, 1 Mar 2002 07:08:53 +1100 X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: setup.exe rebase patch Thread-Index: AcHAkg3t+ydcXIsKSoyAfHVsxtL2SgAATvng From: "Robert Collins" To: "Jason Tishler" , "Cygwin-Apps" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g1SK97p19630 Provide a Memento::ToString and Memento(String) or Memento::ToStream and Memento(io_stream &) pair. Then the config file class becomes the caretaker, ensuring that the file goes to the right place, that io exceptions are handled etc., and the ToFoo and (Foo) pair contains the serialisation logic. The serialisation logic is tightly bound to the class content (as it has to be), but the persistence mechanism is not. Rob > -----Original Message----- > From: Jason Tishler [mailto:jason AT tishler DOT net] > Sent: Friday, March 01, 2002 7:02 AM > To: Robert Collins; Cygwin-Apps > Subject: Re: setup.exe rebase patch > > > Rob, > > On Thu, Feb 28, 2002 at 01:46:44PM -0500, Jason Tishler wrote: > > > The Memento class is designed to provide a solution to > both issues. > > > > Thanks for pointing me to the Memento pattern. I will > investigate it > > and try to come up with a better solution. > > I just read the Memento chapter in the Gang of Four book. I > don't see how this pattern will help in this case because the > Memento object is suppose to be opaque. The Memento > pattern's canonical use is to assist with undo operations > (i.e., restore state) without breaking encapsulation. I > don't see how to twist this pattern for use by a general > persistence mechanism. > > Jason >