Re: Schema provider/CA lookup status

Rob Miller <[email protected]> Fri, 14 Jul 2006 02:59:36 -0400
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Message-ID <[email protected]>
On Fri, 14 Jul 2006 03:07:45 +0100, Martin Aspeli wrote:

> Thus, I need to:
> 
>   - Use some base fields always
>   - Add (append?) some fields coming from an external component - Have
>   this component (adapter? utility?) be local, so that it only
> affects sites where it's been installed (this is important, since it's
> possibly difficult to have more than one such product installed, e.g.
> 'charity' and 'consultancy').

> Basically, as I understand it, Whit's branch basically lets you register
> an adapter that can provide you a full ISchema. That lets you override the
> schema for an existing type wholesale, without having to subclass and
> re-register that entire object. For the site-local case (which I think
> will apply to most well-behaved products), that would mean a local
> adapter.

is there such a thing as a local adapter?
 
> What I need is a bit more complex, since I need to have the fields from
> the base type *and* some extra fields. I think it may be possible to have
> some kind of general version of Whit's adapter that could be applied as an
> alternative in the case where you have the 'extension' use case. That is -
> the author of the original product probably knows best whether it's
> "extension" or "replacement" that matters.

how about just putting a marker interface on your objects so they can get
a different adapter that provides ISchema?  i see two ways to do this:

1. apply the marker interface to each object at the same time you
establish the reference to the 'charity' object, with your adapter
automatically invoking the original adapter and then appending extra
fields of its own

OR

2. apply the marker interface to the class, and have the adapter check to
see if a reference to a 'charity' object exists, serving the extended
schema if so, the core schema if not.

i'd lean towards #2, i think.

does this sound like it would work?  it certainly seems simpler than what
you've proposed.

-r




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642