[z3-five] Restructuring
Philipp von Weitershausen
philipp at weitershausen.de
Tue Apr 19 13:48:31 MEST 2005
Martijn Faassen wrote:
> Philipp von Weitershausen wrote:
>
>> Lennart Regebro wrote:
>>
>>> I'm extremely OK with it, as i have long found the current structure a
>>> hindrance.
>>
>> I'm glad to see I'm not the only one... When we started Five we
>> explicitly avoided structure so it wouldn't get in our way. I think we
>> have the opposite case now, non-structure is getting in our way.
>
> I disagree that we are dealing with a non-structure. So far I've seen
> proposals to turn modules into packages, basically, but what's the use
> of that except to add air?
>
> Examples, please? How is the current structure of modules in a package
> getting into our way?
Because we end up with either huge modules (e.g. Five.browser and
Five.browserconfigure) or, in case we decide to move them out to just
modules, we end up with a polluted namespace in which we have
browser
browserconfigure
form
formconfigure
formmacros
skinmacros
Not to mention all the ZPT templates that are by now floating around the
Five package. It's hard to find the code you're looking for, it's easy
to misspell, even when I'm opening files in my editor. Also, without at
least some enforced structure, I see that code gets added to modules it
doesn't really belong in or entries in the one and big configure.zcml
file are shuffled in ways that make them hard to read.
The idea is not to introduce many single-file packages. Au contraire, I
only want to flesh big chunks, which are, as I've now done yesterday in
a quick gheddon:
- browser (this includes the whole browser configuration story, the
absolute_url views, the custom PageTemplate implementation).
- form (this includes form views, form configuration and the templates)
- skin (this includes the standard macros view, the standard template
[five_template] etc.)
Note that the latter IMO already have enough code to be factored out in
a package, especially because they have at least one accompanying
template. So grouping those in packages makes sense.
But even aside their current status, these two packages will evidently
grow, as Five's form support is growing and we're slowly but surely
figuring out how to deal with the skinning issues.
So, at least a minimal structure will also scale a lot better for Five's
growth in lines of code.
> > I don't think we should mimic the whole zope.app hierarchy, the
> > differences and needs of Five are just too great. But now that you've
> > suggested it, I *am* strongly considering Five.form! :)
>
> If we can indeed figure out what should belong in it, why don't we make
> a module out of this?
Because the form machinery also has templates that are now floating free
in the Five package.
> I'm not against module restructuring, just really
> wary of introducing new packages. I don't believe Five is big or
> decoupled enough to warrant packages.
Aside the issue if packages always need the warrant of decoupling, I
think Five *is* decoupled enough. You could leave Five.form out of the
whole story and you could still use views, adapters, utilities, etc. You
could even leave Five.browser out if all you want is z3 interfaces,
adapters, and utilities and security declarations through zcml...
If you could, please take a look at my branch,
http://codespeak.net/svn/z3/Five/branch/philikon-restructuring/. Having
slept over the small gheddon and looking at it now, I don't feel it
needs any more structure, but I sure wouldn't want to miss what it has
now. Three subpackages isn't that bad!
Philipp
More information about the z3-five
mailing list