[Nepomuk] Nepomuk facets

Alessandro Sivieri alessandro.sivieri at gmail.com
Fri Jun 18 12:09:43 CEST 2010


2010/6/18 Sebastian Trüg <trueg at kde.org>

> - it allows to add custom facets like "recently modified" easily, I am

 not sure if Facet subclassing is required for that but it might be.
>

Well, the idea is to subclass Facet for each new facet you want to add; for
now they are three, but creating new ones should be easy.


> - it automatically updates when the base query or the selected facets
>  change
>
>
Of course...


> I was thinking of a FacetModel based on QAbstractItemModel but that is
> just one idea. I am not even sure if that is a good one.
>

I have to take a look at the code before answering here... :)


> SemBrowser currently has Facet as a subclass of QWidget. I am not sure
> that is the most flexible approach. IMHO a decoupling of facets from
> representation is desirable.
>

You're completely right here: I did it in this way, but I knew it was not
the best way; I will decouple view and model, so creating a new facet means
subclass Facet (the model part, adding its own queries) without having to
bother about the view part (or just choose which kind of visualization you
want for the new facet).

I don't know about using a FacetModel: currently I'm using a model for those
facets with a list of items (or, better, terms), but for example time and
type do not need a model; I think in the end the best structure is having
Facet (and Term) classes, which represent the model part, some UI
representing the view part, and a controller for them (which, in Sembrowser,
would be the side panel itself, communicating with the file browser part,
but it can be anything else). You know, MVC... :)

-- 
Sivieri Alessandro
alessandro.sivieri at gmail.com
http://www.chimera-bellerofonte.eu/
http://www.poul.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/nepomuk/attachments/20100618/cb494812/attachment.htm 


More information about the Nepomuk mailing list