Op Wednesday 20 May 2009 17:58:58 schreef fire-eyed-boy:
> Jurian Sluiman wrote:
> > <snip>
> >
> > Hi,
> > I'd go for neither of these methods. Create models for Users, Videos and
> > Images and connect them together by using the relational features of
> > Db_Table.
> > Then call the getter for images only when required. You don't need to get
> > the
> > images at any time. Also, I suggest you cache the results so you don't
> > need to
> > pull the database every time. If a user changes his profile, delete the
> > cache
> > file and it's immediately updated in cache.
> > R, Jurian
>
> Hi Jurian,
>
> Thanks for the response.
>
> I like your proposal a lot. And actually I have thought about using
> Db_Table and some caching mechanisme for these purposes too. But to tell
> you the truth, I'm a bit apprehensive about how to exactly implement it.
> Especially because from the documentation I wasn't too sure how to
> implement the relationships for Db_Table for the MySql innoDB engine.
>
> The docs state:
>
> "Skip declaration of $_dependentTables if you use referential integrity
> constraints in the RDBMS server to implement cascading operations";
>
> But because of this statement, I'm a bit unsure of what I *do* need to
> define in order to fully profit form Db_Table's relationship management and
> profit from innoDB's cascading operations at the same time.
>
> So basically my next question is:
>
> How would I define relationships in Db_Table for innoDB tables without it
> conflicting with each other. If you, or somebody else could elaborate on
> this for me, I would much appreciate it.
>

You *need to* specify the table with $_dependentTables. But you *can* specify 
the types of relations. Then Zend can adopt these types and configuration. If 
you have already defined these types and actions in the database (e.g. with 
InnoDb), you should not use these declarations in Zend_Db_Table (and use just 
a single line for $dependentTables).
I think (but am not sure about it), because of the DESCRIBE statement of 
Zend_Db_Table, you might get the relations twice. One from the database (thus 
from DESCRIBE) and one hard coded into php.
Therefore, if you have a InnoDb engine, I suggest you use the database 
declaration and write down a single line for the $_dependentTables.

> Concerning cache: I absolutely need to dig in to this soon too, because I
> really want to start taking advantage of caching. I haven't found the time
> to dig into it yet though.
>
> One question about cache that immediately pops up in my mind though is:
>
> Zend_Cache docs speak of frontend and backend. What do these concepts refer
> to? Is this as straightforward as I think it is: frontend is where you
> cache stuff for your applications frontend and backend is where you cache
> stuff for your application backend? Or am I missing something vital here?
>
>
> Thanks in advance for any insights.
>
> Cheers

A caching backend is the storage of the cache: in a file, memcache or any 
other persistent storage. The frontend is the type of the "object" you want to 
cache. Most times Core is enough, but for specific caching you can use other 
frontends. E.g. function calls, classes or whole pages can be cached using 
different caching frontends.

Cheers, Jurian
--
Jurian Sluiman
Soflomo.com

Reply via email to