Course: Programming in C++ - Part 2: Object-oriented Concepts in C++
duration: 42 hours |
Language: English (US) |
access duration: 180 days |
Details
This comprehensive course covers Object-oriented Concepts and advanced topics in C++ programming, providing a deep understanding of the language. Starting with object-oriented programming (OOP), you'll learn how to create classes, instantiate objects, and work with member variables, gaining a strong conceptual grasp of class definitions and modularization of code. The course delves into constructors, including their complexities, initialization lists, and usage in constructor chaining. It explores the 'this' pointer, const members, and the mutable keyword to manage constness. You'll master the use of static members, destructors, and smart pointers to enhance resource management.
The course delves into inheritance and polymorphism, teaching you how to establish is-a relationships and understand the order of constructors and destructors in an inheritance hierarchy. You'll explore runtime polymorphism, dynamic dispatch, and the use of the 'virtual' keyword. The course includes pure virtual functions, abstract classes, and object-oriented design principles. The complexities of multiple inheritance and diamond hierarchies are explained, along with the use of dynamic casts. The course covers operator overloading for custom types, including arithmetic, relational operators, and other built-in operators. It also focuses on function templates and class templates, addressing type inference, default arguments, and non-type template parameters. The final part of the course explores references, with a focus on l-value and r-value references, and delves into move constructors, move assignment operators, and Resource Acquisition Is Initialization (RAII) principles to streamline code complexity.
Result
After completing this course you’ll have the skills to create efficient and maintainable C++ code, design complex software systems, and tackle a wide range of programming challenges. In addition, you’ll have a well-rounded understanding of object-oriented programming in C++.
Prerequisites
Basic knowledge of programming languages is recommended. Additionally, it is recommended to first follow ‘’Part 1: Getting started with C++’’ of the learning path ‘’Develop your knowledge in Programming in C++’’.
Target audience
Software Developer
Content
Programming in C++ - Part 2: Object-oriented Concepts in C++
OOP in C++: Getting Started with Object-oriented Programming
C++ is an object-oriented programming (OOP) language wherein developers model real-world entities, create classes, and instantiate objects of classes. In this course, learn how the object-oriented programming approach functions at a conceptual level. Discover how class act effectively as blueprints and explore member variables. Then, examine class definitions in your C++ programs and practice instantiating objects of those classes. Next, learn how to perform simple operations on those objects, invoke methods on them, and access and examine their member variables. Finally, learn how to modularize your code and declare a class in the header file. After completion of the course, you'll be able to define classes, instantiate objects, and split class implementation and declaration.
OOP in C++: Instantiating Objects Using Constructors
A constructor is a special method of a class invoked when an object of that class is created. Constructors have a fair bit of complexity, and can be chained to achieve code reuse and marked as explicit to avoid unexpected type promotions and object creation. In this course, examine the important aspects of constructor syntax, such as specifying default arguments and correctly using initialization lists. Next, learn how to chain constructors and retain most of the code functionality in one constructor. Finally, learn how constructors might be invoked automatically by the C++ runtime to create objects for method invocations. After completion of the course, you'll be able to correctly initialize variables using initialization lists, connect constructors using constructor chaining, and create structs.
OOP in C++: Using the this Pointer & const Members
When a member function is invoked on a particular object, that object is known as the receiver. Within the body of the member function, you can access the member variables of the receiver using the "this" pointer. In this course, discover how the this pointer works and practice using it to access states. Next, learn about constness in object-oriented programming and the restrictions for what such methods can do. Finally, learn how to use the mutable keyword to mitigate constness. After completion of the course, you'll be able to access member variables from within member functions, create const and non-const objects and functions, and use the mutable specification to identify states that can be changed without changing the meaning of the object.
OOP in C++: Using Static Members & Destructors
Static means something different in C++ compared to C. In C, static refers to a storage class for storing specific types of variables. In C++, static refers to member functions and variables associated with the entire class. In this course, learn how to mark a member variable within a class as static, initialize a static member variable, and access it from methods within and outside the class. Next, discover how static member functions can be used for class-level behavior. Finally, learn how to define and use a destructor. After completion of the course, you'll be able to create and use static variables, access them using the scope resolution operator, and instantiate and deallocate a pointer in constructors and destructors.
OOP in C++: Copy Constructors, Nested Classes, & Namespaces
A copy constructor in C++ classes is a specialized method used to create an object from another object of the same class. Other specialized C++ methods include nested classes and namespaces, which organize different classes in a logical and coherent manner while avoiding name conflicts. In this course, learn how to specify and use a copy constructor. Next, discover how classes and functions can be marked as friends. Finally, examine how nested classes can be defined and used in C++ and practice using namespaces to modularize your code. After completion of the course, you'll be able to create and implement a custom copy constructor, access private variables using friend functions and classes, and store functions and classes in namespaces.
C++ Inheritance & Polymorphism: Using Inheritance for is-a Relationships
Inheritance is a powerful, object-oriented language construct in which one class can be related to another class using an is-a relationship. Using inheritance, you can construct complicated class hierarchies in which one class is a parent or a base of another class. Is-a relationships are a great way of performing object-oriented design and are complemented by has-a relationships, which are implemented using composition, rather than inheritance. Explore inheritance relationships by setting up an inheritance hierarchy in C++ and specifying one class as the parent of another class. Then discover how member variables and methods are accessible from the drive class, as well as from external code. Finally, investigate base class access specifiers, and find out how they work with member access specifiers. When you're finished, you'll clearly understand how to use inheritance for is-a relationships and how to identify uses for private inheritance.
C++ Inheritance & Polymorphism: Constructors, Destructors, & Inheritance
The order in which constructors and destructors are invoked on an object of a derived class in an inheritance hierarchy is a very important topic. Constructors are invoked in order from the top-most (most base-level) class, down to the most derived class. Destructors are invoked in the reverse order. Explore how constructors work in an inheritance hierarchy, the order in which the base and derived class constructors are invoked, and how initialization lists need to be used in the derived class. Discover how to use copy constructors and destructors in the context of inheritance. Learn how to set up an inheritance hierarchy for polymorphism. Finally, practice using objects in an inheritance hierarchy with variables of pointer and reference types. When you finish this course, you will have a solid foundation in constructors, destructors, and inheritance, setting the stage for runtime polymorphism and dynamic method dispatch.
C++ Inheritance & Polymorphism: Understanding & Using Polymorphism
Inheritance forms the basis for polymorphism, specifically runtime polymorphism, which is a powerful object-oriented programming construct. Runtime polymorphism involves a pointer or a reference of the base class type holding an object of the derived class. The beauty of runtime polymorphism is that when virtual methods are invoked on this pointer, the derived class versions are executed. You will start this course by defining name hiding and how most methods on C++ objects are, by default, statically dispatched. You will then learn about polymorphism and dynamic dispatch, which is accomplished using the virtual keyword. Finally, you will learn how the ‘override' and 'final' specifications can be used to achieve precise semantics and reduce the scope of bugs and typos in your C++ programs.
C++ Inheritance & Polymorphism: Pure Virtual Functions & Abstract Classes
Pure virtual functions and interfaces are very powerful tools in object-oriented programming, and interface-driven programming is a great way of splitting up work across different developers on a large project. You will start this course by considering why your destructors should be marked as virtual in the base class if you have an inheritance hierarchy. You'll see the harmful effects of not using virtual destructors in an inheritance hierarchy and the problems with object slicing. You will also learn why it is preferable to have variables of reference types to the base class rather than the value types. You will then move to some finer points of working with virtual methods, such as, the inadvisability of using default parameters because these are statically bound. Finally, you will master the syntax and semantics of pure virtual functions and learn how a class that contains even one pure virtual function becomes an abstract class that cannot be instantiated directly.
C++ Inheritance & Polymorphism: Multiple Inheritance & the Diamond Hierarchy
C++ allows multiple inheritance, which means that one class can have more than one base. C++ also has some powerful mechanisms for dealing with edge cases such as the diamond hierarchy. You will start this course by learning the precise syntax which is required to implement multiple inheritance in C++, specifically, how it's important to have both base class access specifiers marked independently. You will then move on to the topic of a diamond inheritance hierarchy, in which the grandchild-level derived class has two parents, both of which inherit from the common, grandparent level base class. Finally, you will see how dynamic casts work in the context of an inheritance hierarchy, how these are a lot safer than static casts, and how they return a null value on failure when used with pointers but they throw an exception on failure when used with references.
C++: Getting Started with Operator Overloading
Operator overloading is an unusual language feature that is quite important in C++, enabling you to specify implementations of the standard operators for your user-defined types. You can overload a wide variety of operators, each having a standard meaning for built-in types that can be mimicked in custom types. If used correctly, this can lead to natural, elegant-looking code. Begin this course by learning how to overload simple operators and explore the restrictions around overloading operators. Then, discover how to overload operators as member functions of a class, providing easy access to the internal state of the object. Finally, focus on identifying situations where the member function implementation will not work and investigate best practices of operator overloading.
C++: Stream Operators, Assignment Operators, & Copy-and-Swap
The stream insertion and extraction operators are often overloaded because they provide a convenient way to read objects in and write objects out to standard IO. The copy assignment operator is even more crucial because of how important it is in correctly freeing up resources held by an object. In this course, learn how to implement the correct overloads of the insertion and extraction operators and why these are invariably implemented as non-member functions. Then, move on to correctly overloading the copy assignment operator and using standard formats to ensure that resource cleanup occurs exactly once. Finally, find out how the copy-and-swap idiom provides a way to use the std::swap function to implement the copy assignment operator in a manner that is exception-safe. This idiom leads to an elegant implementation that is not only less complex, but also more robust.
C++: Overloading Arithmetic & Relational Operators
Some of the most commonly overloaded operators include binary arithmetic operators, used in operations such as a + b; compound assignment operat+B30ors of the form a+= b; and the prefix and postfix operators of the form a++. In this course, discover how to overload binary arithmetic operators appropriately, so that they support correct semantics in chaining. Learn how to overload compound assignment operators, such as +=. Explore how the C++ compiler differentiates between the pre and post increment operators and how these operators work in various edge cases. When you complete this course, you will be able to confidently leverage std_rel_ops by overloading relational operators.
C++: Using Function Templates
Template metaprogramming is a powerful computer science technique used to achieve code reuse and some incredibly elegant architectures. In C++, template metaprogramming is achieved via template functions and classes that are instantiated at compile-time, not at runtime. In this course, learn how to define and instantiate function templates to effectively provide compile-time polymorphism. Then, explore how template definitions can make assumptions about the template parameters. Finally, learn how to define and use templates with pointer and reference types to provide function overloading.
C++: Function Templates with Multiple Parameters & Non-type Parameters
Template programming is very powerful and can also get quite complicated. In this course you will tackle some of those complications by using multi-value function templates. Learn how decl_type and auto keywords can be used to allow type inference on the return type of a function. Work with default arguments for template parameters and see how this can lead to mismatches if done carelessly. Finally, define and specify non-type template parameters and explore the relationship between the values of those parameters and the compiler.
C++: Using Class Templates
Class templates are a way of reusing code for classes parameterized by types of internal state variables, just as function templates are a way of reusing code for functions parameterized by the types of input arguments and return types. In this course you will discover how to define and instantiate class templates, along with common uses of templated classes. Learn how to use the braced initialization list constructor and explore how the compiler provides this special construct so that container objects can be initialized from a list of values. Finally, investigate partial and full template specializations, and how partial specializations can be used to correctly deal with pointer types.
C++: Using the Move Constructor & Move Assignment Operator
References are an important part of C++, and a little-known fact about references is that there are actually two types of references: l-value and r-value. In this course, explore those two reference types by learning how to use the syntax and semantics of r-value references to extend the lifespan of transient values. Then, implement the move assignment operator and move constructor, using r-value references as their input arguments, to reduce the number of unnecessary copies created in your C++ programs. Finally, work with Resource Acquisition Is Initialization (RAII) to use smart pointers as a way to bypass complex rules, such as the rule of three and the rule of five, allowing you to follow the simplest rule of all - the rule of 0.
Object-oriented Concepts in C++
In the Object-oriented Concepts in C++ lab, you will create constructors and instantiate objects, use static members and destructors, implement the copy constructor, and create friend functions. You will also explore run-time polymorphism, implement virtual methods and operator overloading, and create function templates.
Final Exam: Object-oriented Concepts in C++
Final Exam: Object-oriented Concepts in C++ will test your knowledge and application of the topics presented throughout the Object-oriented Concepts in C++ track of the Skillsoft Aspire Programming in C++ Journey.
Course options
We offer several optional training products to enhance your learning experience. If you are planning to use our training course in preperation for an official exam then whe highly recommend using these optional training products to ensure an optimal learning experience. Sometimes there is only a practice exam or/and practice lab available.
Optional practice exam (trial exam)
To supplement this training course you may add a special practice exam. This practice exam comprises a number of trial exams which are very similar to the real exam, both in terms of form and content. This is the ultimate way to test whether you are ready for the exam.
Optional practice lab
To supplement this training course you may add a special practice lab. You perform the tasks on real hardware and/or software applicable to your Lab. The labs are fully hosted in our cloud. The only thing you need to use our practice labs is a web browser. In the LiveLab environment you will find exercises which you can start immediately. The lab enviromentconsist of complete networks containing for example, clients, servers,etc. This is the ultimate way to gain extensive hands-on experience.
Sign In
WHY_ICTTRAININGEN
Via ons opleidingsconcept bespaar je tot 80% op trainingen
Start met leren wanneer je wilt. Je bepaalt zelf het gewenste tempo
Spar met medecursisten en profileer je als autoriteit in je vakgebied.
Ontvang na succesvolle afronding van je cursus het officiële certificaat van deelname van Icttrainingen.nl
Krijg inzicht in uitgebreide voortgangsinformatie van jezelf of je medewerkers
Kennis opdoen met interactieve e-learning en uitgebreide praktijkopdrachten door gecertificeerde docenten
Orderproces
Once we have processed your order and payment, we will give you access to your courses. If you still have any questions about our ordering process, please refer to the button below.
read more about the order process
Een zakelijk account aanmaken
Wanneer u besteld namens uw bedrijf doet u er goed aan om aan zakelijk account bij ons aan te maken. Tijdens het registratieproces kunt u hiervoor kiezen. U heeft vervolgens de mogelijkheden om de bedrijfsgegevens in te voeren, een referentie en een afwijkend factuuradres toe te voegen.
Betaalmogelijkheden
U heeft bij ons diverse betaalmogelijkheden. Bij alle betaalopties ontvangt u sowieso een factuur na de bestelling. Gaat uw werkgever betalen, dan kiest u voor betaling per factuur.
Cursisten aanmaken
Als u een zakelijk account heeft aangemaakt dan heeft u de optie om cursisten/medewerkers aan te maken onder uw account. Als u dus meerdere trainingen koopt, kunt u cursisten aanmaken en deze vervolgens uitdelen aan uw collega’s. De cursisten krijgen een e-mail met inloggegevens wanneer zij worden aangemaakt en wanneer zij een training hebben gekregen.
Voortgangsinformatie
Met een zakelijk account bent u automatisch beheerder van uw organisatie en kunt u naast cursisten ook managers aanmaken. Beheerders en managers kunnen tevens voortgang inzien van alle cursisten binnen uw organisatie.
What is included?
Certificate of participation | Yes |
Monitor Progress | Yes |
Award Winning E-learning | Yes |
Mobile ready | Yes |
Sharing knowledge | Unlimited access to our IT professionals community |
Study advice | Our consultants are here for you to advice about your study career and options |
Study materials | Certified teachers with in depth knowledge about the subject. |
Service | World's best service |
Platform
Na bestelling van je training krijg je toegang tot ons innovatieve leerplatform. Hier vind je al je gekochte (of gevolgde) trainingen, kan je eventueel cursisten aanmaken en krijg je toegang tot uitgebreide voortgangsinformatie.
FAQ
Niet gevonden wat je zocht? Bekijk alle vragen of neem contact op.