[Cubicweb] About CubicWeb >= 3.7 (potential) refactorings

Sylvain Thénault sylvain.thenault at logilab.fr
Fri Feb 12 15:46:32 CET 2010

On 12 février 15:35, Aurélien Campeas wrote:
> > > I don't get it.
> >  
> > why ? Folder, File and all entity types define an implicit interface
> > (the one specified in the schema). All I'm talking about is moving
> > business logic, eg services provided by interfaces, into separated
> > classes.
> but isnt this _already_ a business of interfaces ?
Somewhat, but that's not the same class which hold the implementation.
Currently, it's the entity class. I propose to move it out in an 'adapter'
class (in the sense that it turns the entity class into something that 
implements an interface). I'm not keen on working at the function level
to do so.
> > > That was a reflexion on the fact that the vregistry/select already is a
> > > kind of generic function implementation (with score-based dispatch), and
> > > that it could somehow be extended to host entities related functionality
> > > (possibly with a mro-style dispatch).
> >  
> > yup. We could have a new registry to do so. Let's call the classes we'll
> > find inside 'adapters' :)
> if you like the term ... at least I do not want the discussion to be
> about how we call/name things

cool :)

> but I fear a bit that 'adapter' carries a conceptual baggage that is
> still unclear to me
in my mind, nothing more than what I explained above that could be resumed
in : class -[adapter]-> interface.

> all this being said, I suspect generic functions offer a fraction of
> what ZCA provides and there is certainly some overlap, but at this point
> in the state of requirements (fix namespaces problems) I feel like they
> could be a nice & scalable solution to it, without us dragging the whole
> ZCA lib

notice *I don't want to dragg all the zca lib*. I want the 'adapters' concept.
I talk about ZCA because they introduced it (to me at least) and this is the
reference python library to use them. That's it. You know I won't insist
to add a new dependancy. Once we agree to move forward with adapters,
we'll see if there are valuable things in zca (I know there is for instance
much more powerful interfaces that what we have. But do we need that...) or
if we prefer a home-grown solution, keeping only the concept.

> there are potential goodies associated with them, but I do not want to
> scare anyone there ... (and I have no working implementation for these)

IMO, telling "we're using ZCA" may scare as many people as people who'll
be attracted by it. Zope is still a major framework in the python-web
sphere and a lot of people knows (somewhat) about it. 

Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org

More information about the Cubicweb mailing list