2009年12月5日星期六

Re: [fw-mvc] Zend Framework modularity and application structure

I'm using modules as sub-applications.

I have app/configs/application.ini which is a global config file for all apps.

I have sub-app directories like app/cli, app/www, app/admin, app/webservice.  Each one of these is tied to a sub.domain.name.

Each sub-app has configs, controllers, views, public_html directories.  Each sub-app also has its own Bootstrap.php which will merge the sub-app and master config. 

The config file for each app (app/admin/configs/application.ini) sets resources.frontController.defaultModule to itself (admin).  It will also add controller directories (app/admin/controllers & app/share/controllers).  This 'share' sub-app allows me to reuse controllers or view helpers with multiple sub-apps.

I have a library directory (lib/Corp) on the include path with autoloading enabled.  This is where I place my models, forms, validators and application resources. 

Michael DePetrillo
theman@michaeldepetrillo.com
Mobile: (858) 761-1605
www.michaeldepetrillo.com


On Sat, Dec 5, 2009 at 8:11 AM, Juozas <juozas@juokaz.com> wrote:
Hello everyone,

as you know, Zend Framework 2.0 is having a major rewrite in some parts and a lot things can be arranged to make development easier/more flexible/etc.

After discussing this with Matthew, I'm asking you to:

Write in short, how do you use Zend Framework

What interests us is how you work with modules (blog, products, news, users), how you divide your applications in to parts (admin, public, something else) and how other parts of code (acl, configuration, resources) comes into play here. 

The reason why I'm asking this, is because I'm using Zend Framework for quote big applications and for me it's important to have ability to create application with self-contained modules and sub-applications. For example I have e-commerce products having admin, public and supplier sub-applications, but everything is still nicely divided into modules (products, warehouse, orders, customers etc.) and App_Application and FrontController plugins does some work to make one application code to be divided in these parts. 

However, I know that some people use applications completely based on acl - there is one site and only depending on what your permissions are, you see data, can edit or delete if you want to. Here again somewhat different structure comes into play. Also quite popular thing to do is to have admin/default modules. Even though I completely don't understand this approach, some people like it and use everyday, hence it should also be possible to use. 

So please write what you think about such things, I will try to read them all, generalize into a comparison table and make it into a proposal of what functions from core are needed to support it (without any hacking, which I done quite a lot)

--
Juozas Kaziukėnas (juozas@juokaz.com)
Aš internete - JuoKaz (http://www.juokaz.com)

没有评论: