Re: [Zope3-dev] Re: 'layer' vs. 'type'

2006-09-18 Thread Gustavo Niemeyer
 I wasn't sure about the layer to type renaming myself. Plus, it
 would've been one of those janitorial changes that just weren't
 worth it.  That's why I didn't do it.

It looks like the process has already started.  Should things
like these be reverted then (zope.app.component.metadirectives):


  class IBasicResourceInformation(zope.interface.Interface):
  
  Basic information for resources
  

(...)
 
type = zope.configuration.fields.GlobalInterface(
title=_(Request type),
required=True
)

  (...)

  class IResourceDirective(IBasicComponentInformation,
   IBasicResourceInformation):
  Register a resource
  
  # BBB 2006/02/18, to be removed after 12 months
  layer = LayerField(
  title=_(The layer the resource is in.  This argument has been 
  deprecated and will be removed in Zope 3.5.  Use the 
  'type' argument instead.),
  required=False,
  )

  (...)

  class IBasicViewInformation(zope.interface.Interface):
  This is the basic information for all views.

(...)

# BBB 2006/02/18, to be removed after 12 months
layer = LayerField(
title=_(The layer the view is in.),
description=_(
*BBB: DEPRECATED*

A skin is composed of layers. It is common to put skin
specific views in a layer named after the skin. If the 'layer'
attribute is not supplied, it defaults to 'default'.),
required=False,
)


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



[Zope3-dev] Re: 'layer' vs. 'type'

2006-09-16 Thread Philipp von Weitershausen

Gustavo Niemeyer wrote:

Hello everyone,

I was just implementing a ZCML statement for a view-related
component which should also take in consideration request
interfaces for adaptation.

After reading the SimplifySkinning proposal form Philipp, I'm
somewhat unsure about how to define the request type in the ZCML
directive in a way similar to what developers would expect in
standard directives.

I've seen in the code base and also in Philipp's proposal that the
renaming of 'layer' to 'type' isn't complete yet, so I'd like to
ask: does it really make sense?

Consider something like the following:

  browser:something type=.ISomeInterface /

I read this as the type of something is ISomeInterface rather
than something is used with ISomeInterface requests.

Let's take a more concrete example: IMenuItemsDirective. It's one of
the many directives with a 'layer' field.  If renamed to 'type',
wouldn't that clash with the concept of MenuItemTypes?

With this in mind I propose to either keep this argument as 'layer',
or use a term that better represent the relation with request types,
answering the question type of what?.

What do you think?


I wasn't sure about the layer to type renaming myself. Plus, it would've 
been one of those janitorial changes that just weren't worth it. 
That's why I didn't do it.


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