Microsoft
Software
Hardware
Network
Question : How to link a class of validation methods to VCL field components?
I am refactoring a financial product. I have a set of 6 fields that appear many times through the program (amount, start date, cost-of-living adjustment, etc). sometimes these are individual edit components and sometimes they are columns in a grid. As per usual all sets require the same basic set of validations and error responses.
I currently use functions to perform the validations. I see some advantages to moving these functions into a class so that each field set is represented by an instance of the class. But my question is how to best "link" or relate each of the fields - VCL edit components - to the class instance so that an onchange event in the editor would launch the appropriate validation method.
I get a bit fuzzy with class design when the properties are object references which is what would seem to be required here. As stated above I am looking for a recommended means for linking field components to the class instance so that component events can trigger validation methods. Please let me know if more details are needed regarding the nature of the problem.
Currently in Delphi 2007 but can upgrade if new features offer a better solution.
Thanks.
Tom
Answer : How to link a class of validation methods to VCL field components?
if you want a other sample of a strategy pattern, you can find one here
http://www.felix-colibri.c
om/papers/
design_pat
terns/
gof_
design_pat
terns/gof_
design_pat
terns.html
Random Solutions
Setup Webmail on MS SBS 2003
Myopia cause - excessive reading
Positioning Word Document opened in Powerpoint
mySQL join query how do I write
E200i RAID controller Array Expansion
Copying CUSTOM.DIC to new machine - can't add words and how to handle file ExcludeDictionaryEN0409.le
x
Pasting values in VBA with a single double quote - Excel
MacBook Pro Superdrive Doesn't See CDs
Powershell script that enumerates folder permissions.
WYSIWYG web builder