Thinking in C++ - Volume 2
Thinking in C++ - Volume 2
Date de publication : 25/01/2007 , Date de mise à jour : 25/01/2007
3.0. Introduction
3.0. Introduction
The mark of a professional appears in his or her attention to
the finer points of the craft. In this section of the book we discuss advanced
features of C++ along with development techniques used by polished C++
professionals.
Sometimes you may need to depart from the conventional
wisdom of sound object-oriented design by inspecting the runtime type of an
object. Most of the time you should let virtual functions do that job for you,
but when writing special-purpose software tools, such as debuggers, database
viewers, or class browsers, you'll need to determine type information at
runtime. This is where the runtime type identification (RTTI) mechanism becomes
useful. RTTI is the topic of Chapter 8.
Multiple inheritance has taken abuse over the years, and
some languages don't even support it. Nonetheless, when used properly, it can
be a powerful tool for crafting elegant, efficient code. A number of standard
practices involving multiple inheritance have evolved over the years, which we
present in Chapter 9.
Perhaps the most notable innovation in software development
since object-oriented techniques is the use of design patterns. A design
pattern describes solutions for many of the common problems involved in
designing software, and can be applied in many situations and implemented in
any language. In chapter 10 we describe a selected number of design patterns
and implement them in C++.
Chapter 11 explains the benefits and challenges of multithreaded
programming. The current version of Standard C++ does not specify support for
threads, even though most operating systems provide them. We use a portable, freely
available threading library to illustrate how C++ programmers can take
advantage of threads to build more usable and responsive applications.