Re: Schema provider/CA lookup status

whit <[email protected]> Tue, 01 Aug 2006 10:18:16 -0500
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Message-ID <[email protected]>
Raphael Ritz wrote:
> Martin Aspeli schrieb:
>> whit wrote:
>>
>>
> 
> Hi Martin, Whit and others,
> 
> sorry for skipping in with what may be a no-brainer.
> I didn't realy follow the thread entirely neither
> did I look in detail at Martin's code in 'company'.
> 
> So, this is just a question in passing:
> 
> Is what you are discussing here covering the following
> usecase?
> 
> "support arbitrary many (independent?) schema extenders"
> 
> What I mean by that is the following: people can install
> unforeseen combinations of 3rd-party add-on products which
> each in turn might want to change or extend a type's schema.
> If they are independent that should cause no problem, but:
> What if there is a conflict (e.g., two different products -
> not knowing of each other - are trying to change or add a
> field with the same name/id but intend to use this field for
> completely different purposes)? (real world example: quite a
> number of products (could want to) mess with the 'Subject'
> field.)
> 
> How would that be detected?
> What would happen?
> Are you addressing this at all?
> 
> Just a thought ...
> 

well, that would be a happy problem ;)

the situation is preferable to monkeypatching or inheritance. from the 
hip, I'm guessing this would start off as the responsibility of the 
developer using extension.  zope configuration mechanism does do 
conflict management, so hypothetically you would only be able to 
register one extender per interface without needing to whip up something 
more complex.

One could form a hiearachy of extension:

ISchema
   ISchemaExtenderI
     ISchemaExtenderII
        ISchemaExtenderII

that matches to the following interfaces

implements(IBaseObject, IMyType, IMyExtendedType, ISlowOverExtendedType)

since adapter resolve from left to right, adding more extension is just 
the matter of overriding the last adapter and extending it(possibly with 
another interface).  Conflicts would be managed entirely by the zope 
configuration system. Adapter lookups are optimized but not free so 
eventually this could get slow.

I guess the question ends up being, "how do I know what the 
configuration is doing without reading all the zcml".  This is a general 
problem with zope3 that having some sort of config auditing tool would 
help solve.

-w



-- 

  | david "whit" morriss
  |
  | contact :: http://public.xdi.org/=whit

  "If you don't know where you are,
   you don't know anything at all"

   Dr. Edgar Spencer, Ph.D., 1995


  "I like to write code like
  other ppl like to tune their
  cars or 10kW hifi equipment..."

  Christian Heimes, 2004


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV