another Service draft

Kevin Ottens ervin at kde.org
Sun May 18 20:03:52 CEST 2008


Le Saturday 17 May 2008, Aaron J. Seigo a écrit :
> On Friday 16 May 2008, Kevin Ottens wrote:
> > >    void setDestination(const QString &destination);
> >
> > Why not pass the destination on the call to load? I'm not sure the
> > semantic of "setDestination" makes sense here, it's as if I'd be able to
> > move a service.
>
> you could. the use pattern is probably going to be:
>
> create a service
> tell it what it refers to (e.g. which online account, which local profile,
> etc)
> use it over and over.

Sure, that's my point, you use it over and over without changing the address.

> this will allow one to write generic handlers that use a service that is
> set up for them without them needing to know the destination/address.

Well, I had more a factory method pattern for this kind of use.

> > >    virtual ServiceJob* createJob(const QString &operation,
> > >                                  QMap<QString, QVariant> &parameters) =
> > > 0;
> >
> > Hmmm, or QMap<QString, QVariant> everywhere, or KConfigGroup everywhere.
> > I'd be relunctant to mix both. Hmmmm... actually I'm now wondering, what
> > about: KConfigGroup operationDescription(const QString &operationName);
>
> i use it here because this is now in the service job where the extra
> semantics that KConfigSkeleton give us are no longer useful.

Yeah, thanks for confirming. That's why I was "wondering" in the second part 
of my paragraph. The one returning the KConfigGroup is misnamed. It should 
be "operationDescription" and not "operationParameters". The parameters are 
simply a QMap, the description has more semantic attached (hence 
KConfigSkeleton).

I'm now thinking that my reaction toward KConfigGroup in the API might be 
somewhat biased because of the naming of the methods or parameters related to 
it. So for the naming:
 - parameters => QMap<QString, QVariant>
 - description => KConfigSkeleton

Do I make sense there?

Regards.
-- 
Kévin 'ervin' Ottens, http://ervin.ipsquad.net
"Ni le maître sans disciple, Ni le disciple sans maître,
Ne font reculer l'ignorance."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080518/d55248bb/attachment.pgp 


More information about the Panel-devel mailing list