[Qt-interest] [ANN] ODB C++ ORM adds support for Qt
Boris Kolpackov
boris at codesynthesis.com
Fri Apr 29 10:01:48 CEST 2011
Hi Stephen,
Stephen Kelly <steveire at gmail.com> writes:
> Boris Kolpackov wrote:
>
> > {
> > ...
> >
> > QString name_;
> > QLazySharedPointer<Employer> employer_;
> > };
> >
>
> If QLazySharedPointer is not part of Qt, it's not very good form to name it
> like that. It's confusing.
Yes, we were actually debating this quite a bit. On one hand, as you pointed
out, this can be confusing since the lazy pointers are not part of the Qt
framework. On the other hand, the lazy pointers are an extension of the
standard Qt pointers. Any place you use an eager version, you can replace
it with the lazy variant. Using a different naming style for lazy versions
would make the user's code look inconsistent. In the end, we agreed that
while it may take some getting used to initially, in the long run it will
probably make the user's code more intuitive. We are also prepared to
change this should it cause any problems.
BTW, if Qt were using namespaces, then we could have placed the lazy
versions in our own namespace, giving the user more control. For example,
for boost::shared_ptr we placed the lazy versions to the odb::boost
namespace.
Boris
More information about the Qt-interest-old
mailing list