Re: Opinions, Please: Behavior for Single Model?
On Tue, Jun 22, 2010 at 1:01 PM, DragonFlyEye <dragonflyeye74@gmail.com> wrote:
> 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.
Are you certain that you can't change your schema to what TreeBehavior expects?
> 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?
Ask yourself whether this "tree-like but different" schema might be
used elsewhere (other model, other site). If it's truly a one-off then
you're probably better off putting the code in the model.
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
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home