Hi Vince42

I am using the same structure for my project, I agree with your suggestion and makes sense to keep a separate folder for mapper files.

I reckon you can do it easily in your Bootstrap.php with something like

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {

   protected function _initAutoLoad() {
       $moduleLoader = new Zend_Application_Module_Autoloader(array(
           'namespace'=>'',
           'basePath'=>APPLICATION_PATH
       ));

$moduleLoader->addResourceType('mapper', 'models/mapper', 'Model_Mapper'); return $moduleLoader;
   }

}

It would make it easier to find mapper files.

I would wait for Matthew's comments.

Thanks

Ali



Vince42 wrote:
Hi,

I just wondered, which is the exact reason for naming / organizing the
three components for data abstraction like it is done in the quickstart.

While it seems perfectly clear that the model is named Guestbook, I find
it a little bit irritating that the Mapper / Gateway is named
accordingly and the DbTable has its own subdirectory.

I think we should either aim for a flat hierarchy like

   Guestbook.php
   GuestbookMapper.php
   GuestbookDbTable.php

or should spend the mappers a directory too - just so that on every
level only files of the same type are accessible ... something like

   Guestbook.php
   Mapper
   --- Guestbook.php
   DbTable
   --- Guestbook.php

I am aware of the fact that you can implement this according to your
personal likes, but I guess - taken into consideration that there's not
always a DbTable to extend - a more general naming convention could keep
irritation low ...

Just my two cents.


Reply via email to