DataEngine & KPluginFactory

Kevin Krammer krammer at kde.org
Mon Jul 1 11:35:27 UTC 2013


On Monday, 2013-07-01, Sebastian Kügler wrote:
> On Monday, July 01, 2013 09:03:29 Kevin Krammer wrote:

> > What if the macro only creates the header content (as its name already
> > suggests)?
> > 
> > name::create() could then be implemented in a plugin specific way, not
> > requiring a certain constructor pattern or specifying of "baseclass".
> 
> I'd rather save the user writing that boilerplate.

Hmm, but doesn't the current macro require to write boilerplate code since it 
is only applicable for a certain case?

I.e. it requires that objects either have a constructor that matches the 
expected siganture or require to write the whole plugin factor subclass 
manually.

A macro that leaves the implementation of the method to the plugin creator 
allows to share all the boilerplate while also allowing all flexibility on 
object instance creation.

If it is really necessary to make the one specific use case doable without 
writing any code I would add a second macro that does this specific 
implementation.
That way the common boilerplate code can be shared by allm those that only 
every create instance of one object and have the required parent/args 
constructor just use the second macro in addition.

Cheers,
Kevin

-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20130701/0d979a55/attachment.sig>


More information about the Kde-frameworks-devel mailing list