CS330 Outline
Fall 2023
1 Course Overview 08/26/2023 - 08/29/2023
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 PEP 8 and PEP 20 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:
- Explain the Syllabus.
- Explain the importance of Office Hours.
- Discuss why
C++,Java, Python, and Rust will be covered. - Discuss the S.O. in S.O.L.I.D.
- Connect to the CS VPN.
- Log in to the CS Linux servers.
- Use buildfiles (make and/or Gradle).
- Checkout the course example set GitHub Repository
- Create a project in their preferred IDE: Eclipse, VSCode, or Vim (with appropriate plugins).
- Compile code with a provided buildfile.
- Read the syllabus.
- Read the communications policy
- Watch the orientation session
- “Meet and Greet” Forum (optional, in Canvas)
Office Hours
Selected CS 252 Review Readings
- Connecting to the CS VPN & Using SSH
- Basic Linux Commands & Navigation
- File Permissions (
chmod
) - File Transfer
- SSH Keys
- Git
Looking Forward a Few Weeks…
- Language Resources
- Conceptual Questions - Simple Classes & ADTs
- Using the C++ Class Checklist
- Code Documentation & Comments
Getting Started
- Review - Head to Head Testing
- Review - Makefiles & Command Line Arguments
- Prepare (for the next module) Clone the CS 330 GitHub Repo
2 ADTs in C++ 08/30/2023 - 09/10/2023
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 C++ classes. This includes mechanics (e.g., Constructors and Destructors) and best practices (in the form of a checklist).
Objectives
At the end of this module students will be able to:
- Create a project in their preferred IDE (not Dev-C++).
- Compile code with a provided makefile.
- Discuss what belongs in a header (
.h
) file. - Discuss what belongs in an implementation (
.cpp
,.cxx
, or.cc
) file. - Describe the purpose of inline functions/methods.
- Explain Resource Allocation is Initialization (RAII).
- Describe the use of an inner class in the context of abstraction and encapsulation.
- Summarize the justification for a formal class checklist.
- Describe the emergent property of a class checklist regardless of selected OOP Language.
- Summarize the justification for a formal class checklist.
- Describe the emergent nature of a class checklist.
Review of the Fundamentals
- Implementing ADTs in C++ Classes
- Designing for ADTs
- Booch, chapter 1 & chapter 2, up to “The Meaning of Hierarchy”
- ADTs
- Review - Operator Overloading
- Examine Review 01 - Linked Lists Examples 1 & 2 (Part 1)
The Fun Part!
- Examine Review 01 - Linked Lists Example 3 (Part 2)
- Constructors and the Rule of the Big 3
- A C++ Class Designer's Checklist
- Examine Review 01 - Linked Lists Example 4 (Part 3)
Putting the Fun to Use!
- Using the C++ Class Checklist
- C++ ADTs Due: 09/15/2023
Future Work
3 Working With Iterators: ADT Case Study 09/12/2023 - 09/26/2023
Overview
This module covers the use of C++ iterators including using pointers, vector::iterator
s, 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:
- Replace data structure specific code (e.g., arrays and linked lists) with iterator and container abstractions.
- Describe how to leverage C++ templates to reduce repeated code, when implementing read-only (const) and read-and-write (non-const) iterators.
- Describe the motivation behind Move Constructors, Move Assignment, and move semantics.
- Analyze the parallels between C++ iterators and Rust iterators.
- Explain (and justify) the motivation for UML Class diagrams.
- Examine Review 02 - Well Defined Interfaces - Part 1 (Examples 1 & 2)
- Examine Review 02 - Well Defined Interfaces - Part 2 (Examples 3 to 5)
- Examine Review 02 - Well Defined Interfaces (Examples 7 & 8)
- Review Assignment 1
- Loops & Iterators
- C++ Iterators Due: 09/29/2023
The Fun Examples!
- Examine Review 03 - Part 1 - Examples 1 to 2
- Examine Review 03 - Part 2 - Examples 3 to 5
- Examine Review 03 - Part 3 - Example 6
The Fun Examples… in Other Languages!
4 (Pseudo-Module) Quarter Semester (Term) Review 09/27/2023 - 10/01/2023
Overview
This module serves as an opportunity to review all materials, topics, and concepts covered thus, before design and testing.
Objectives
This module’s objectives are the set union of all previously listed module objectives.
- Conceptual Questions - Simple Classes & ADTs
- Using the C++ Class Checklist
- Where Are We Now? - Quarter Semester
- Iterators - The Journey So Far
5 Design Discussions (OOA&D) & Case Studies 10/02/2023 - 10/04/2023
Overview
This module starts with the C++ class checklist and an analysis of its analogues in Java and Python 3. Review 03 (specifically, Example 6) is revisited in the context of UML Class Diagrams.
This module revisits and formalizes the initial and intermediary stages of designing an Object Oriented System. This process starts with Class Discovery and Documentation, then concludes with UML class diagrams.
Three partial Tic-Tac-Toe implementations are used as case studies: one in C++, one in Java, and one in Python 3. Unit Testing is discussed, briefly, in the context of interface design and completeness.
Objectives
After completing this module students will be able to:
- Dissect the class checklist in the context of interface completeness.
- Formulate class checklists for Java and Python 3–in general any language.
- Construct UML Class Diagrams to analyze existing code.
- Leverage UML Class Diagrams to investigate and model a problem domain.
- Explain and track data lifetimes.
- Explain ownership.
Design So Far…
PlantUML
Formalizing UML Class Diagram Syntax
Non-scaling Design
A Better Way (Classification & Relationships)
- Watch Proper Object-Oriented Design
- Tic-tac-toe… Designed Properly
- Discovering and Documenting Classes
- Example: Starting a Domain Model
- Example: Class Relationship Diagrams (Domain Model)
Unit Testing & Process (And Workflows)
- Watch Testing Part 1 - C++ & Java
- Watch Testing Part 2 - Python
- Workflows
- Software Development Processes
6 OOA&D: Use Cases 10/05/2023 - 10/06/2023
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.
We will revisit and refine our Tic-Tac-Toe design.
Objectives
After completing this module students will be able to:
- Utilize UML Sequence Diagrams to model the logic of existing object-oriented code.
- Construct UML Class Diagrams.
- Validate UML Class Diagrams through use of UML Sequence Diagrams.
- Leverage UML Class Diagrams to investigate and model a problem domain.
- Leverage UML Sequence Diagrams to investigate and model a problem domain.
- Watch Continuing Our Tic-Tac-Toe Design
- Continuing Our Tic-Tac-Toe Design
- Use Cases
- Interaction Diagrams
- Example: Further Elaboration on Automated Assessments
7 (Pseudo-Module) Midterm (i.e., Midsemester) Review 10/07/2023 - 10/12/2023
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.
- Review - Head to Head Testing
- Review - Types of Tests
- Review - Makefiles & Command Line Arguments
- Review Assignment 2
- Conceptual Questions - Simple Classes & ADTs
- Using the C++ Class Checklist
- Midsemester Review
- A Quick Sequence Diagram Review
8 Pointers & Sharing & Memory Management 10/13/2023 - 10/17/2023
Overview
This module covers pointers and common memory management misteps, concerns and considerations.
This module covers 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:
- Explain what a pointer stores.
- Explain the difference between a pointer and a reference variable.
- Analyze memory deallocation pitfulls.
- Explain and track data lifetimes.
- Explain why memory management can be a non-trivial problem.
- Summarize the motivation behind smart pointers.
- Explain ownership.
- Summarize garbage collection.
Relevance
All programmers must be familiar with the issues surrounding memory management. This includes lanagues that allow low-level memory allocation (e.g., C
/C++
), garbage collected languages (e.g., Java
and Python
).
The Rust
language is a bit of a special case. Time permitting Rust
may be used as a brief case study.
- Watch Pointer Mechanics Review
- Pointers & Smart Pointers
- Sharing Pointers and Garbage Collection
- OOP in C++: (Part 1) Due: 10/18/2023
9 Object Oriented Programming (OOP) 10/18/2023 - 10/30/2023
Overview
This module discusses the notion of Inheritance in OOP. This includes an exploration subtyping as it relates to inheritance. We introduce 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 C++, the transition to other languages (e.g., Java, Python or Rust) are 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:
- Explain the necessity of pointers for dynamic binding.
- Explain the necessity of references for dynamic binding.
- Implement the Big-3 (or Big-5) alongside an inheritance hierarchy.
- Summarize the difference between overloading and overriding.
- Summarize the difference between inheritance and subtyping.
- Use raw pointers to allow dynamic binding.
- Use
C++14
/C++17
/C++20
smart pointers pointers to allow dynamic binding. - Use reference variables to allow dynamic binding.
- Explain when
= default
and= delete
can be used. - Discuss the Observer-Observable Pattern.
- Discuss the Factory Model.
- (Time permitting) Discuss the Builder Pattern.
Inheritance
Dynamic Binding
- Dynamic Binding: Class-Appropriate behavior
- Watch C++ Shapes: Part 2 (Example 2)
- Watch C++ Shapes: Part 3 (Example 3)
- Watch C++ Shapes: Part 4 (Example 4)
- Watch C++ Shapes: Part 5 (Example 5)
- Making Inheritance Work: C++ Issues
- Inheritance and Dynamic Binding: idioms and common patterns
Modern Syntax & Practices
- Watch C++ Shapes: Part 6 (Example 6)
- Watch C++ Shapes: Part 7 (Example 7)
- Watch C++ Shapes: Part 8 (Example 8)
- Watch C++ Shapes: Part 9 (Example 9)
- Visualizing the Shape Examples with a UML Sequence Diagram
Assignments
- OOP in C++: (Part 2) Due: 10/25/2023
- OOP in C++: (Part 3) Due: 11/03/2023
- End of material covered on the Midterm Exam
10 Preparing for Java & Python & (Maybe) a Little Rust 10/31/2023 - 11/05/2023
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:
- Discuss the C++ and Java entries in the Cross Language Class Checklist.
- Explain the Java Iterator Interface.
- Explain the mechanical differences between C++ and Java iterators.
- Discuss how to approach an unfamiliar language (e.g., Java, Python or Rust).
- Map existing knowledge of object oriented C++ onto Java.
OOP Languages in General
Java & Python
Tools, Tricks & Tips
Python (For Fun and Reference)
11 OOP in Java 11/06/2023 - 11/17/2023
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:
- Explain how Java object variables are conceptually pointers (albeit by a different name).
- Implement the Java Big-not-quite-3 (i.e.,
clone
) alongside an inheritance hierarchy. - Use Java Reference variables to allow dynamic binding.
- Summarize the difference between inheritance and subtyping.
- Discuss the Observer-Observable Pattern.
- Discuss the Factory Pattern.
- Explain how to implement
equals
,hashCode
,toString
, and (sometimes)iterator
. - Define the concept of a Java
package
and compare it to a C++namespace
. - Apply the principles defined by
S.O.L.I.D
in Java. - Apply the
D.R.Y
principle in Java. - (Time permitting) Discuss the Builder Pattern.
- Inheritance in Java
- A Class Designer's Checklist for Java
- Writing a Unit Test - Identifying Mutators & Accessors
- Watch Java Shapes Discussion - Example 1 (Basics of Polymorphism)
- Watch Java Shapes Discussion - Example 2 (Factory Pattern)
- Watch Java Shapes Discussion - Example 3 (Subtyping & Iterators)
- Watch Java Shapes Discussion - Example 4 (Input)
- Asst: OOP in Java (Part 1) Due: 12/01/2023
- Asst: OOP in Java (Part 2) Due: 12/08/2023
Refactoring & Design
- Watch Java Shapes Discussion - Example 5 (A Better Shapefactory)
- Watch Java Shapes Discussion - Example 6 (Replacing
Shape.read
) - Watch Java Shapes Discussion - Example 7 (Separation of Concerns)
- Extra Credit Asst: OOP in Java (Part 3) Due: 12/11/2023
C++ vs Java
12 Applying OOP: GUIs and Threads 11/18/2023 - 12/01/2023
Overview
In this module we discuss Graphical User Interfaces (GUIs) and threads in Java. We briefly cover the principles of multi-threading (parallelism) throught the Runnable
interface..
Objectives
After completing this module students will be able to:
- Discuss the Java Swing classes required to build a GUI.
- Identify the Java Swing classes that represent familiar elements (e.g., buttons, text fields, and text areas).
- Write Java
Listener
s to handle user interaction. - Write Java
Listener
s as Immediate Classes. - Write Lambda functions to to replace Java
Listener
s. - Explain the differences between sequential and multi-threaded programs.
- Explain the different ways to utilize multiple threads (e.g.,
ThreadPool
s). - Define
syncronization
and identify the mechanics involved. - Refactor code to follow either the MVC or M-VC patterns.
Graphic User Interfaces (GUIs)
- Watch Java GUI & Thread Discussion
- Functors - Objects That Act Like Functions
- Java Tutorial: Creating a GUI with JFC/Swing
- Example: Building a Java GUI
GUI Listeners & Lambdas
Multi-Threading
- Watch Java Thread & ThreadPool Discussion
- Threading: Motivation
- Multi-Threading : Doing Things in Parallel
- Java Tutorial: Concurrency
- Case Study: threads in the spreadsheet
13 Additional Design Patterns 12/02/2023 - 12/07/2023
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:
- Analyze lazy evaluation in the context of Generators and Generator Expressions.
- Refactor code to make use of context managers.
- Discuss the Decorator Pattern.
- Discuss Protocols vs. ABCs
- Utilize properties and setters
- Discuss Dependency Injection. Recomendation from Vanguard Dev
- Discuss how to approach an somewhat unfamiliar language (e.g., Java, Python or Rust).
- Map existing knowledge of object oriented Java onto Python.
Python
- Switching to Python
- Structure of a Basic Python Program
- Comprehensions - An Overview
- The Python Class Checklist
- Context Managers
- Python Shapes
- More Python! - Threads (technically processes)
- More Python! - Generator Expressions & Modules
- More Python! - Linked List
Rust
14 Semester Review & Things To Explore 12/08/2023 - 12/10/2023
Overview
This is a pseudo-module. There is no new material (e.g., languages, paradigms ore 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.
Readings to Revisit
Previous Review Materials
- Quarter Semester Review
- Watch C++ Shapes Discussions
- Watch Java Shapes Discussions
- A Quick Sequence Diagram Review
- Midsemester Review
End of Semester Review
Future Work
15 Exams and Special Events
- Refer to the ODU Academic Calendar.
- Classes Start 08/26/2023
- Midterm Exam 10/27/2023 - 10/28/2023
- Final Exam 12/11/2023 - 12/13/2023
16 Postscript
All times in this schedule are given in Eastern Time.
Symbol Key | |
---|---|
Lecture: | |
Slides : | |
Event or important date | |
Read | |
Do lab: | |
Assignment: | |
Take the | |
Do: | |
In your recitation section: | |
Under construction: |
17 Presentation
Topics | Lectures | Readings | Assignments & Other Activities |
---|---|---|---|
topics | lecture slides event exam video project construct | text | exam asst selfassess exam activity lab |
Document Kind | Prefix |
---|---|
lecture | Read lecture notes: |
event | |
exam | Take the exam: |
lab | Do: |
asst | Do assignment: |
reading | Read (optional): |
cs382 |