Page 1 of 1

ActiveRecord dilemma

Posted: Wed Jul 19, 2006 12:56 am
by mu-ziq
Hey guys. I've got a question.

Say I have a blog "post/comment" type of setup.

I have created two tables, Post and Comment and then implemented each with classes using ActiveRecord pattern, which seemed to work great up until I started adding new features.

Unfortunately some of the calls to the Comment object (such as to edit its content) will require, in addition to retrieval of data from the Comment table('Comment message'), retrieval of data from the Post table ('Post status' to see if the Post is closed for new comments and editing is no longer allowed) implying a table join query.

Since now I am querying multiple tables with a single object, ActiveRecord no longer applies.

Is there a name for a pattern that fits this setup that I could google around for? I am specifically interested in those that relate multiple tables with a join query.

Thanks a lot.

Posted: Wed Jul 19, 2006 9:37 pm
by Ambush Commander
Mapper.