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

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


On 12 février 12:21, Aurélien Campeas wrote:
> Le jeudi 11 février 2010 à 17:29 +0100, Sylvain Thénault a écrit :
> > On 11 février 14:06, Aurélien Campeas wrote:
> > > Le jeudi 11 février 2010 à 13:39 +0100, Sylvain Thénault a écrit :
> > > > 
> > > > To make thinks clearer, when I talk about using ZCA, I'm talking about:
> > > > * more Interfaces
> > > > * adapters, able to turn an interface into another one
> > > 
> > > example of turning an interface into another one ?
> >  
> > in our case, turning Folder to ITree, File to IDownloadable.
> 
> 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.

> 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' :)
   
> > there *generic* but yet *functions* :) With adapters, you get the same benefits
> > but you can still use OOP things such as inheritance, nicer code organization
> > and so on.
> 
> generic functions are about using things such as inheritance and having
> nicer code organisation, too, so I don't get your point ...
 
So, why should we start working with function instead of classes??  
But code samples proposed below will help in judging this.

-- 
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