2010年3月29日星期一

[fw-mvc] Where do your Models Live (in a modular application)?

I know this has been discussed a couple of times but maybe not quite in this
aspect. Where do your models live in a modular application?

Assumptions for discussion:
Modules: default, blog, and admin.
Namespace: App_ (horrible, but makes it easier to follow)

For models that will span responsibilities in all of the modules (ex.
Users), do they live in the App namespace or in the Default namespace
(namespace may be used incorrectly in this case)?
App_Model_User => /application/models/User.php
Default_Model_User => /application/modules/default/models/User.php

Additionally, what about models specific to a module (ex. BlogPost)? Should
they "live" in the blog module or does all of the models live in the
Application namespace and the modules just access what they need when
appropriate?

I start to get my head wrapped around some concepts then I end up having
"basic" questions that end up throwing me for a loop. Then again, this
could be another one of those "whatever works for you" scenarios as well...

Sidebar discussion: I would think that this answer [c|w]ould apply to
service classes as well, but please correct me if I'm wrong.
--
View this message in context: http://n4.nabble.com/Where-do-your-Models-Live-in-a-modular-application-tp1712456p1712456.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: