I have an object with a many-to-many relationship (t1 to t2 linked via t3) where t2 contains simple ID/name value pairs. I am using a gateway to get all of the records in t2, and could use an iterator inside my controller to get the related records in t1, but all I'm really looking for is a list of the related ID's. So I've decided to handle this with composition, but I'm not sure where to do it. I started on the view (bad idea), and quickly moved to the controller, and then moved to the Record object. This seems like the best place, but should I worry about any of the other objects, most notably the TO? I am planning on adding a new method to my Record object that will act just like the other accessors, and am planning on putting it in the DB agnostic CFC. Does this sound correct?

I will also add a setXYZ() method to match that I will use to change this pseudo-property, but then would I override my DAO's save() method to handle that, or would a better approach be to use the new event model and have a new method on the DAO update the proper link table after the record has been saved?

Just kind of thinking out loud here, but I'd appreciate any feedback. -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

Reply via email to