Sure, you could do it that way if it made sense. And in some situations, perhaps it does. But for where i'm at with this, i'm not sure if it's a good idea to subcontract out validation to another object, even if you do manage to save keystrokes in the process. Each BO that i'm working with tends to have unique validation needs, even if there are some similarities (which isn't apparent from my simple example). That would imply that each BO needs it's own validation object ... or that each BO would need to instruct a common "VO" how to handle it's validation quite explicitly. Either way, it doesn't seem like a substantial improvement to me.
But i'm quite new to this, so it's very likely that my view is colored by my inexperience. I'm tending to build things simply at first, and only when clear and substantial improvements jump out at me, refactor the object model. Often the refactoring takes only a few minutes, but the improvement to the application is much greater in proportion. Interestingly, code reuse hasn't been the central incentive in my refactoring efforts with my OO models, although it ALWAYS was in my procedural code. It's been centered more around cohesion - when responsibilities crop up within the app as it evolves that can be handled by a seperate object. Since in my case, validation couldn't be handled by a "VO" without explicit direction from the "BO", it seems better just to let the BO handle it. But again, maybe another perspective on this situation would throw a completely different light on it. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Qasim Rasheed Sent: Saturday, January 29, 2005 4:07 AM To: [email protected] Subject: Re: [CFCDev] Validating and Persisting Form Data Nando, Your example looks excellent, although I have a question. Wouldn't it be nice to have a validation object composited in PersonBO which could have several validation functions. This could avoid unneccesary inheritance of Bean as described by someone. Thanks On Fri, 28 Jan 2005 22:10:07 +0100, Nando <[EMAIL PROTECTED]> wrote: > You're welcome. I'm sure others have more complete design approaches than i > do, but hopefully you can use it as a starting point to branch out from. > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Dawson, Michael > Sent: Friday, January 28, 2005 8:30 PM > To: [email protected] > Subject: RE: [CFCDev] Validating and Persisting Form Data > > > Thanks, all for posting your comments. They are all very interesting. > > Nando, esp thanks for posting the code. I'm going through it right now. > It is very helpful to see a real example. > > Thanks! > M!ke > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email > to [EMAIL PROTECTED] with the words '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 words '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 words '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 words '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]
