Re: [Zope3-dev] Last chance to comment on Simplify skinning

2006-02-16 Thread Benji York

Gary Poster wrote:
What if we still deprecated browser:layer but  
kept a redefined version of browser:skin?  Then your zcml--


  interface
  interface=.interfaces.ShanghaiSkin
  type=zope.publisher.interfaces.browser.IBrowserSkinType
  /

  utility
  component=.interfaces.ShanghaiSkin
  provides=zope.publisher.interfaces.browser.IBrowserSkinType
  name=ShanghaiSkin
  /

could become

 browser:skin component=.interfaces.ShanghaiSkin  
name=ShanghaiSkin /


Even though it's longer, I still like the interface/utility version.  I 
think it really helps the developer understand what's going on and that 
it's not magic.  The decreased brevity is of secondary concern to me.


More brainstorming: perhaps if there was a way to define ZCML in terms 
of other ZCML we could have the best of both worlds.  If someone saw the 
shorter version in a config file and didn't know what it did, they could 
go look up another file with the definition of browser:skin in terms 
of interface and utility they could say aha! I see how it works and 
then continue using the shorter version.


I know you can do that now by looking up the Python code that implements 
browser:skin, but it seems too indirect to me.

--
Benji York
Senior Software Engineer
Zope Corporation
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Last chance to comment on Simplify skinning

2006-02-16 Thread Philipp von Weitershausen
Gary Poster wrote:
 On Feb 16, 2006, at 12:09 AM, Philipp von Weitershausen wrote:
 [...interface... change counter-counter-proposal...]
 
 I think that's a very nice improvement over the previous spellings.   I
 had to review the zope.app.component.interface.provideInterface  code,
 but yes, it looks like that would be a simple change that does  what we
 need, and it looks like downstream code should already be  able to
 handle arbitrary names (i.e., not based on the interface's  fully
 qualified name).  Very cool!
 
 +1 on the proposal, with this change.  (+0 without it, as I said last 
 night.)

Cool. I'll adjust the proposal tomorrow. I wonder if Benji would be ok
with it, given he objected browser:skin...

Philipp
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Last chance to comment on Simplify skinning

2006-02-16 Thread Gary Poster


On Feb 16, 2006, at 10:52 AM, Benji York wrote:
One downside to the expanded interface directive is that it hides  
the fact that a utility is also being created.  I actually prefer  
the browser:skin version because it totally hides the underlying  
atomic operations, but the interface-also-registers-a-utility  
version conflates two atomic operations.


That's what it does now.  All Philipp's revised proposal does is have  
zcml expose the 'id' attribute in  
zope.app.component.interface.provideInterface.  AFAICT there are no  
other necessary changes to do what he suggested (for this part of the  
story).


Gary
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Last chance to comment on Simplify skinning

2006-02-16 Thread Benji York

Gary Poster wrote:


On Feb 16, 2006, at 10:52 AM, Benji York wrote:

One downside to the expanded interface directive is that it hides  the 
fact that a utility is also being created.  I actually prefer  the 
browser:skin version because it totally hides the underlying  atomic 
operations, but the interface-also-registers-a-utility  version 
conflates two atomic operations.



That's what it does now.  All Philipp's revised proposal does is have  
zcml expose the 'id' attribute in  
zope.app.component.interface.provideInterface.  AFAICT there are no  
other necessary changes to do what he suggested (for this part of the  
story).


In that case a +0 from me.  I still have some (possibly purely 
aesthetic) desire to define a small set of basic building blocks and 
define (mostly) everything else with them.

--
Benji York
Senior Software Engineer
Zope Corporation
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Last chance to comment on Simplify skinning

2006-02-16 Thread Philipp von Weitershausen
Benji York wrote:
  One downside to the expanded interface directive is that it hides  the
  fact that a utility is also being created.  I actually prefer  the
  browser:skin version because it totally hides the underlying  atomic
  operations, but the interface-also-registers-a-utility  version
  conflates two atomic operations.
 
 
  That's what it does now.  All Philipp's revised proposal does is have
  zcml expose the 'id' attribute in
  zope.app.component.interface.provideInterface.  AFAICT there are no
  other necessary changes to do what he suggested (for this part of the
  story).

 In that case a +0 from me.  I still have some (possibly purely
 aesthetic) desire to define a small set of basic building blocks and
 define (mostly) everything else with them.

I'm the same way. My suggestion was merely a compromise to make the necessary
ZCML not double or triple in length after in this proposal. The good news is
that the 'complicated' way of first making the interface a skin and then
registering it under the skin name will still work. It's just longer (and, as
a side effect, registers the interface twice, once under its dotted name and
once under its skin name).

