Hi Pádraic Brady,

Thansk for improving the documentation about how to proper implement an
abstraction layer between Data Acess and the Application, i myself was
looking like crazy for something like this, because im starting to develop
an application and was designing its architecture, normally in ZF you see
just View > Controller > DBTable, but now the updated the QuickStart
tutorial showing the use of a proper Model and a Mapper, but that do not
really show how it is used with ZF, and what you lose when you implement
yourself this abstraction and the constraints you will have with the
Framework.

I hope soon, if it is a better design approach, like i think it is, the ZF
will get this as it default architecture.


Cheers,

::: Diego Potapczuk



On Fri, Aug 21, 2009 at 8:40 AM, Pádraic Brady <[email protected]>wrote:

> Hi Koen,
>
> I just published a chapter on implementing the Model you may want to look
> into to see how it fits. The book is free to read ;).
>
> http://www.survivethedeepend.com/zendframeworkbook/en/1.0/implementing.the.domain.model.entries.and.authors
>
> I think the main point I think is that you are thinking in terms of the
> database. Why use a join? You can use two distinct SQL queries and then
> aggregate these as objects. In the book, I used a simple example of blog
> entries needing authors - so the entry object contains an author object.
>
> Joins are great, no mistake, but they are also premature optimisation. You
> can offset the cost of two queries using caching and lazy loading to avoid
> database access in the first place.
>
> Hope this helps!
>
> Pádraic Brady
>
> http://blog.astrumfutura.com
> http://www.survivethedeepend.com
> OpenID Europe Foundation Irish Representative<http://www.openideurope.eu/>
>
>
> ------------------------------
> *From:* Koen <[email protected]>
> *To:* [email protected]
> *Sent:* Friday, August 21, 2009 11:36:35 AM
> *Subject:* [fw-general] Question regarding models
>
> I've been looking at the new Quick Start in the ZF manual, particularly the
> model part. For a new project I'm trying to create my models in the same way
> (including a data mapper, etc).
>
> Unfortunately I don't know how to handle the relationships. When requesting
> data from your model you often want to include some fields in related tables
> (using joins), but I don't see a way doing that using the pattern as
> described in the quick start guide. Can someone give me some tips regarding
> this?
>
> Thanks in advance!
>

Reply via email to