Re: Schema provider/CA lookup status
Martin Aspeli <[email protected]> Tue, 11 Jul 2006 08:48:28 +0100
| Newsgroups | gmane.comp.web.zope.plone.archetypes.devel |
|---|---|
| Message-ID | <[email protected]> |
whit wrote: > dear optilutefisk, :p > please refer to thread > > http://article.gmane.org/gmane.comp.web.zope.plone.archetypes.devel/5947/match=whitmo+schema+by+iface Yes, I recall (of course, at that point, my Z3 knowledge was way less, so stupid questions at that time excepted). However, that thread was about you describing the work you'd done and you, Rob and I talking about use cases and possibly more complex implementations. No-one else seemed to chime in, and there was no real understanding of when and how to carry this forward into a mergeable state. Do we agree on the design? Is it just a matter of fixing up failing tests (if any) and doing a merge? >> Hi guys, >> >> I know Whit worked on this a while ago, but I'm unsure what state the >> code is in. Basically, I have a use case now where I want to be able to >> supply (most of) the schema to a content object with a (local) utility >> so that third party products can plug in a schema without having to >> re-invent the rest of my infrastructure. >> > > trac indicates branch has not changed for 3 month(time of last posting) Indeed. >> How far away a goal is this? > > you have to write an adapter. side-effects are not fully explored. Right, that's the kind of information I was after. The larger issue, really, is whether we settled on this use of an adapt-base-object-to-ISchema being the "correct" way, whether anyone is spending more time on exploring these side-effects, and whether other people have plans to work on getting this into the core - and if other people than the three contributors to that thread are interested in these changes. > With the current adapter all the AT tests pass iirc(at least no failures > related to the changes to my knowledge). the schema by interface goal is > relatively done(trivial). so iirc is schemata return(giving a point for > inject behavior into the composition of a schema subset). > > hypothetically, any factory returning a schema properly wrapped should > work. The current implementation is an extreme example(I hot swap the > classes and wrap the result). A cleaner way would be using the > zope.interface.implementer and zope.component.adapter decorators and > making the factory a function that retrieves, wraps and returns a schema. > > As I recall, Whit made AT always use the >> Schema() method to access the schema, which means that I could override >> that and make it do the utility lookup. > > this is the default behavior of the AT API. Yeah - I thought (and looking at your branch I realise I may have been wrong) that there were cases where .schema was being accessed directly and that you fixed these. In that light, I was wondering whether they were bugs (which I'd contend they are). I thought this kind of clean-up work was another part of your branch, though I can't see that code in the checking diff, so I guess not. > I'm simply making BaseObject.Schema() use ISchema to return a schema: > > http://dev.plone.org/archetypes/browser/Archetypes/branches/whitmo-schema-by-iface/Schema > > now you would just register a new factory with ISchema that returns a > schema from the utility. or the module. or wherever. read link. read > code. should be clear in the relatively few lines of python. It is. What isn't clear (or wasn't clear to me at the time) is whether we are settling on this pattern. The use cases we discussed in the thread above included things like composing schema's from local utilities and adapters in more complex ways - and it wasn't clear whether we settled on this being necessary, and whether we'd want to build more direct support for such patterns into BaseObject (soas to use something more complex or a more complex default implementation of the ISchema adapter). >> However, I don't understand whether the changes he made were >> fundamental, or basically just bugfixes (isn't Schema() the >> recommended/proper way always anyway?). I need to be able to use this >> with Plone 2.5, and I'm willing to help test and fix this, if I know >> which direction to go in. > > get some sleep then read up. Sorry, see misconception above. Martin ------------------------------------------------------------------------- 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