[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposal (for 1.4): change source tree layout


Hate to keep bringing up Drupal as a model, but I think they've got a great way of doing this, particularly if the goal is to encourage 3rd party development on top of a core.

Two key principles here: group everything necessary for a particular set of functionality together as a module, under a single directory; and provide a built-in override system that allows local changes to take precedence over core.

In Drupal, there are some core APIs in an "include/" directory, but much of the core functionality has been abstracted out into modules that can serve as examples for third parties to extend. When loading a module, Drupal has a well-defined search path:

1. sites/<domainname>/modules/
2. sites/all/modules/
3. modules/

... basically with this layout, you can share a bunch of modules in a single code base supporting multiple sites, but if you need to patch a module you simply create a copy and put it in a more specific path.

Themes/templates use the same approach, but a path ending in "themes/" instead of "modules/".

Drupal does rely on mod_rewrite to rewrite all paths to a single controller/dispatcher, so the filesystem path has little to do with the URL. It also has several layers of caching -- it only looks for new module/path handlers when its cache has been cleared, and then it scans the filesystem looking for possible paths and auto-populates its "menu_router" table based on what it finds.

I'm not sure what the demand is for multi-company hosting, but I definitely like having a built-in override system in place so you have an easy way to apply patches to core files -- without actually creating essentially a forked version. And having so many different places to touch functionality that all should go together -- yes, I'd love to see some cleanup.

I guess I'd suggest turning AR, AP, GL, etc into modules, and grouping the data objects, scripts, and default UI into a single directory related to that functionality.

I also think there should be a way to override the UI elements/templates in a single, company-specific location (similar to Drupal themes) so that it's easy to apply company branding, etc. without editing core files. I know templates are already like this -- I'd like to extend it to the application UI...

My thoughts, anyway -- I've worked with dozens of web applications, and Drupal's file layout is head and shoulders above the rest, worthy of emulation.

John Locke

On 07/03/2011 02:24 PM, Erik Huelsmann wrote:

Some months ago, I've mentioned this to Chris: I'd like to change the source tree layout. Currently our top level contains documentation, code and installation hints, all mixed in one directory. I'd like to "disentangle" that. I'd like to create a "src" or "ledgersmb" (or lsmb) subdirectory of trunk/; that directory should hold the scripts currently in the toplevel directory, as well as the subdirectories holding code, templates, etc. In other words: the entire application.

Other subdirectories won't be moved to that directory, such as doc/, tools/  and maybe others: those directories which are not strictly part of the application - tests could be stored either way, but probably should be at the top level, if that's technically an option.

What I'm trying to achieve it a less crowded toplevel directory which stores some general overview documents and other information *everybody* needs, but nothing else. That should help newbee users as well as developers get up and running quickly.


Oh. As for timing: I'd like to do it as soon as 1.3 branches for the 1.3.0 release.


------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________ Ledger-smb-devel mailing list ..hidden.. https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel