Course code: SS-CPP-002
Audience
- Application Developers
- Programmers
- System Designers
Prerequisites
A Familiarity with C++
Description
Advanced C++ Training course offers a comprehensive coverage of the advanced features of the C++ language.
The course starts with basic OO concepts, and then a quick introduction to the language. The language is presented, not as an extension of C, but as a demonstration of how object-oriented development promotes a new, productive way of thinking.
Other topics covered include Templates, Standard Template Library (STL) and Exceptions. The course also covers some advanced Object-Oriented design techniques in C++ such as Design Heuristics, Design by Contract, Interfaced-based programming, Composition and Delegation Patterns, Memory Management and Smart Pointers, Subtyping, Design for efficiency and Meta programming in C++.
Objectives
The course includes a complete overview of the new features in C++11 and C++14
Our goal is to transfer as much knowledge as possible from the classroom to the workplace. Advanced C++ Training course has been carefully designed to ease a C++ programmer into new and advanced language features and advanced Object-Oriented design concepts in C++ with the use of lots of hands-on exercises. At the end of this course, students should:
- Apply advanced concepts of OO designs
- Be able to write and maintain C++ programs
- Write robust, maintainable, elegant and efficient C++ code
- Be able to deploy good C++ programming practices
- Be able to use the advanced features of the C++ programming language
- Be able to implement advanced Object-Oriented techniques in C++ to realize efficient and flexible applications
- Leave with skills needed to develop industrial C++ applications
Outline for Advanced C++ Programming Training Course
Language History and C++11/14
- History of C++
- Versions
- New in TR1
- New in C++11
- New in C++14
Language Review and Best Practice: Part I
- Object-Oriented Programming
- Constructors and Destructors
- new and delete
Basic Inheritance
- Interface vs. Implementation
- Type Inheritance
- Implementation Inheritance
- Proper Use of C++11 final and override
- Virtual Destructors: When and Why?
- Inheritance Guidelines
Correct Use of Well Known Language Features
- Pointers vs. References vs. Value
- Proper Use of const
- Proper Use of Inline Functions
- Proper Use of static
- Proper Use of Default Parameters
- Proper Use of friend
- Proper Use of namespace
- The C++ Way to Cast
- Proper Use of friend
- Proper Use of Operator Overloading
- Copy Constructor: Why/When?
- Assignment Operator: Why/When?
- The Law of The Big Three
Exceptions
- Lessons from Traditional Error Handling
- Object-Oriented Error Handling
- throw, try and catch
- Design of Exception Hierarchies
- Proper use of Rethrow
- using unexpected
- Exception Pitfalls
- Exception Guidelines
Templates
- Template Classes Definition
- Template Classes Implementation
- Parametrized Classes
- Templates and Non-Type Parameters
- Template Guidelines
- Templates and Plain Functions
- C++ Template Function
Standard Template Library (STL)
- STL String
- STL Components
- Sequence Containers
- Use of Iterators in STL
- Example of Algorithms
- Initialization of Containers
- Performance Profiles of Sequence Containers
STL Algorithms
- STL vs Boost
- Parameterization of Algorithms
- Using Functions
- Using Function Objects
- Using Lambda Expressions
- Library of Selected Algorithms
- Contributing Algorithms
STL Associative Containers
- Set
- Multiset
- Map
- Multimaps
STL Functors, Allocators and More
- Standard Exception
- Functors
- Library Provided Function Objects
- Using STL Function Objects and Binders
- Negators
- Allocators
- Complex Number
- Smart Pointers
- auto_ptr (Deprecated)
- shared_ptr (Deprecated)
- unique_ptr (Deprecated)
- weak_ptr (Deprecated)
Efficiency: Temporary Objects
- Temporary Objects: The Problem
- Various Techniques to Avoid Temporaries
- STL String: How to Avoid Creation of Temporaries
- C++11: Move Semantics
- Miscellaneous Techniques to Avoid Temporaries
Memory Management
- How Does C++ Use Memory?
- Basic Guidelines
- Implementation of Singletons in C++
- Efficient Use of Smart Pointers
- Overloading new and delete
Memory Management
- How Does C++ Use Memory?
- Basic Guidelines
- Implementation of Singletons in C++
- Efficient Use of Smart Pointers
- Overloading new and delete
- The Importance of Data Layout
- Hot vs. Cold Memory
Miscellaneous Efficiency Techniques
- Design Concerns
- Flexibility vs Performance
- Lazy Evaluation
- Eager Evaluation
- Copy on Write Techniques
- Data Layout Revisited
- Modern Hardware and Cache Pipelines
- The Effect of Data Structures and Algorithms
- Postcondition and C++
- Efficiency Profiles of Libraries
- STL and Performance
- Latency
- Cost and Benefits of Threads
- Asynchronous Programming
- Futures
Delegation
- Concept of Delegation
- Delegation in C++
- Simple Delegation
- Static Delegation
- Superclass Delegation
- Subclass Delegation
- Issues With Subclass Delegation in C++
- Object Delegation
- Strategy Pattern
- C++ and Strategy
- State Pattern
- C++ and State
- Design of Composite
- Composite and Delegation
- Other Delegation Patterns
Decoupling
- What is Coupling?
- Kinds of Coupling
- Identity Coupling
- Identity Coupling: Object Lifetimes
- Change of Identity
- Type Coupling
- Implementation Coupling
- Interfaces and Implementations
- Decoupling by Example
Advanced Inheritance
- Multiple Inheritance of Interfaces
- Multiple Inheritance of Implementation
- Shared Properties
- Resolving Ambiguity
- Virtual Inheritance
- Multi Methods
- Double Dispatch
- Use of RTTI
- Rules and Guidelines
- Inheritance of Baseclass Methods
- Change of Methods
- Contracts and Inheritance
- Contracts and Subtyping
- Variations of Method Arguments
- Rules for Method Arguments
- Rules for Changing Return Types
- Cancellations of Methods
Design Heuristics
- Object-Oriented Design Guidelines
- Reflecting Client's View
- Polling
- Express Interfaces Through Objects
- Value Objects
- Class Invariants
- Abstract Base Classes
- Classes and Interfaces
- Design Interfaces Between Base and Derived Classes
- Classes Cohesiveness
- Interface Bloat
- Encapsulation Leakage