5.8. Objects-oriented programming I (Mandatory)

5.8. Objects-oriented programming I (Mandatory)

Figure 5.8: Connection Map. CS112 Objects-oriented programming I

5.8.1. Justification ↑ Back to top

This is the second course in the introductory Computer Science programming sequence. It incorporates a programming language transition as a pedagogical strategy and focuses on core Object-Oriented Programming (OOP) concepts in C++17/C++20, expanding on the foundations from the first course while introducing low-level programming concepts. The course provides a solid foundation for advanced topics covered in the subsequent course of the curriculum.

5.8.2. Generales Goals ↑ Back to top

  1. Introduce the student to the foundations of the object orientation paradigm in C++
  2. Develop skills in C++17/C++20 programming including templates and STL
  3. Understand memory management and low-level programming concepts
  4. Develop problem-solving skills using OOP principles
  5. Master intermediate C++ programming techniques

5.8.3. Contribution to Outcomes ↑ Back to top

AG-C09) Design and Development of Solutions: Designs, implements, and evaluates solutions for complex computing problems. (Usage)
AG-C12) Applies computer science theory and software development fundamentals to produce computer-based solutions. (Usage)

5.8.4. Content ↑ Back to top

5.8.4.1. Language Pragmatics (2 hours) [Skills AG-C09,AG-C12] ↑ Back to top

Bibliography: (Stroustrup, 2013; Josuttis, 2019)

