-
Notifications
You must be signed in to change notification settings - Fork 4
Lecture 1 Summary
- Implementor defines the abstraction using lower-level data and processes.
- Client uses the high-level data-type and methods.
Let information be intelligent/meaningful.
If you can extract out a meaningful function within another function, do it.
- Package related data and behaviour in a self-contained unit.
- Hide information/data from the client and allow access only through methods provided.
Code of different functionalities should reside in different classes/places.
The use of
private
access modifiers. This prevents client access to lower-level details of the implementer.
Tell an object what to do, don't ask an object for data and act on it.
Void methods that mutate states should be avoided. Declaring all instance fields as
private final
helps to ensure both encapsulation and immutability.
Avoid two classes requiring each other to be tested.
- Hard dependencies: Instance field/variable references.
- Soft dependencies: Method references.
- LIFO for storing method call records
- Storing all the
new
invocations - Garbage collection
- Metascape, to be discussed later
Illustrations can be found in the lecture slides.
Peer Learning
Guides
Setting Up Checkstyle
Setting Up Java
Setting Up MacVim
Setting Up Stu
Setting Up Unix For Mac
Setting Up Unix For Windows
Setting Up Vim
Setting up SSH Config
SSH Without Password
Copying Files From PE Nodes
Using tmux
CS2030 Contents
Lecture 1 SummaryLecture 2 Summary
Access Modifiers
Lecture 3 Summary (Polymorphism)
Compile Time Type VS Runtime Type
Abstraction, Encapsulation, Inheritance, and Polymorphism
SOLID Principles
Class VS Abstract Class VS Interface
Comparable VS Comparator
Generic Types T
HashMap
Raw Types with Generic
Lambda expression
PECS (Producer Extends Consumer Super)
Optional
Streams
Parallel Streams
Monad
Functors and Monads with Category Theory