| ||||||||||||
![]() Gutschein erhalten
Tauschen Sie jetzt Modern C++ Design, Generic Programming and Design Patterns Applied gegen einen Amazon-Gutschein in Höhe von EUR 13,30 ein - einlösbar für Tausende von Artikeln bei Amazon.de. Entdecken Sie mehr eintauschbare Bücher im Bücher Trade-In Shop. Bitte beachten Sie die Teilnahmebedingungen.
Jetzt für Amazon Student anmelden und um 20% erhöhten Eintauschwert sichern. |
Produktinformation
Möchten Sie die Produktinformationen aktualisieren oder Feedback zu den Produktabbildungen geben?
Ist der Verkauf dieses Produkts für Sie nicht akzeptabel? |
The second category consists of busy programmers who need to get the job done without undergoing a steep learning investment. They can skim the most intricate details of implementation and concentrate on using the provided library. Each chapter has an introductory explanation and ends with a Quick Facts section. Programmers will find these features a useful reference in understanding and using the components. The components can be understood in isolation, are very powerful yet safe, and are a joy to use.
You need to have a solid working experience with C++ and, above all, the desire to learn more. A degree of familiarity with templates and the Standard Template Library (STL) is desirable.
Having an acquaintance with design patterns (Gamma et al. 1995) is recommended but not mandatory. The patterns and idioms applied in the book are described in detail. However, this book is not a pattern book it does not attempt to treat patterns in full generality. Because patterns are presented from the pragmatic standpoint of a library writer, even readers interested mostly in patterns may find the perspective refreshing, if constrained.
Loki
The book describes an actual C++ library called Loki. Loki is the god of wit and mischief in Norse mythology, and the authors hope is that the library's originality and flexibility will remind readers of the playful Norse god. All the elements of the library live in the namespace Loki. The namespace is not mentioned in the coding examples because it would have unnecessarily increased indentation and the size of the examples. Loki is freely available to download.
Except for its threading part, Loki is written exclusively in standard C++. This, alas, means that many current compilers cannot cope with parts of it. I implemented and tested Loki using Metrowerks CodeWarrior Pro 6.0 and Comeau C++ 4.2.38, both on Windows. It is likely that KAI C++ wouldnt have any problem with the code, either. As vendors release new, better compiler versions, you will be able to exploit everything Loki has to offer.
Lokis code and the code samples presented throughout the book use a popular coding standard originated by Herb Sutter. Im sure you will pick it up easily. In a nutshell,
Classes, functions, and enumerated types look LikeThis.
Variables and enumerated values look likeThis.
Member variables look likeThis_.
Template parameters are declared with class if they can be only a user-defined type, and with typename if they can also be a primitive type.
Organization
The book consists of two major parts: techniques and components. Part I (Chapters 1 to 4) describes the C++ techniques that are used in generic programming and in particular in building generic components. A host of C++-specific features and techniques are presented: policy-based design, partial template specialization, typelists, local classes, and more. You may want to read this part sequentially and return to specific sections for reference.
Part II builds on the foundation established in Part I by implementing a number of generic components. These are not toy examples; they are components of industrial strength used in real-world applications. Recurring issues that C++ developers face in their day-to-day activity, such as smart pointers, object factories, and functor objects, are discussed in depth and implemented in a generic way. The text presents implementations starting from the needs, the fundamental problems. Instead of explaining what a body of code does, the approach of the book is to discuss problems, take design decisions, and implement those decisions gradually.
Chapter 1 presents policiesa C++ idiom that helps in creating flexible designs.
Chapter 2 discusses general C++ techniques related to generic programming.
Chapter 3 implements typelists, which are powerful type manipulation structures.
Chapter 4 introduces an important ancillary tool: a small-object allocator.
Chapter 5 introduces the concept of generalized functors, useful in designs that use the Command design pattern.
Chapter 6 describes Singleton objects.
Chapter 7 discusses and implements smart pointers.
Chapter 8 describes generic object factories.
Chapter 9 treats the Abstract Factory design pattern and provides implementations of it.
Chapter 10 implements several variations of the Visitor design pattern in a generic manner.
Chapter 11 implements several multimethod engines, solutions that foster various trade-offs.
The design themes cover many important situations that C++ programmers have to cope with on a regular basis. I personally consider object factories (Chapter 8) a cornerstone of virtually any quality polymorphic design. Also, smart pointers (Chapter 7) are an important component of many C++ applications, small and large. Generalized functors (Chapter 5) have an incredibly broad range of applications. Once you have generalized functors, many complicated design problems become very simple. The other, more specialized, generic components, such as Visitor (Chapter 10) or multimethods (Chapter 11) have important niche applications and stretch the boundaries of language support.
Tags, die Kunden mit diesem Produkt verbinden(Was ist das?)Klicken Sie zum Suchen verwandter Artikel, Diskussionen oder Personen auf ein Tag.
|
Haben Sie z.B. schon einmal template template parameter gesehen oder gar eingesetzt (ich stottere übrigens nicht)? In Bjarne Stroustrup's dritter Ausgabe seines Buchs "The C++ Programming Language" schreibt er in 13.2.3 darüber: "A template can take type parameters, parameters of ordinary types such as ints, and template parameters (§C.13.3)." Im Anhang C gibt's dann gerade mal eine halbe Seite Beschreibung dazu. Ganz offensichtlich misst Stroustrup dem keine grosse Bedeutung zu. Anderer Meinung ist Alexandrescu: "These constructs use one of the most powerful constructs of C++, a feature unmatched by any other language -- template template parameters." Er bleibt den Beweis nicht schuldig.
Was halten Sie z.B von einer Smartpointer-Klasse, die mittels 4 policy-parametern auf ein fast beliebiges Verhalten parameterisiert werden können (ownership management, conversion, error checking und storage)? Die Anzahl möglicher Kombinationen geht in die Hunderte.
Dieses Buch ist ein Muss für fortgeschrittene C++ Programmierer die ein bisschen in die Zukunft blicken wollen und ihren Horizont erweitern wollen. Übrigens: Wenn Sie die darin beschriebenen Dinge selber ausprobieren wollen, brauchen Sie einen zum Standard voll konformen Compiler. Viele aktuelle Produkte namhafter Hersteller sind das leider noch nicht.
Auch wenn erst die zweite Fassung der zugehörigen"Loki"-Bibliothek auch mit g++ 2.95 funktioniert, war für mich bereits das "Vorauslesen" eine äußerst spannende Sache. Jetzt mit der benutzbaren Software werde ich das Buch so schnell wie möglich nochmals durcharbeiten und die beschriebenen Techniken und die bereitgestellten Werkzeuge eingehend studieren.
Es bleibt zu höffen, daß diese Form von C++ besser früher als später von den maßgeblichen Compiler(hersteller)n unterstützt wird. (Versuchen Sie mal, einen STL-Container mit polymorphen Elementen durch STL-Algorithmen zu manipulieren; erst mit Loki::SmartPtr<T,RefCounted,AllowConversion> ist mir das gelungen.)
|
Das Forum zu diesem Produkt
Fragen stellen, Meinungen austauschen, Einblicke gewinnen Aktive Diskussionen in ähnlichen Foren
Kundendiskussionen durchsuchen
|
Ähnliche Foren
|
||||||||||||||||||||||||||||||||||
|
|
|