Page 1 of 1

Grouped modules by name or by type???

Posted: Thu Mar 15, 2007 6:21 am
by alex.barylski
Assume you have a application compoed of several pages, each page consists of several components or entities (language files, images, templates, etc)

Do you store those files grouped by module/page name

Code: Select all

aboutus/
 - aboutus.tpl
 - aboutus.gif
 - aboutus.ini
 - aboutus.lng
Or do you organize the files into directories which reflect their purpose:

Code: Select all

langs/
 - aboutus.lng
 - someother.lng

templates/
 - aboutus.tpl
 - someother.tpl
Personally I go with the latter, although I am considering going with the former which would allow easy automation using convention - although I dislike the idea of implicitness it is nice once you work with it for a while.

Likely a subjective choice, but i'm curious why you would choose one over the other, naming both advantages/disadvantages would be ideal :)

Posted: Thu Mar 15, 2007 8:04 am
by xinnex
Excellent question, and very similar to the ones I've been asking recently.

So far, this seems like the best solution for me (subject to changes of course):

Code: Select all

application/
- aboutus/
-- controllers/
-- templates/
-- lang/

- gallery/
-- controllers/
-- templates/
-- models/
-- lang/
As you can see a module like about us or gallery is a "full package" with everything needed for this specific module.
The only thing really needed by the existing system (through a frontcontroller-pattern) is the controllers in each module.

To put it short, I store files by module and then purpose.

Posted: Thu Mar 15, 2007 10:07 am
by Jenk
Types for me.

Code: Select all

/www
-/lib
-/app
-/views

Posted: Thu Mar 15, 2007 1:47 pm
by Xoligy
The latter for me. I find it easier since using the former means you're going off the extension when clicking which isn't as obvious to me.