Hi all,
In my company I started implementing a library where some of classes should inherit from Qt classes.
I look on source code for example of QAuthenticator class and I see that it does not use interface ( does not inherit any interface / pure abstract class ) but use PIMPL idiom ( it is fine ).
And now when I want for example change the QAuthenticator implementation without change public API of this class I can not do that.
I would like ask you if do you think that good library should be build using interfaces and PIMPL idiom? For example:
Qt Code:
class IAuthenticator { public: virtual ~IAuthenticator() {} // etc ... }; class AuthenticatorPrivate { public: QString method; QString user; QString password; QString realm; }; class Authenticator : public IAuthenticator { public: // ... private: QScopedPointer<AuthenticatorPrivate> d; // d-pointer == PIMPL };To copy to clipboard, switch view to plain text mode
Bookmarks