I like web2py more than django because it has everything django has,
but somehow I feel it was designed to contain those features from the
get-go. In django everything feels like it was an after-thought, and
the community feels extremely set in their ways to change anything.
One thing, thought, that I feel they got right in django was the
separation of projects into apps. I was just wondering why web2py
chose not to separate plugins more from the main application. I find
it extremely ugly to have my application files be polluted by plugin
files. I wish I could just easily blow-away my application without
blowing away all the plugins with it, or vice-versa. Basically, if my
plugin is more complicated than 1 file in each (model, controller,
view), and I if I have more than 3 plugins installed, my application
becomes a mess very quickly. This is especially a problem when you get
to large apps that are built from many small plugins for various
features...
Proposed directory structure:
- "Application name"
- Model
- View
- Controller
- Static, etc...
- Plugins
- "Plugin name"
- Model
- View
- Controller
- Static, etc...
Note, this can also be done without changing everything in the way
web2py does it right now, simply by including a symbolic link/shortcut
to the plugins folder in the top-level model, controller, view, and
static directories, to the plugins/plugin-name/model, view,
controller, static folders...
Proposed directory structure:
- "Application name"
- Model
- Shortcut to "Plugins" folder
- View
- Shortcut to "Plugins" folder
- Controller
- Shortcut to "Plugins" folder
- Static, etc...
- Shortcut to "Plugins" folder
- Plugins
- "Plugin name"
- Model
- View
- Controller
- Static, etc...
I find the Django model of Project -> apps a great organization
system...in web2py it would be App -> plugins.
In other words, have a folder in each project/application called
plugins, and in that folder have each plugin produce its own folder
containing everything necessary for that app (directory structure
would be identical to the main app/project directory structure)...in
essence, it would be an application within an application.
Also, note that I had thought about simply having plugins be apps at
the top level that can communicate with other apps, but that would not
work if I want to package my application up and distribute it.
Conclusion:
Was there any reason this was not the directory structure chosen?
Other than "We wanted to implement something quickly that is backwards
compatible and requires least additional coding". I just wonder if the
directory structure I propose could ever have enough support to be
accepted (even if it doesn't happen in the next release).
Thank you for the great framework!!