I don't know if this helps, but even though it looks "complicated", in practice i'm finding that the memento pattern simplifies certain things. The nice thing about it is is gives you one interface between the database (or whatever storage mechanism is used) and the object. I'm finding it also helps to simplify the business object and bring out the advantages of using objects. Once i had it all in place and i started enhancing some functionality, i found myself saying, "Oh, that was simple" again and again. Sean's favorite word seems to be "trade-off" these days, and after working this concept into my code over the last weeks, I would say "trade-off" applies well here.
> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Justin Balog > Sent: Wednesday, November 26, 2003 10:21 PM > To: '[EMAIL PROTECTED]' > Subject: [CFCDev] memento and composition > > > > Howdy, > > I am running into a design question. I have been doing a lot of thinking > about this, and haven't come to any conclusive answer. I always > have issues > with composition because its seems like it adds quite a bit of > complexity to > applications, surely it helps with Code reuse, but it goes > against my (Keep > It Simple) style of application building. You start adding complexities, > and things become brittle. My question is, lets say I have a person.cfc > whose composed of normal instance vars and an address.cfc (wow I > have really > beat this example to death). Looks good to me. However, I also > took Sean's > get/setMemento() concept from his mach-ii sample app (Sean's > stuff is good, > and I hate dragging him into my convoluted questions. I just > feel obligated > to cite my sources). If your object is Flat, meaning its not composed of > other objects, memento is really slick, clean and tidy. Just set, or get > the instance vars. But once you introduce composition, its gets a bit > uglier. Can anyone help ease my fears about composition, possibly an > example of how folks have used the memento concept with composition. I am > guessing its much like Barney suggested to me a while back when I asked > about serialization. To me it seems like a tradeoff of flat > stability, or > complex reusability. Hmm.....any thoughts? > > Thanks much, > > Justin > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email > to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' > in the message of the email. > > CFCDev is run by CFCZone (www.cfczone.org) and supported > by Mindtool, Corporation (www.mindtool.com). > > An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED] ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
