CS330, Spring 2020

CS330 Outline

Spring 2020

Upcoming Events
1 Course Overview 01/11/2020 - 01/14/2020

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 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.
  5. Log in to atria or sirius.
  6. Use makefiles.
Activities
  1. text Read the syllabus.
  2. text Read the communications policy
  3. event Watch the orientation session
  4. “Meet and Greet” Forum (optional, in Blackboard)
  5. lecture Skim over The Beginning

Office Hours

  1. lecture Review the office hours overview
  2. asst Do assignment: Complete the office hours survey

Looking Forward a Few Weeks…

  1. lecture Read lecture notes: Language Resources
  2. lecture Read lecture notes: Conceptual Questions - Simple Classes & ADTs
  3. lecture Read lecture notes: Using the C++ Class Checklist

Getting Started

  1. lecture Download Review 01 - Linked Lists
2 ADTs in C++ 01/15/2020 - 01/28/2020

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:

  1. Create a project in their preferred IDE (not Dev-C++).
  2. Compile code with a provided makefile.
  3. Discuss what belongs in a header (.h) file.
  4. Discuss what belongs in an implementation (.cpp, .cxx, or .cc) file.
  5. Describe the purpose of inline functions/methods.
  6. Summarize the justification for a formal class checklist.
  7. Describe the emergent nature of a class checklist.
Activities

Review of the Fundamentals

  1. lecture Read lecture notes: Implementing ADTs in C++ Classes
  2. text Read C++ text as needed
  3. lecture Read lecture notes: Designing for ADTs
  4. text Booch, chapter 1 & chapter 2, up to “The Meaning of Hierarchy”
  5. lecture Read lecture notes: ADTs
  6. 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. video 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: 02/04/2020

Future Work

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

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. Discuss what belongs in a header (.h) file with a focus on C++ templates.
  2. Replace data structure specific code (e.g., arrays and linked lists) with iterator and container abstractions.
  3. Describe how to leverage C++ templates to reduce repeated code, when implementing read-only (const) and read-and-write (non-const) iterators.
  4. Describe the motivation behind Move Constructors, Move Assignment, and move semantics.
  5. Analyze the parallels between C++ iterators and Rust iterators.
  6. Explain (and justify) the motivation for UML Class diagrams.
4 Design Discussions (OOA&D) & Case Studies: C++, Java, and Python 3 02/13/2020 - 03/01/2020

Overview (Edits in Progress)

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 UML class diagrams.

This module introduces the basic syntax of Java and Python 3 in preparation for later Modules. 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.

This module includes discussions of workflows and software development processes (introduced in CS 250) in the context of ADT design, implementation, and testing.

Objectives

After completing this module students will be able to:

  1. Dissect the C++ class checklist in the context of interface completeness.
  2. Formulate class checklists for Java and Python 3–in general any language.
  3. Construct UML Class Diagrams to analyze existing C++ code.
  4. Leverage UML Class Diagrams to investigate and model a problem domain.
Activities

Design So Far… Iterators

  1. lecture Read lecture notes: Iterators - The Journey So Far

Language Checklists & PlantUML

  1. video Watch Review 4.1: Whirlwind Introduction to UML Class Diagrams
  2. lecture Read lecture notes: Class Checklists & PlantUML

Formalizing UML Class Diagram Syntax

  1. lecture Read lecture notes: UML Class Relationship Diagrams
  2. text PlantUML Class Diagrams

Non-scaling Design

  1. video Watch Review 4.2: Design the CS 250 Way

A Better Way (Classification & Relationships)

  1. video Watch Review 4.3: Proper Object-Oriented Design
  2. lecture Read lecture notes: Tic-tac-toe… Designed Properly
  3. lecture Read lecture notes: Discovering and Documenting Classes
  4. video Example: Starting a Domain Model
  5. video Example: Class Relationship Diagrams (Domain Model)

Unit Testing & Process (And Workflows)

  1. video Watch Review 4.4: Testing Part 1 - C++ & Java
  2. video Watch Review 4.4: Testing Part 2 - Python
  3. lecture Read lecture notes: Workflows
  4. lecture Read lecture notes: Software Development Processes
5 Midterm (i.e., Midsemester) Review 03/02/2020 - 03/04/2020

Overview

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 Assignment 2
  2. lecture Read lecture notes: Conceptual Questions - Simple Classes & ADTs
  3. lecture Read lecture notes: Using the C++ Class Checklist
  4. lecture Read lecture notes: Midsemester Review
6 Pointers & Sharing & Memory Management 03/05/2020 - 03/20/2020

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.

This Module overlaps Spring Break. I expect you to relax during Spring Break.

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

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.

7 Object Oriented Programming (OOP) 03/21/2020 - 04/04/2020

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:

  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.
  12. (Time permitting) Discuss the Builder Pattern.
Activities

Inheritance

  1. video Watch C++ Shapes: Part 1 (Example 1)
  2. lecture Read lecture notes: Inheritance: The is-a relation

Dynamic Binding

  1. lecture Read lecture notes: Dynamic Binding: Class-Appropriate behavior
  2. video Watch C++ Shapes: Part 2 (Examples 2 & 3)
  3. video Making Inheritance Work: C++ Issues
  4. lecture Read lecture notes: Inheritance and Dynamic Binding: idioms and common patterns
  5. video Watch C++ Shapes: Part 3 (Examples 3 to 6)
  6. video Watch C++ Shapes: Part 4 (Examples 7 & 8)

Modern Syntax & Practices

  1. video (New) Watch C++ Shapes: Part 5 (To Be Recorded)
  2. video (Zoom Recording) C++ Shapes Example 9

Assignments

  1. lecture Read lecture notes: Review Assignment 3
  2. asst Do assignment: OOP in C++: The Fun Part Due: 04/13/2020
  3. lecture Read lecture notes: End of material to be covered on the midterm exam
8 OOA&D: Use Cases 04/05/2020 - 04/09/2020

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.

Our first discussion will be a whirlwind introduction to UML Sequence Diagrams. We will examine the C++ Shapes Example. We will then revisit and refine our Tic-Tac-Toe design.

Objectives

After completing this module students will be able to:

  1. Utilize UML Sequence Diagrams to model the logic of existing object-oriented code.
  2. Construct UML Class Diagrams.
  3. Validate UML Class Diagrams through use of UML Sequence Diagrams.
  4. Leverage UML Class Diagrams to investigate and model a problem domain.
  5. Leverage UML Sequence Diagrams to investigate and model a problem domain.
9 Preparing for Java & Python & (Maybe) a Little Rust 04/08/2020 - 04/11/2020

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)

Python (For Fun and Reference)

  1. lecture Read lecture notes: Switching to Python
10 OOP in Java 04/12/2020 - 04/17/2020

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 Model.
  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. (Time permitting) Discuss the Builder Pattern.
Activities
  1. video Watch Java Shapes Discussion - Part 1 (Examples 1 to 3)
  2. video Zoom Network Conference - Java Shapes (Examples 3 to 5)
  3. video Zoom Network Conference - Java Shapes (Example 6)
  4. lecture Read lecture notes: Inheritance in Java
  5. lecture Read lecture notes: A Class Designer's Checklist for Java
  6. asst Do assignment: Asst: OOP in Java Part 1 Due: 04/24/2020

C++ vs Java

  1. lecture Read lecture notes: Which Language is It?

Extra Credit

  1. asst Do assignment: Asst: OOP in Java Part 2 (Optional) Due: 04/27/2020
11 Applying OOP 04/17/2020 - 04/22/2020

Overview

In this module we discuss Graphical User Interfaces (GUIs) and threads in Java.

  • objects are used to define a graphical interface
  • to handle user interaction (e.g., clicking a button) through Listeners

In this module we discuss the use of Java threads. We briefly cover the principles of multi-threading (parallelism).

We conclude the discussion in the context of the running SpreadSheet example.

Objectives

After completing this module students will be able to:

  1. Discuss the Java Swing classes required to build a GUI.
  2. Define 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.
12 Python (& Maybe Rust) - A Quick Primer 04/20/2020 - 04/26/2020

Overview

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

13 Semester Review & Things To Explore 04/24/2020 - 04/27/2020

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 selected topics from throughput the semester.

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

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 Discussion
  3. video Watch Java Shapes Discussion Part 1 (Examples 1 through 3)
  4. video Zoom Meeting: Java Shapes Examples 3 through 5 04/14/2020, 2:50PM EDT - 4:30PM
  5. video Zoom Meeting: Java Shapes Example 9 04/16/2020, 2:50PM EDT - 4:30PM
  6. 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: A Quick Sequence Diagram Review
  4. lecture Read lecture notes: Using the Java Class Checklist
  5. lecture Read lecture notes: Final (Last) Review

Future Work

  1. lecture Read lecture notes: Language Resources
  2. lecture Read lecture notes: Code Documentation & Comments
14 Zoom Meetings & Supplemental Office Hours

Overview

This section lists Zoom meetings (including previous meetings) and supplemental office hours.

Activities
  1. video Supplemental Office Hours 03/31/2020, 3:00PM EDT - 4:15PM
  2. video Zoom Meeting: C++ Shapes Example 9 04/02/2020, 2:50PM EDT - 4:50PM
  3. video Supplemental Office Hours 04/07/2020, 3:00PM EDT - 4:15PM
  4. video Zoom Meeting: Preparing for Java (and a Little Python) 04/09/2020, 2:50PM EDT - 04/14/2020, 4:30PM EDT
  5. video Zoom Meeting: Java Shapes Examples 3 through 5 04/14/2020, 2:50PM EDT - 4:30PM
  6. video Zoom Meeting: Java Shapes Example 6 04/16/2020, 2:50PM EDT - 4:30PM
  7. video Zoom Meeting: Topic TBD 04/21/2020, 2:50PM EDT - 4:30PM
  8. video Zoom Meeting: Topic TBD 04/23/2020, 2:50PM EDT - 4:30PM
15 Exams and Special Events
Activities
  1. Classes Start 01/11/2020
  2. exam Take the exam: Midterm Exam 03/27/2020 - 03/28/2020
  3. exam Take the exam: Final Exam 04/27/2020, 7:00PM EDT - 04/30/2020, 7:00PM EDT

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: