CS330, Spring 2024

CS330 Outline

Spring 2024

Upcoming Events
1 Course Overview 01/06/2024 - 01/09/2024

Overview

This module introduces you to the course organization, policies, and mechanics. We will review the structure of the course website.

We will take a brief look at the major themes and areas of emphasis that we will cover this semester. We will discuss (briefly) the basics of Python 3 with particular emphasis on how

apply to Object Oriented Programming Languages (e.g., C++, Python, Java, and Rust.

Objectives

At the conclusion of this Orientation Module students will be able to:

  1. Explain the Syllabus.
  2. Explain the importance of Office Hours.
  3. Discuss why C++, Java, Python, and Rust will be covered.
  4. Discuss the S.O. in S.O.L.I.D.
Activities
  1. lecture Read the syllabus
  2. lecture Read the Communications - General Guidance
  3. lecture Read the Support
  4. lab Do: Personal Introduction Post
  5. lecture Read lecture notes: Language Resources
  6. lecture Read lecture notes: Assignment Prompt Structure
  7. lecture Read over An Overview of the Main Course Themes
  8. lecture Read over The Beginning

Office Hours

  1. lecture Review the office hours overview
  2. asst Do assignment: Complete the office hours survey
2 Review Previous Coursework 01/10/2024 - 01/14/2024

Overview

Many students start CS 330 with either a fuzzy or shaky foundation in the fundamentals as covered in CS 250/251 and CS 252. This module serves as an opportunity to revisit foundational skills and identify any questions that need to be addressed (i.e., discussed and answered) before moving on to new material.

Objectives

At the conclusion of this Orientation Module students will be able to:

  1. Connect to the CS VPN.
  2. Log in to the CS Linux servers.
  3. Create a project in their preferred IDE (not Dev-C++).
  4. Use buildfiles (make and/or Gradle).
  5. Checkout the course example set GitHub Repository
Activities
  1. lecture Read lecture notes: Connecting to the CS VPN & Using SSH
  2. lecture Read lecture notes: Basic Linux Commands & Navigation
  3. lecture Read lecture notes: File Permissions (chmod)
  4. lecture Read lecture notes: File Transfer
  5. lecture Read lecture notes: SSH Keys
  6. lecture Read lecture notes: Git
  7. lecture Read lecture notes: Review - Head to Head Testing
  8. lecture Read lecture notes: Review - Makefiles & Command Line Arguments
  9. lecture Read lecture notes: Code Documentation & Comments
  10. lecture Read lecture notes: Review - Operator Overloading
  11. lecture Read lecture notes: Study Guide - Language Fundamentals
  12. lab Prepare (for the next module) Clone the CS 330 GitHub Repo
3 Abstract Data Types (ADTs) 01/15/2024 - 01/25/2024

Overview

This module covers the notion of ADTs from a design perspective. We motivate the notion of ADTs as a design principle, and move towards ADTs as a contract.

The latter part of this module discusses the implementation of ADTs using classes. This includes mechanics (e.g., Constructors, Destructors, accessors and mutators) and best practices (in the form of a checklist).

Objectives

At the end of this module students will be able to:

  1. Discuss what belongs in a header (.h) file.
  2. Discuss what belongs in an implementation (.cpp, .cxx, or .cc) file.
  3. Describe the purpose of inline functions/methods.
  4. Explain Resource Allocation is Initialization (RAII).
  5. Describe the use of an inner class in the context of abstraction and encapsulation.
  6. Summarize the justification for a formal class checklist.
  7. Describe the emergent nature of a class checklist regardless of selected OOP Language.
Activities

Review of the Fundamentals

  1. lecture Read lecture notes: Implementing ADTs in C++ Classes
  2. lecture Read lecture notes: ADTs
  3. lecture Examine Review 01 - Linked Lists Examples 1 & 2 (Part 1)

The Fun Part!

  1. lecture Examine Review 01 - Linked Lists Example 3 (Part 2)
  2. lecture Read lecture notes: Constructors and the Rule of the Big 3
  3. lecture Read lecture notes: A C++ Class Designer's Checklist
  4. lecture Examine Review 01 - Linked Lists Example 4 (Part 3)

Putting the Fun to Use!

  1. lecture Read lecture notes: Using the C++ Class Checklist
  2. asst Do assignment: C++ ADTs Due: 01/25/2024

Future Work

  1. lecture Briefly Examine Review 01 - Linked Lists Examples 5 & 6 (Part 4)
4 Working With Iterators: ADT Case Study 01/26/2024 - 02/01/2024

Overview

This module covers the use of C++ iterators including using pointers, vector::iterators, and custom iterators. This includes definition of custom ADTs that provide iterators and analysis of the required interfaces.

Objectives

At the end of this module students will be able to:

  1. Replace data structure specific code (e.g., arrays and linked lists) with iterator and container abstractions.
  2. Describe how to leverage C++ templates to reduce repeated code, when implementing read-only (const) and read-and-write (non-const) iterators.
  3. Discuss the motivations for memory pools.
  4. Analyze the parallels between Java, Python, and Rust iterators.
  5. Explain (and justify) the motivation for UML Class diagrams.
5 Design: Existing Implementation Perspective 02/02/2024 - 02/07/2024

Overview

This module serves as an opportunity to review all materials, topics, and concepts covered thus far, before discussing:

  • design and testing from the perspective of implementation

  • the C++ class checklist and an analysis of its analogues in Java and Python 3

Objectives

After completing this module students will be able to:

  1. Dissect the class checklist in the context of interface completeness.
  2. Formulate class checklists for Java and Python 3–in general any language.
Activities
  1. lecture Read lecture notes: Conceptual Questions - Simple Classes & ADTs
  2. lecture Read lecture notes: Using the C++ Class Checklist
  3. lecture Read lecture notes: Where Are We Now? - Quarter Semester
  4. lecture Read lecture notes: Iterators - The Journey So Far

Design So Far…

  1. lecture Read lecture notes: Language Specific Class Checklists

Unit Testing & Process (And Workflows)

  1. video Watch Testing Part 1 - C++ & Java
  2. video Watch Testing Part 2 - Python
  3. lecture Read lecture notes: Workflows
  4. lecture Read lecture notes: Software Development Processes
6 Design Discussions (OOA&D) & Case Studies 02/08/2024 - 02/09/2024

Overview

This module continues the discussion of design and UML. This includes modeling scenarios (partially and fully) through use cases, interaction diagrams, and sequence diagrams.

Objectives

After completing this module students will be able to:

  1. Construct UML Class Diagrams to analyze existing code.
  2. Leverage UML Class Diagrams to investigate and model a problem domain.
  3. Explain and track data lifetimes.
  4. Explain ownership.
  5. Utilize UML Sequence Diagrams to model the logic of existing object-oriented code.
  6. Construct UML Class Diagrams.
  7. Validate UML Class Diagrams through use of UML Sequence Diagrams.
  8. Leverage UML Class Diagrams to investigate and model a problem domain.
  9. Leverage UML Sequence Diagrams to investigate and model a problem domain.
7 (Pseudo-Module) Midterm (i.e., Midsemester) Review 02/09/2024 - 02/12/2024

Overview

Note: the use of Midterm in this module refers to the point in the semester, not the Midterm Exam.

This module serves as an opportunity to review all materials, topics, and concepts covered thus, before moving on to inheritance, Java and Python.

Objectives

This module’s objectives are the set union of all previously listed module objectives.

Activities
  1. lecture Read lecture notes: Review - Head to Head Testing
  2. lecture Read lecture notes: Review - Types of Tests
  3. lecture Read lecture notes: Review - Makefiles & Command Line Arguments
  4. lecture Read lecture notes: Conceptual Questions - Simple Classes & ADTs
  5. lecture Read lecture notes: Using the C++ Class Checklist
  6. lecture Read lecture notes: Midsemester Review
  7. lecture Read lecture notes: A Quick Sequence Diagram Review
8 Pointers & Sharing & Memory Management 02/13/2024 - 02/18/2024

Overview

This module covers…

  • pointers and common memory management misteps, concerns and considerations.

  • garbage collection and the associated challenges that must be considered when working with dynamic memory.

Objectives

After completing this module students will be able to:

  1. Explain what a pointer stores.
  2. Explain the difference between a pointer and a reference variable.
  3. Analyze memory deallocation pitfulls.
  4. Explain and track data lifetimes.
  5. Explain why memory management can be a non-trivial problem.
  6. Summarize the motivation behind smart pointers.
  7. Explain ownership.
  8. Summarize garbage collection.

Relevance

Programmers must be familiar with the issues surrounding memory management. This includes lanagues that allow low-level memory allocation (e.g., C/C++ and Rust), garbage collected languages (e.g., Java and Python).

The Rust language is a bit of a special case. Time permitting Rust lifetimes may be used as a brief case study.

Activities
  1. video Watch Pointer Mechanics Review
  2. lecture Read lecture notes: Pointers & Smart Pointers
  3. lecture Read lecture notes: Sharing Pointers and Garbage Collection
  4. asst Do assignment: OOP in C++: (Part 1) Due: 02/20/2024
9 Object Oriented Programming (OOP) 02/19/2024 - 03/10/2024

Overview

This module discusses the notion of Inheritance in OOP. This includes an exploration subtyping as it relates to inheritance. We review the mechanic of function overriding, an mechanic analogous to function overloading.

The application of dynamic binding and the associated mechanics (e.g., virtual functions and pure virtual functions) are a focal point. Once we discuss these mechanics in one language, the transition to other languages (e.g., Python or Rust) is purely mechanical.

This module includes two case studies: the Spreadsheet Example and the Shapes Example.

Objectives

After completing this module students will be able to:

  1. Explain the necessity of pointers for dynamic binding.
  2. Explain the necessity of references for dynamic binding.
  3. Implement the Big-3 (or Big-5) alongside an inheritance hierarchy.
  4. Summarize the difference between overloading and overriding.
  5. Summarize the difference between inheritance and subtyping.
  6. Use raw pointers to allow dynamic binding.
  7. Use C++14/C++17/C++20 smart pointers pointers to allow dynamic binding.
  8. Use reference variables to allow dynamic binding.
  9. Explain when = default and = delete can be used.
  10. Discuss the Observer-Observable Pattern.
  11. Discuss the Factory Model.
10 Preparing for Java & Python & (Maybe) a Little Rust 03/11/2024 - 03/17/2024

Overview

This module continues our language comparison discussions, with a focus on Java. This brief module covers three brief examples. This module serves as preparation for our OOP in Java discussions.

Objectives

After completing this module students will be able to:

  1. Discuss the C++ and Java entries in the Cross Language Class Checklist.
  2. Explain the Java Iterator Interface.
  3. Explain the mechanical differences between C++ and Java iterators.
  4. Discuss how to approach an unfamiliar language (e.g., Java, Python or Rust).
  5. Map existing knowledge of object oriented C++ onto Java.
Activities

OOP Languages in General

  1. lecture Read lecture notes: Cross-Language Class Checklist
  2. lecture Read lecture notes: Loops & Iterators... in Java!
  3. lecture Read lecture notes: Language Resources

Java & Python

  1. video Watch Switching to Java Part 1
  2. video Watch Switching to Java Part 2

Tools, Tricks & Tips

  1. lecture Read lecture notes: Eclipse Tricks (for Java) & VSCode

Python (For Fun and Reference)

  1. lecture Read lecture notes: Why Learn Python?
  2. lecture Read lecture notes: The Basic Python Data Structures
  3. lecture Read lecture notes: PEP 20 - The Zen of Python
  4. lecture Read lecture notes: Types of Tests
  5. lecture Read lecture notes: What is A Module?
11 OOP in Java 03/18/2024 - 03/31/2024

Overview

This module discusses the implementation of ADTs using Java classes. This Module complements (i.e., it is a companion to) the earlier OOP in C++ Module.

Objectives

After completing this module students will be able to:

  1. Explain how Java object variables are conceptually pointers (albeit by a different name).
  2. Implement the Java Big-not-quite-3 (i.e., clone) alongside an inheritance hierarchy.
  3. Use Java Reference variables to allow dynamic binding.
  4. Summarize the difference between inheritance and subtyping.
  5. Discuss the Observer-Observable Pattern.
  6. Discuss the Factory Pattern.
  7. Explain how to implement equals, hashCode, toString, and (sometimes) iterator.
  8. Define the concept of a Java package and compare it to a C++ namespace.
  9. Apply the principles defined by S.O.L.I.D in Java.
  10. Apply the D.R.Y principle in Java.
  11. Summarize the difference between overloading and overriding.
  12. Refactor ABCs into distinct interfaces.
12 Applying OOP: GUIs and Threads 04/01/2024 - 04/14/2024

Overview

This module discusses Graphical User Interfaces (GUIs) and threads in Java. We briefly cover the principles of multi-threading (parallelism) through the Runnable interface..

Objectives

After completing this module students will be able to:

  1. Discuss the Java Swing classes required to build a GUI.
  2. Identify the Java Swing classes that represent familiar elements (e.g., buttons, text fields, and text areas).
  3. Write Java Listeners to handle user interaction.
  4. Write Java Listeners as Immediate Classes.
  5. Write Lambda functions to to replace Java Listeners.
  6. Explain the differences between sequential and multi-threaded programs.
  7. Explain the different ways to utilize multiple threads (e.g., ThreadPools).
  8. Define syncronization and identify the mechanics involved.
  9. Refactor code to follow either the MVC or M-VC patterns.
Activities

Graphic User Interfaces (GUIs)

  1. video Watch Java GUI & Thread Discussion
  2. lecture Read lecture notes: Functors - Objects That Act Like Functions
  3. reading Read (optional): Java Tutorial: Creating a GUI with JFC/Swing
  4. lecture Read lecture notes: Example: Building a Java GUI

GUI Listeners & Lambdas

  1. lecture Read lecture notes: Java GUIs - ActionListeners & Lambdas

Multi-Threading

  1. video Watch Java Thread & ThreadPool Discussion
  2. lecture Read lecture notes: Threading: Motivation
  3. lecture Read lecture notes: Multi-Threading : Doing Things in Parallel
  4. reading Read (optional): Java Tutorial: Concurrency
  5. lecture Read lecture notes: Case Study: threads in the spreadsheet
13 Additional Design Patterns 04/15/2024 - 04/18/2024

Overview

In this Module we will revisit concepts discussed through the semester, but in Python (and maybe Rust)!

Objectives

After completing this module students will be able to:

  1. Analyze lazy evaluation in the context of Generators and Generator Expressions.
  2. Refactor code to make use of context managers.
  3. Discuss the Decorator Pattern.
  4. Discuss the Builder Pattern.
  5. Discuss Protocols vs. ABCs
  6. Utilize properties and setters
  7. Discuss Dependency Injection. Recomendation from Vanguard Dev
  8. Discuss how to approach an somewhat unfamiliar language (e.g., Java, Python or Rust).
  9. Map existing knowledge of object-oriented Java onto Python.
14 Semester Review & Things To Explore 04/19/2024 - 04/22/2024

Overview

This is a pseudo-module. There is no new material (e.g., languages, paradigms or patterns) covered. This Module is an end-of-semester wrap up. We will revisit selected topics from throughout the semester.

We will introduce a few quick topics to explore with your new skills and knowledge.

Activities

Readings to Revisit

  1. lecture Read lecture notes: Cross-Language Class Checklist
  2. lecture Read lecture notes: Loops & Iterators... in Java!
  3. lecture Read lecture notes: Java GUIs - ActionListeners & Lambdas

Previous Review Materials

  1. lecture Read lecture notes: Quarter Semester Review
  2. video Watch C++ Shapes Discussions
  3. video Watch Java Shapes Discussions
  4. lecture Read lecture notes: A Quick Sequence Diagram Review
  5. lecture Read lecture notes: Midsemester Review

End of Semester Review

  1. lecture Read lecture notes: Reviewing S.O.L.I.D
  2. lecture Read lecture notes: Which Language is It?
  3. lecture Read lecture notes: Using the Java Class Checklist
  4. lecture Read lecture notes: Final (Last) Review

Future Work

  1. lecture Read lecture notes: Language Resources
  2. lecture Read lecture notes: Code Documentation & Comments
  3. lecture Read lecture notes: Where Are We Now? - Future Work
15 Exams and Special Events
Activities
  1. Refer to the ODU Academic Calendar.
  2. Classes Start 01/06/2024
  3. exam Take the exam: Midterm Exam 03/15/2024 - 03/16/2024
  4. exam Take the exam: Final Exam 04/22/2024 - 04/25/2024

All times in this schedule are given in Eastern Time.

Symbol Key
lecture Lecture:
slides Slides :
event Event or important date
text Read
lab Do lab:
asst Assignment:
exam Take the
activity Do:
recitation In your recitation section:
construct Under construction: