Tuesday, June 22, 2010

Opinions, Please: Behavior for Single Model?

I'd just like to get an opinion from the group:

I've not used Behaviors before, but I have been looking into it a
little bit since the one table I'm working with on my current project
is sort of a tree format. It's not an actual tree format and would not
work with the Tree Behavior native to CakePHP.

But I have been giving some thought to the idea that perhaps creating
my own Behavior which works for this table might be the way to go.
What I'm unsure of is why it would be more or less advantageous to
create a Behavior as opposed to just putting the functionality into
the Model itself. I'm sure in other circumstances, someone may want to
create a Behavior because the plan on using this same functionality
elsewhere. But is there any particular advantage for a single-use
scenario?

Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: