Hey richard,
I think it sounds like you're doing a good job so far. What I would do from
here is, in your test object, add a getProjects() method and in the project
object, add a getTests() method. Each of these would probably call the
associated GW and return a query of all the found items based on that
linking table.

You can do this because when you have an instance of the test cfc, a test
object, it represents one single test. That test has properties and methods,
and also linked data, so it makes sense that it's all linked directly from
that test object.

This approach is pretty generic and you will find it out in the wild here &
there, such as in the Reactor ORM, which creates these methods for you based
on the relationships you define in your xml config file.

To get ALL your tests, or ALL your projects, drop methods in your services,
TestService.getAllTests() and ProjectService.getAllProjects(), each would
call the respective GW and return a query.

HTH.

nathan strutz
http://www.dopefly.com/


On Fri, Sep 5, 2008 at 2:44 PM, Richard White <[EMAIL PROTECTED]> wrote:

> Hi,
>
> we have been doing alot of work on understanding OO development using CFC's
> and model glue.
>
> we have one issue that we don't quite understand and hope someone can help
>
> to simplify the problem: we have 2 objects: projects, and tests
>
> we have ensured that each of these objects have a DAO cfc for single db
> record access. and a GW for multiple db record access. we also have a
> service cfc for each of these objects.
>
> this is good as projects can be created, removed, searched etc... and the
> same with tests
>
> however tests can be linked to projects. there is a table in the database
> that is called projecttests and contains the projectID and testID as primary
> keys and foreign keys.
>
> the problem comes when understanding how to link this in the cfc's - where
> exactly will this fit in?
>
> would it fit into the projects cfc - so it could appear as
> project.linktest(#testobject#) - but then i would also need functions such
> as project.getAllTests(#projectobject#) etc...
>
> i am a little confused and would really appreciate any help in
> understanding how to best achieve this
>
> thanks
>
> richard
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312109
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to