Here you are seeing that there are a multitude of ways to accomplish the
same task. Steve mentions that you could call the validate with in the
setter method. I have done just that for something simple like stripping out
dashes from a phone and/or fax number. I'm not sure that it makes sense for
your date comparison need because it would be a toss up between which of the
dates you should make the call in. But it would work.

Another way to approach the bean is instead of calling each setter from
outside the bean, you pass all the data into the init function. The init
function would the have a call to each setter. It could also have a call to
the Validate method.

There is another code generator that makes beans this way. The good Peter
Farrell wrote it and it is on his website. If you want to check it out,
verify and copy the data below
TrimaID numeric
SerialNumber numeric (or maybe it is a string)
Version numeric
InServiceDate date
OutServiceDate date

Go to rooibos.maestropublishing.com and paste that into the Bean template
box. Enter a name for your bean and path (both are optional) and click the
Execute button. You can look at the init function to see what I'm talking
about. Peter also has some options that you may be interested in concerning
validation.

Regarding your concern that another developer wouldn't know about running
the Validation method. Two thoughts: maybe they should know to do this. Or
maybe they should only be accessing your UpdateTrima function in your
TrimaService CFC which does the validation for you.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240804
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to