Open-ended answer... sorry :)

I would say do whatever is easiest and maintainable for *YOU*.

There are ways to speed up requestActions inside elements by using
caching where possible.

Since most applications are different in nature in terms of
requirements, one size does not fit all.

If you find yourself using the same code over and over again with
minimal changes, then maybe look into making it into a helper, or
behaviour, or a component, or add it in beforeFilter(), afterFilter(),
depending on what the code actually does.

But as long as you keep revisiting and revising the code you write,
you will soon figure out what suits you best on a variety of projects.
As you do this you will also gain a better understanding of cakephp
and what it can offer you.

Cheers,
Adam

On Dec 5, 1:17 am, sunertl <[EMAIL PROTECTED]> wrote:
> I have a question concerning the reusage of code in cakephp. as far as
> i understood the optimum to reach in mvc-frameworks is that no code is
> written twice. cake gives me means like elements and requestAction to
> reach this goal.
>
> but: every requestAction results in a new http-request, for elements i
> do not know. so i am concerned if i trade reusage for performance. is
> it better to write the few lines for pagination in every index-view
> (like created by bake) or write one element i call from there.
> the views created by bake include tables of related models. would it
> be better to requestAction index (with an aditional parameter
> containing the foreign key) from the related model? i think you can
> find dozens of situations like that.
>
> is there a limit like "not more than 5 requestActions and 3 elements
> per page" for best performance or should they be used all over to get
> best reusage of code?
>
> thank you in advance for your help!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to