[Development] API review for a new QDnsResolver class

Robin Burchell robin+qt at viroteck.net
Fri Nov 4 10:28:03 CET 2011


2011/11/4 André Somers <andre at familiesomers.nl>:
> Currently, the user
> will have to instantiate the QDnsResolver object, and call the lookupService
> method. It is not so clear what needs to happen to that instance after that.

which brings up a pet QNAM-peeve of mine - a frequent new-to-Qt user
trap is that they instantiate a QNAM for every request (or at least,
in every object using requests) simply because sharing a QNAM is
"hard" (or at least harder than it needs to be ...)

if you're going to use a similar design, I'd recommend having some way
to acquire a default a QDnsResolver, i.e. a ::instance() method
returning a thread-local (unless you're threadsafe) which would make
end-users lives better at little cost



More information about the Development mailing list