House of Fusion
Home of the ColdFusion Community

Search cf-talk

December 05, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31       

Search over 2,500 ColdFusion resources here  >>>      
Home / Groups / ColdFusion Talk (CF-Talk)

CFC and MG2 where does validation fit in?

Author:
Richard White
09/08/2008 07:47 AM

hi, does anyone have any ideas on this? thanks richard > Hi > > we have hit a little sticking point with CFC's and model glue 2. > > we have an object named subject. > > we have created a DAO to handle single record db work and a GW to > handle all multiple record db work. we also have a service cfc to > handle the DAO and GW CFC's. > > we also have a controller for the interface which listens for events > on that interface. One of the events listens for the user to edit > subject details. the listener calls a function in the controller named > validateAndSave which is where the problem arises: > > we want to validate the subject details but we dont want to validate > them in this controller as there will also be other interfaces in our > system where we might want to validate the same details, so this > defeats the object of the cfc's. > > so we thought that we could add functions such as validateFirstName, > validateLastName in the subject services cfc. alterntaively we can > create a whole new cfc called subject validation cfc and add all > validation functions in there. > > this way, other interfaces can also call these validation functions > easily and makes logical sense. > > we would really appreciate your feedback on what you guys think would > be the best route, and how you do this? > > thanks > > richard


Mailing Lists