Computer Science 340
Programming Languages
Fall 2019, Siena College
Lecture 29: Abstraction and Encapsulation Wrapup; OOP Implementation Issues
Date: Friday, November 15, 2019
Agenda
- Announcements
- Parameterized ADTs
- Namespace Encapsulation
- Object-Oriented Programming implementation issues
- In-class exercise, related to
/home/cs340/examples/cpplist, for 15 lab/assignment points.
Answer questions in the README.md of your repository. You may
hand in a paper copy of the memory diagram or upload a
scan/photograph to your repository.
- What happens if the friend directive is removed from the
SLLNode class? Why?
- This problem could be avoided by making the SLLNode data
members public. Why would this be problematic?
- Draw a memory diagram showing the call stack and heap as they
exist inside of each call to the SLL::print method.
- When are methods called with the
.
syntax and when with
the ->
syntax and why?
- When is the destructor for each SLL called and why?
- The destructor for SLL is incomplete. Modify it so it
frees all memory.
Terminology
- parameterized ADTs
- autoboxing/autounboxing
- erasure
- namespace encapsulation
- object-oriented programming (OOP) paradigm
- inheritance
- classes
- objects
- derived class/subclass
- parent class/superclass
- extends
- instance variables
- class variables
- instance methods
- class methods
- messages
Examples
Links