[Cubicweb] About CubicWeb >= 3.7 (potential) refactorings
aurelien.campeas at logilab.fr
Fri Feb 12 15:35:26 CET 2010
Le vendredi 12 février 2010 à 15:17 +0100, Sylvain Thénault a écrit :
> 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
but isnt this _already_ a business of interfaces ?
> > 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
but I fear a bit that 'adapter' carries a conceptual baggage that is
still unclear to me
> > > 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.
... (I do not understand this function vs classes thing)
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
there are potential goodies associated with them, but I do not want to
scare anyone there ... (and I have no working implementation for these)
More information about the Cubicweb