|
On Tue, 2005-03-01 at 16:34, Kyle Collie wrote: > Specifically, I have added a global error indicator to the service > program. In each setter, I turn this global on if a validation fails. > In the update and write procedure, I check to see if this global is > on; if not, I write or update the record. > > I wanted to add this global to the template. > > Or, am I missing something? The only thing you are missing is that you still have to go to EVERY setter and determine what sets on the error code. Each setter may have different criteria: say one setter's failure sets on this error code, but another simply defaults the value to 0 or all 9's or something like that. In that case, your global error indicator isn't really global anymore. The point is that for a standard beans, just getting and setting is all that's required. If you were going to somehow add setter validation to the template, you'd still have to establish IN THE TEMPLATE the different rule for every setter. And you'd have to re-establish those rules for every file you ran the bean against. It's just not logical (or feasible). Of course, you can add the error indicator to the template, and you can add a check for it's value in the UPDATE and INSERT procedures to the template. The problem is with the individual setter behaviors. Joel > Kyle > > > On Tue, 01 Mar 2005 10:26:42 +0000, Joel Cochran <jrc@xxxxxxxxxx> wrote: > > On Tue, 2005-03-01 at 14:37, Kyle Collie wrote: > > > I'm placing my data validation code in the setters. Is this not the > > > "correct" place? > > > > > > Kyle > > > > It is, but there is no way to know at design time (for the tool itself) > > what that validation should be. Validation is specific to every > > procedure: you have to know the field name, the field type, and the rule > > you are trying to enforce. > > > > Adding specifics to a template just doesn't make sense. You'd have to > > change the template every time you ran the tool. The template is there > > for constant procedures, in other words, procedures that should occur in > > *every* encapsulating service program. As such, you can add all the > > constant methods you want. > > > > I could be missing something: give me an example of what you are trying > > to accomplish. > > > > Joel > > > > _______________________________________________ > > This is the RPGNext Discussion and Information (RPGNext) mailing list > > To post a message email: RPGNext@xxxxxxxxxxxx > > To subscribe, unsubscribe, or change list options, > > visit: http://lists.midrange.com/mailman/listinfo/rpgnext > > or email: RPGNext-request@xxxxxxxxxxxx > > Before posting, please take a moment to review the archives > > at http://archive.midrange.com/rpgnext. > > > _______________________________________________ > This is the RPGNext Discussion and Information (RPGNext) mailing list > To post a message email: RPGNext@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpgnext > or email: RPGNext-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpgnext.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.