Topics

  1. Problem domains and programming paradigm
  2. Criteria for good programming language design:
    1. Principles of language design such as orthogonality
    2. Defining control and iteration constructs
    3. Modularization of large software enumerate
    4. Brief review of programming paradigms
    5. Comparison between functional and imperative programming
    6. History of programming languages (emphasis on C and C++)

    Learning Outcomes

    1. Discuss the historical context of programming language paradigms [Familiarity].
    2. Evaluate language design trade-offs for specific applications [Assessment].
    5.8.4.2. Language Translation and Execution (4 hours) [Skills AG-C09,AG-C12] ↑ Back to top

    Bibliography: (Stroustrup, 2013; Deitel and Deitel, 2017)

    Topics

    1. Execution models for JIT (Just-In-Time), compiler, interpreter
    2. Use of intermediate code, e.g., bytecode
    3. Execution as native code or within a virtual machine
    4. Virtual machines and intermediate languages
    5. Compilation vs. interpretation models

    Learning Outcomes

    1. Explain and understand the differences between compiled, JIT, and interpreted language implementations, including the benefits and limitations of each [Familiarity]
    2. Differentiate syntax and parsing from semantics and evaluation [Usage]
    3. Illustrate ambiguity in parsing using nested if-then-else/arithmetic expression and show resolution using precedence order [Assessment]
    5.8.4.3. Type Systems Fundamentals (8 hours) [Skills AG-C09,AG-C12] ↑ Back to top

    Bibliography: (Stroustrup, 2013; Josuttis, 2019)

    Topics

    1. A type as a set of values together with a set of operations:
      1. Primitive types (e.g., numbers, Booleans)
      2. Compound types built from other types (e.g., records/structs, unions, arrays, lists, functions, references using set operations) enumerate
      3. Generic types (parametric polymorphism):
        1. Definition and advantages of polymorphism: parametric, subtyping, overloading, and coercion
        2. Comparison of monomorphic and polymorphic types
        3. Comparison with ad-hoc polymorphism (overloading) and subtype polymorphism
        4. Generic parameters and typing
        5. Use of generic libraries such as collections
        6. Comparison with ad hoc polymorphism (overloading) and subtype polymorphism
        7. Prescriptive vs descriptive polymorphism
        8. Implementation models of polymorphic types
        9. Subtyping enumerate
        10. Declaration models (linking, visibility, scope, lifetime)
        11. Overview of type checking in C++
        12. Type conversion and casting in C++

        Learning Outcomes

        1. Define and use program pieces (such as functions, classes, methods) that use generic types, including for collections [Usage]
        2. Discuss the differences among generics, subtyping, and overloading [Familiarity]
        3. Explain multiple benefits and limitations of static typing in writing, maintaining, and debugging software [Assessment]
        5.8.4.4. Object-Oriented Programming Fundamentals (14 hours) [Skills AG-C09,AG-C12] ↑ Back to top

        Bibliography: (Stroustrup, 2013; Josuttis, 2019)

        Topics

        1. Definition of classes: fields, methods, and constructors.
        2. Subclasses, inheritance (including multiple inheritance), and method overriding.
        3. Dynamic dispatch: definition of method-call.
        4. Subtyping:
          1. Subtype polymorphism; implicit upcasts in typed languages.
          2. Notion of behavioral replacement: subtypes acting like supertype.
          3. Relationship between subtyping and inheritance. enumerate
          4. Classes and objects in C++
          5. Constructors and destructors
          6. Access specifiers and encapsulation
          7. Inheritance hierarchies
          8. Polymorphism and virtual functions

          Learning Outcomes

          1. Compose a class through design, implementation, and testing to meet behavioral requirements [Usage]
          2. Build a simple class hierarchy utilizing subclassing that allows code to be reused for distinct subclasses [Usage]
          3. Predict and validate control flow in a program using dynamic dispatch [Assessment]
          4. Design C++ classes with proper encapsulation [Usage].
          5. Implement inheritance hierarchies for code reuse [Usage].
          5.8.4.5. Systems Execution and Memory Model (12 hours) [Skills AG-C09,AG-C12] ↑ Back to top

          Bibliography: (Stroustrup, 2013; Deitel and Deitel, 2017)

          Topics

          1. Direct, indirect, and indexed access to memory location
          2. Run-time representation of data abstractions such as variables, arrays, vectors, records, pointer-based data elements such as linked-lists and trees, and objects
          3. Low level allocation and accessing of high-level data structures such as basic data types, n-dimensional array, vector, record, and objects
          4. Return from procedure as automatic deallocation mechanism for local data elements in the stack
          5. Manual memory management: allocating, de-allocating, and reusing heap memory
          6. Automated memory management: garbage collection as an automated technique using the notion of reachability
          7. Memory layout (stack, heap, static)
          8. Pointer arithmetic and operations
          9. Dynamic memory allocation (new/delete)
          10. Memory leaks and dangling pointers
          11. Smart pointers (unique_ptr, shared_ptr)

          Learning Outcomes

          1. Explain why memory leaks and dangling pointer problems occur, and what can be done by a programmer to avoid/fix them [Usage]
          2. Explain how programming language implementations typically organize memory into global data, text, heap, and stack sections and how features such as recursion and memory management map to this memory model [Assessment]
          3. Explain how a core language construct, such as data abstractions and control abstractions, is executed [Assessment]
          4. Implement RAII for resource management [Usage].
          5. Debug memory-related errors in C++ programs [Usage].
          5.8.4.6. Functional Programming (10 hours) [Skills AG-C09,AG-C12] ↑ Back to top

          Bibliography: (Stroustrup, 2013; Josuttis, 2019)

          Topics

          1. Lambda expressions and evaluation:
            1. Variable binding and scope rules.
            2. Parameter-passing.
            3. Nested lambda expressions and reduction order. enumerate
            4. Using higher-order functions (taking, returning, and storing functions).
            5. Function templates and class templates
            6. Template specialization
            7. Lambda expressions in C++11/14
            8. Standard Template Library concepts

            Learning Outcomes

            1. Develop useful functions that take and return other functions [Usage]
            2. Correctly interpret variables and lexical scope in a program using function closures [Assessment]
            3. Use functional encapsulation mechanisms such as closures and modular interfaces [Usage]
            4. Implement generic functions using templates [Usage].
            5. Use lambda expressions for functional programming [Usage].
            5.8.4.7. Object-Oriented Programming: Encapsulation, Subtyping, and Reflection (8 hours) [Skills AG-C09,AG-C12] ↑ Back to top

            Bibliography: (Stroustrup, 2013; Josuttis, 2019)

            Topics

            1. Collection classes, iterators, and other common library components.
            2. Sequence containers (vector, list, deque)
            3. Associative containers (set, map, unordered_set)
            4. Container adapters (stack, queue, priority_queue)
            5. Iterators and algorithms
            6. Functors and predicates

            Learning Outcomes

            1. Use collection classes and iterators effectively to solve a problem [Usage]
            2. Define and use iterators and other operations on aggregates, including operations that take functions as arguments, in multiple programming languages, selecting the most natural idioms for each language [Usage]
            3. Compare and contrast mechanisms to define and protect data elements within procedural, functional, and object-oriented approaches [Assessment]
            4. Select appropriate STL containers for specific needs [Usage].
            5.8.4.8. Advanced Programming Constructs (6 hours) [Skills AG-C09,AG-C12] ↑ Back to top

            Bibliography: (Stroustrup, 2013; Josuttis, 2019)

            Topics

            1. Object-oriented abstractions: multiple inheritance, mixins, traits, multimethods
            2. Metaprogramming: macros, generative programming, model-based development
            3. Operator overloading
            4. Move semantics and rvalue references
            5. Exception handling in C++
            6. Namespaces and modular programming

            Learning Outcomes

            1. Use various advanced programming constructs and idioms correctly [Usage]
            2. Discuss how various advanced programming constructs aim to improve program structure, software quality, and programmer productivity [Assessment]
            3. Discuss how various advanced programming constructs interact with the definition and implementation of other language features [Familiarity]
            4. Implement move semantics for performance optimization [Usage].
            5.8.4.9. Shell Scripting (4 hours) [Skills AG-C09,AG-C12] ↑ Back to top

            Bibliography: (Robbins and Beebe, 2005)

            Topics

            1. System commands:
              1. Interface with operating systems enumerate
              2. Piping
              3. File abstraction and operators
              4. Programs and processes
              5. Automating compilation and testing of C++ programs through scripts (Makefiles, build/test scripts)

              Learning Outcomes

              1. Create and execute automated scripts to manage various system tasks [Usage]

              5.8.5. Bibliography ↑ Back to top

              Stroustrup, B. (2013). The C++ Programming Language. Addison-Wesley Professional, Upper Saddle River, NJ, 4th edition.

              Josuttis, N. M. (2019). C++17: The Complete Guide. Pearson Education, Indianapolis, IN, 1st edition.

              Deitel, H. and Deitel, P. (2017). C++17: The Complete Guide. Pearson, Boston, MA, 10th edition.

              Robbins, A. and Beebe, N. H. (2005). Classic Shell Scripting. O'Reilly Media, Sebastopol, CA, 1st edition.

              Spotted a typo, an outdated course, a broken link, or have a suggestion? Let us know.

              Scan to open on your phone