[Cubicweb] Integrating CubicWeb views into Pyramid (long)

Nicolas Chauvat nicolas.chauvat at logilab.fr
Wed Aug 6 12:13:08 CEST 2014


On Wed, Aug 06, 2014 at 11:31:03AM +0200, Paul Everitt wrote:

> Surely, when putting the weight on a CubicWeb view, it is based on
> some policy in the information model. If not, then when would the
> lower-weighted view ever get used?

I do not have all the details loaded up in memory, but a first answer
that comes to mind is the following.

Let us assume you are building an application by assembling
components. For example, you include the cube blog and the cube
comment and you want to be able to comment your blog entries.
You will have to put in the registry a new primary view for blog
entries, that displays comments at the bottom.

It could be that the score returned by this new primary view will make
the primary view provided by the blog cube unselectable. If that is
not the case, you will have to unregister this primary view and
register the new one in its place.

In CubicWeb, the registry and its selection process is key to the
componentization of applications. The design goal is to be able to
plug components together and overload/replace existing behaviour (a
thing that we never managed to do with Zope2, where components where
working fine side-by-side, but not really together unless they were
developed to do so). That design goal is why the registry
and the adapters were put in there. If someone has a better design to
reach the same goal, please speak up :)

-- 
Nicolas Chauvat

logilab.fr - services en informatique scientifique et gestion de connaissances  



More information about the Cubicweb mailing list