[Zope3-dev] Re: One namespace for ZCML

Roger Ineichen dev at projekt01.ch
Wed Feb 15 17:12:13 EST 2006


Hi Philipp

[...]
> Subject: Re: [Zope3-dev] Re: One namespace for ZCML
> 
> Roger Ineichen wrote:
> > I'm interessted in a menu / menu item refactoring.
> > 
> > This means, we could get rid of the implicit magicly 
> > registred menus in other directives which ends in
> > unaccessible menu items and will offer a better 
> > accessible API. I will write a proposal later, but perhaps
> > I have to prototype first since this part is very complex
> > and used almost in every browser directive.
> 
> Note that my other proposal, 
> ReducingTheAmountOfZCMLDirectives, mentions
> something like this in the end (it's not really part of the actual
> proposal anymore, just some random thoughts):
> 
> """
> Many directives of the browser namespace support the registration of
> menu items in addition to registering the component in 
> question. Though
> this can be considered useful because it might save some 
> typing, keeping
> directives as simple as possible (on/off switches!) might be weighed
> higher. People are certainly intimidated by the length of some of the
> browser directives (such as browser:editform); by taking the menu
> functionality out, we could reduce many directives by two lines making
> them easier to understand by themselves (of course, we'll have to add
> another menu directive, but it'll only be 3 or so lines).
> """

Yes, I agree, 
that's also a good base for a menu simplyfication.

> If you got any further comments on this, I'd be happy to hear them. It
> doesn't *have* to be a proposal, but it would sure be nice :).

I think it's to complex it right now since I'm not sure at all if
my idea will work. Let me try to give a short overview.

- Merge the menu and menu item to one implementation

- the above will also allow to implement nested menus.
  Right now the implicit menu, registred in views, don't
  have a id itself. This means they are unuseful for nested
  menu registrations. 

- move menu registration out of the view directives,
  (like described in your proposal)

- Also refactor the IFactory concept. Use IFactory adapters
  on folders instead of IFactory utilities.

The last part IFactory adapters instead of IFactory utilities
depends on a application I wrote and was running in serious 
problems because of the slowdown which depends on IFactory utilies 
lookups. I'm not sure if somebody will agree on this, but I think
if I can profile the IFactory utility implementation and show
the slowdown, we have a better base for a proposal.

This would also solve some namespace problems we have with
the content type name registration.

Note; nested menus are implemented since more then a half year.
But they are not useable with the existing menu items which are
registered inculded in the view directives. Because in the view
directive registred menus are only "menu items" which are not 
nested.

Regards
Roger Ineichen

> Philipp
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev at zope.org
> Unsub: 
> http://mail.zope.org/mailman/options/zope3-dev/dev%40projekt01.ch
> 
> 



More information about the Zope3-dev mailing list