Re: Schema provider/CA lookup status

whit <[email protected]> Mon, 31 Jul 2006 10:03:47 -0500
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Message-ID <[email protected]>
Martin Aspeli wrote:
> Martin Aspeli wrote:
>> whit wrote:
>>> Roché Compaan wrote:
>>>> On Fri, 2006-07-28 at 08:52 +0100, Martin Aspeli wrote:
>>>>> Roché Compaan wrote:
>>>>>
>>>>>> Lovely! Very nice and simple. I also like the name change from Variable
>>>>>> to Extensible.
>>>>> Bear in mind it's slightly different - it uses an adapter to 
>>>>> ISchemaExtender to extend the schema. This is meant to let third party 
>>>>> products plug in new schema elements. It doesn't really handle the case 
>>>>> when the schema is changed TTW, for example (which ATSENG does, though). 
>>>>> Still, if you want a different algorithm inside the Schema() method, it 
>>>>> should work the same.
>>>> I would probably just override the Schema() method on classes that need
>>>> ATSENG, or have a mix in class for schemas that need to be managed TTW.
>>> <cough>
>>>
>>> can we do this without mixins?
>> Yes, by merging the required functionality into AT's BaseObject - the 
>> mixin basically just overrides Schema() to put in some necessary calls 
>> to re-generate methods by ClassGen. The ClassGen extension could also be 
>> made reasonably easily to the base ClassGen again - all that's needed is 
>> to call generateMethods() with a custom schema instead of 'klass.schema'.
>>
>> I don't think the whitmo-schema-by-
> 
> sorry, premature send error :)
> 
> I don't think the whitmo-schema-by-interface branch will work for 
> anything where the schema isn't provided by a class attribute 
> ('klass.schema') unless these changes are merged in. On the other hand, 
> they are fairly trivial and if you agree with my implementation, it 
> should be ready already. 'company' will be a nice test case for it, too. :)
> 

cool...will we still be able to register a schema by interface? wouldn't 
the classgen stuff go inside the adapter function/class?

so if you didn't need the slight overhead, you could avoid it? or will 
all schema require this?

I need to look at the code but anything you could do in Schema() should 
be able to be done in an adapter.  hopefully Schema() will go away 
eventually...

-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