Wednesday, April 1, 2009

Re: Exporting large Objects to "static objects"

Marcus:

How do the users consume/utilize the categories? Are they presented
with a drop down menu from which they can select categories? How does
the user sees the category?

Assuming the user is presented with for example a combo box or
something along those lines from which they can select, you should be
able to simply do a find as you previously stated. The query to the
database unless you have millions of categories shouldn't be too
expensive.

I am thinking though, you re-use these categories through out your UI
and you don't want to have to go back every time to get them again.
The query of course in the backend could be cached. However for these
cases I tend to load up a JS object and keep the data structure on the
Client Side and simply retrieve it when I need it.

Hope that helps.

Regards,

Alfredo

On Wed, Apr 1, 2009 at 7:18 AM, artoros <marcus.strasser@googlemail.com> wrote:
>
> Hi!!
> Sorry, I don't know a proper subject for my problem.
>
> So here is an example: In my website I have categories. These
> categories are managed by the administrator and then used inside the
> "frontend" for the normal user. The user can not change these
> categories.
>
> Now I have a lot of categories and therefore I thought, that it is
> unnecessary, that every user performs a complete "find("all")" to get
> all the categories, because they stay the same, as long as the
> administrator does not changes them (and that does not happen very
> often).
>
> So I thought about a "exporting" the whole object with all the
> categories in it.
>
> Right now I am doing this: When the administrator changes a category I
> perform a "find("all")"  and then serialize the result and put the
> resulting string in a PHP file, that I can then include inside the
> user pages.
>
> So the user does not have to find the categories in the database, but
> only "unserializes" the string in that exported PHP file.
>
> Well, nice idea, I thought, but then I had to find out, that it takes
> actually a long to time to unserialze that huge string.
>
> Does anyone has an idea, how to "export" large objects with a lot of
> entries, so that a user can use these entries without accessing the
> database?
>
> Eh, does anyone understand, what I mean?
> Do I? :-)
>
> Greetings!
> Marcus
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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: