diff options
author | hjk <hjk121@nokiamail.com> | 2014-02-13 14:28:55 +0100 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-02-13 16:59:26 +0100 |
commit | 52a903112a79c00b51f72f8572eafa8908e2d708 (patch) | |
tree | 106c42796597546dfea813da67723acfe08a1746 /doc | |
parent | f844ab4c0bbfd1776443ac2c2eb6d733e006da91 (diff) | |
download | qt-creator-52a903112a79c00b51f72f8572eafa8908e2d708.tar.gz |
Coding style: Add a comment on Aggregation vs Inheritance
Change-Id: Ied68af7f63e34a05a087b80be0f219f9ccd4e8eb
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/coding-style.qdoc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/api/coding-style.qdoc b/doc/api/coding-style.qdoc index 3d298fba08..7d1da3d958 100644 --- a/doc/api/coding-style.qdoc +++ b/doc/api/coding-style.qdoc @@ -893,6 +893,16 @@ Suddenly, QList symbols are exported from two libraries which results in a clash. + + \section2 Inheritance Versus Aggregation + + \list + \li Use inheritance if there is a clear \e{is-a} relation. + \li Use aggregation for re-use of orthogonal building blocks. + \li Prefer aggregation over inheritance if there is a choice. + \endlist + + \section2 Conventions for Public Header Files Our public header files have to survive the strict settings of |