My best reasoning for this is:
* easier to share code around, without resorting to plugins, or when plugins are inappropriate / overkill
* less hassle when developing / debugging - I think generally people work on a feature or bug across, say, the Users model, view and controller, much more than they work on multiple controllers or views in one sittin. You just spend less time scanning file lists jumping around directories!
* Over time, the controllers/models/views directories can become quite crowded
* easier to have libs / classes related to a module, rather than in a catch-all folder
* mitigates the issues with name clashes (i.e a Layout or Element controller can't have the same name as it's Views folder>)
* It's just conceptually closer to the separation of concerns - each folder now relates to a business concept, rather than a coding concept, my code related to users is all in one place, rather than littered around three different directories
* Encourages less coupled code - in theory these modules could almost be framework agnostic, whereas lumping files in /controller etc doesnt' encourage that way of thinking
* personal preference :)
I understand it might be a lot fo work to change Cake to support this, and whether that effort is justified is clearly arguable - but that's a different issue than whether the idea's got merit :)
On Thursday, 21 June 2012 02:21:45 UTC+1, rchavik wrote:
On Thursday, June 21, 2012 7:26:44 AM UTC+7, the_woodsman wrote:+1 for being able to configure Cake like this!
IMHO, there's something much more elegant in the dir structure:
/Users
/controllers
/models
/views
/Articles
/controllers,
etc!
There's practically no difference to sticking those under APP/Plugin/Users and APP/Plugin/Articles.Many other frameworks take this approach, and to me it seems easier to modularise your code - for example, if you wanted to share some code, but for whatever reason didn't want to use a plugin, you could just do an svn external (or export, or copy, etc etc) to get a nice working component.
I like the separation. I *know* that 3rd party files can always be found under APP/Plugin.
On Wednesday, 20 June 2012 15:37:13 UTC+1, André Luis wrote:Is there any way to use modules in CakePHP, it should work like
plugins, but i dont want to use plugins to create modules... it would
have it´s own Model, View and Controller folders inside...
Why not just use plugins then ?
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment