[Cubicweb] moving and renaming vreg & co

aurélien campéas aurelien.campeas at gmail.com
Thu Sep 15 16:33:46 CEST 2011


2011/9/15 Adrien Di Mascio <adrien.dimascio at logilab.fr>

> Hi,
> On 15/09/2011 13:27, Sylvain Thénault wrote:
>> After discussing a bit over the phone with Nico, it occured that the
>> almost established vocabulary have a problem: in the literature,
>> dispatching is about choosing a function or method according to given
>> arguments, then to call it with those arguments. In our case, we don't
>> do that, but rather pick the most appropriate object according to a
>> context, which is then returned to the caller. This is slightly different,
>> and we're afraid that if the 'dispatch' term is closer to what we
>> achieve here, it may also give a wrong feeling on what it does (though
>> technically speaking, once an object is selected, it's called with
>> the context as argument, but this is usually a class instanciation).
>> Any thoughs on this?
I see this difference as irrelevant because in practice the returned
object's main entry point (method) is called right away (in other words and
imho cubicweb's appobjects + selectors are actually predicate-based generic
functions in disguise).

Of course we already had a long discussion on this very topic and could not
come to an agreement. Some people (notably Sylvain) insist on the separate
object selection (encompassing instantiation) and subsequent usage
thereafter as something that bears a specific value (I'm trying not to put
the wrong words in other people's mouth, please correct me if this is
wrong); whereas I see this as an excess implementation detail creeping over
the underlying predicate dispatch + generic function notion.

also relevant (which stirred the internal discussion) :

> I tend to agree. I still think that the "predicate"-based vocabulary is the
> best because what we do in CubicWeb is predicate-dispatching.
> The problem might be that we acutally lack a formal dispatcher: what we
> have is an implementation (*) chooser.

I do not understand this. Can you explain ?

> (*) Maybe "Implementation" could be an appropriate base class name instead
> of AppObject or even Selectable ?
> --
> Adrien Di Mascio - LOGILAB, Paris (France).
> Tél:
> Formations - http://www.logilab.fr/**formations<http://www.logilab.fr/formations>
> Développements - http://www.logilab.fr/services
> Gestion de connaissances - http://www.cubicweb.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubicweb.org/pipermail/cubicweb/attachments/20110915/ef950373/attachment-0186.html>

More information about the Cubicweb mailing list