[ng-dhtml] directory structure

Dylan Schiemann mail at dylans.org
Thu Sep 16 18:09:58 CDT 2004

Ok, to summarize what I'm hearing so far:

- we pretty much agree on the general directory structure as proposed (that it is basically influenced by the package structure), and that classes are generally one per file, but not strictly enforced as this is often overkill.... and that a better way to do this may be to group closely related classes that are not separable into a single file.
- that we will be relying on our build tools and packaging to group files more intelligently and for better performance, but that we should not be forced to use a build tool as a requirement to get a working version of the toolkit, only as a way to optimize it, and that bootstrapping and other dynamic loading mechanisms such as that used in burst can make this even more flexible.

More thoughts?

By the way, an interesting issue for discussion came up today... print rendering for selected portions of dynamically generated components.  More on that can of worms later...

---- Original Message ----
To: "discussion on the future of DHTML" <NG-DHTML at netwindows.org>
From: "Mark D. Anderson" <mda at discerning.com>
Date: Thu, 16 Sep 2004 16:08:46 -0700
Subject: Re: [ng-dhtml] directory structure

> > perhaps the loader/importer gets generated at build time so that
> > it knows which classes are where, e.g.:
> >
> > import('foo.bar.baz');
> >
> > imports /src/foo/bar/baz.js at dev time and /src/foo_lib.js at
> > production time.

The bootstrap code i checked into the defunct repository offered
to work up the directory tree looking for packaged js files.
Since anyone who really cares about performance won't usually
be doing dynamic loading anyway (just putting script elements
in the head), I figure this is ok.
Here is a source excerpt....

* loadModule("A.B") first checks to see if symbol A.B is defined.
* If it is, it is simply returned (nothing to do).
* If it is not defined, it will look for "A/B.js" in the script root
directory, followed
* by "A.js".
* It throws if it cannot find a file to load, or if the symbol A.B is
not defined after loading.
* It returns the object A.B.
* This does nothing about importing symbols into the current package.
* It is presumed that the caller will take care of that. For example, to
* all symbols:
*    with (dojo.hostenv.loadModule("A.B")) {
*       ...
*    }
* And to import just the leaf symbol:
*    var B = dojo.hostenv.loadModule("A.B");
*    ...
* dj_load is an alias for dojo.hostenv.loadModule
dojo.hostenv.loadModule = function(modulename, exact_only) {


NG-DHTML mailing list
NG-DHTML at netwindows.org

More information about the NG-DHTML mailing list