When to write a DataEngine and when not?

Aaron J. Seigo aseigo at kde.org
Sun Dec 28 02:00:18 CET 2008


On Saturday 27 December 2008, Luca Beltrame wrote:
> Now, I wonder if this warrants the creation of a specific DataEngine or not
> . 90% of the functions to retrieve data are already implemented, what's
> missing (and that I'd write) would be a part to parse the results (they
> come in XML). As far as I understand, DataEngines work with data that is
> either timed or continuous, while in this case it is the user that will
> decide when to search, so they're not very fit for this purpose.

ah, one other thing: for asynchronous actions, it can be easier to put that in 
a DataEngine and then not worry about all the bookkeeping in your 
visualization.

the easiest way i've found to do this is to subclass DataContainer and use 
that as the async wrapper. in fact, for 4.3 i'm toying with the idea of making 
an AsyncDataContainer class or perhaps just extending the existing one with 
the dozen or so lines of code that end up repeated in this pattern (and which 
are easy to get wrong)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20081227/b2338842/attachment.sig 


More information about the Plasma-devel mailing list