I updated the proposal (http://dev.zope.org/Zope3/SimplifySkinning) to mention
the shortcut.

Given that there don't seem to be other objections, I will start implementing
the proposal this weekend. Thanks for all your input!

Philipp



This message was sent using IMP, the Internet Messaging Program.
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Last chance to comment on Simplify skinning

2006-02-15 Thread Gary Poster


On Feb 15, 2006, at 6:03 AM, Philipp von Weitershausen wrote:


Hi there,

a while back I wrote a proposal on simplifying the skinning system
(http://dev.zope.org/Zope3/SimplifySkinning). I got a lot of useful
feedback which in turn made me update the proposal. Since then I  
haven't

heard much comments. I would like to start implementing it soon,
especially since the time schedule has been moved up one month. Please
speak up now if you got any remaining comments.

Silence is assent :).


I guess I'm +0 on your current proposal, and +1 on its goals.

I like many parts of it.  I didn't like the fact that the zcml ended  
up being longer.  I didn't love that people had to start asking  
questions about interface types in order to register a skin.   
Interface types are a cost--another layer of abstraction, another  
potentially mind-blowing thing to explain.


You are already suggesting changing the zcml, and I'd like to see a  
compromise between the brevity of the current zcml and the conceptual  
clarity of your proposed changes.


I tried to brainstorm, but didn't love what I came up with.  Maybe it  
can take us somewhere.  What if we still deprecated browser:layer but  
kept a redefined version of browser:skin?  Then your zcml--


  interface
  interface=.interfaces.ShanghaiSkin
  type=zope.publisher.interfaces.browser.IBrowserSkinType
  /

  utility
  component=.interfaces.ShanghaiSkin
  provides=zope.publisher.interfaces.browser.IBrowserSkinType
  name=ShanghaiSkin
  /

could become

 browser:skin component=.interfaces.ShanghaiSkin  
name=ShanghaiSkin /


The rest of your example would remain the same.

It doesn't accomplish everything you set out to do, and that's a  
shame, but it feels like a compromise with a reasonable counter- 
argument: defining skins is a basic task often introduced early on  
with teaching Zope, and it's a shame to have to bloat the zcml and  
teach advanced topics too soon.


I'd like to at least get the interface... zcml out of this story.

Gary


___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Last chance to comment on Simplify skinning

2006-02-15 Thread Philipp von Weitershausen
Hey Gary,

thanks for your feedback.

 I like many parts of it.  I didn't like the fact that the zcml ended
 up being longer.

Me neither :(.

 I didn't love that people had to start asking
 questions about interface types in order to register a skin.
 Interface types are a cost--another layer of abstraction, another
 potentially mind-blowing thing to explain.

Perhaps, perhaps not. I think the interface ZCML directive would be easy to
understand by itself (Aha, so we register an interface. And we give it a
type, like, what kind of interface it is.), but I'm totally biased.

 You are already suggesting changing the zcml, and I'd like to see a
 compromise between the brevity of the current zcml and the conceptual
 clarity of your proposed changes.

 I tried to brainstorm, but didn't love what I came up with.  Maybe it
 can take us somewhere.  What if we still deprecated browser:layer but
 kept a redefined version of browser:skin?  Then your zcml--

interface
interface=.interfaces.ShanghaiSkin
type=zope.publisher.interfaces.browser.IBrowserSkinType
/

utility
component=.interfaces.ShanghaiSkin
provides=zope.publisher.interfaces.browser.IBrowserSkinType
name=ShanghaiSkin
/

 could become

   browser:skin component=.interfaces.ShanghaiSkin
 name=ShanghaiSkin /

 The rest of your example would remain the same.

As you can imagine I'm a bit hesitant about having too many specialized ZCML
directives like browser:skin. But I definitely see your point. I have the
following compromise to suggest. The 'interface' directive is used for two
things:

* Registering an interface as a utility. For that it will use the dotted name
of the interface.

* Optionally putting a type on an interface.

My suggestion is to add an optional 'name' parameter to it so that the
interface won't necessarily have to registere using its dotted name. Then we
can merge the 'interface' directive and the 'utility' directive from above
into one. It will basically have the same affect as your suggested
browser:skin directive and is only longer by the 'type' argument.

interface
interface=.interfaces.ShanghaiSkin
type=zope.publisher.interfaces.browser.IBrowserSkinType
name=ShanghaiSkin
/

Other usecases I see for the extra 'name' argument: Content Types. For example:

   interface
   interface=worldcookery.interfaces.IRecipe
   type=zope.app.content.interfaces.IContentType
   name=WorldCookery Recipe
   /

So, this would be a very generic way of giving interfaces a type and name.
Generic means that it'd be used throughout Zope extensions and would therefore
provide a lot of consistency.

 It doesn't accomplish everything you set out to do, and that's a
 shame, but it feels like a compromise with a reasonable counter-
 argument: defining skins is a basic task often introduced early on
 with teaching Zope, and it's a shame to have to bloat the zcml and
 teach advanced topics too soon.

 I'd like to at least get the interface... zcml out of this story.

I know my compromise does everything except that :). I think it's still better
to keep consistency in the ZCML directives than having nicely sounding
directives whose way of working isn't really explained just by their names.

Philipp



This message was sent using IMP, the Internet Messaging Program.
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com