Generally my models are flat and at the top level because of various types
of relationships that sometimes end up as loops. Consider the relationships
of a simple blog:

User > Blog > Comment > User

Usually I only create subfolders in my models folder when I need to add
strategy classes or other types of classes that help the main class:

models/Exam.php
models/Question.php
models/Question/ScoringStrategy/MultipleChoice.php
models/Question/ScoringStrategy/ConstructedResponse.php
models/Question/ScoringStrategy/Rubric.php

--
Hector


On Fri, Mar 5, 2010 at 2:09 AM, tonystamp <[email protected]> wrote:

>
> Hi, got a bit of a best practice question here.
>
> I have a vacancy model which represents jobs being advertised on the site.
> When a user applies to a vacancy an application model is created for each
> application to the job. Therefore a 1:M relationship between vacancies and
> applications.
>
> Should i represent this in my model directory structure, by having the
> application model and db files nested within the vacancy model directory?
> ie
>
> /application/models/vacancy/table.php
> /application/models/vacancy/row.php
> /application/models/vacancy/entity.php
> /application/models/vacancy/application/table.php
> /application/models/vacancy/application/row.php
> /application/models/vacancy/application/entity.php
>
>
> --
> View this message in context:
> http://n4.nabble.com/should-directory-structure-indicate-model-relationship-tp1579414p1579414.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>

Reply via email to