COMP2511
Course Review
Exam Structure
Prepared by
Dr. Ashesh Mahidadia
Course Review
2COMP2511: Course Review and Exam Structure
Object Oriented Programming in Java: Introduction
• Abstraction
• Encapsulation
• Inheritance (single vs multiple)
• Polymorphism
• Objects, Classes, Interfaces
• Method Forwarding
• Method Overriding
• Generics
• Exceptions
• Domain Modeling
COMP2511: Course Review and Exam Structure 3
Object Oriented Design : Principles
• Encapsulate what varies
• Favour composition over inheritance
• Program to an interface, not an implementation
• Principle of least knowledge (Law of Demeter)
• Liskov’s Substitution Principle
• Classes should be (OCP) open for extension and closed for modification
• Avoid multiple/diverse responsibilities for a class
• Strive for loosely coupled designs between objects that interact
COMP2511: Course Review and Exam Structure 4
Code Smells and Refactoring
v Smells: design aspects that violate fundamental design principles and impact software
quality
v Design Smells vs Code Smells
v Code smells are usually not bugs; they are not technically incorrect and do not prevent
the program from functioning.
v They indicate weaknesses in design that may slow down development or increase the
risk of bugs or failures in the future.
v Regardless of the granularity, smells in general indicate violation of software design
principles, and eventually lead to code that is rigid, fragile and require “refactoring”
v Code refactoring is the process of restructuring existing computer code without
changing its external behavior.
COMP2511: Course Review and Exam Structure 5
Design Patterns
vCreational Patterns
v Abstract Factory
v Factory Method
v Builder
v Singleton
vStructural Patterns
v Adapter
v Composite
v Decorator
COMP2511: Course Review and Exam Structure 6
vBehavioral Patterns
v Iterator
v Observer
v State
v Strategy
v Template
v Visitor
Design Patterns: Creational Patterns
Creational design patterns deal with object creation mechanisms, trying to create objects
in a manner suitable to the situation.
Four well-known creational design patterns:
v Factory method pattern: allows a class to defer instantiation to subclasses.
v Abstract factory pattern: provides an interface for creating related or dependent
objects without specifying the objects’ concrete classes.
v Builder pattern: separates the construction of a complex object from its
representation so that the same construction process can create different
representations.
v Singleton pattern: ensures that a class only has one instance, and provides a global
point of access to it.
COMP2511: Course Review and Exam Structure 7
Design Patterns: Structural Patterns
Structural design patterns are design patterns that ease the design by identifying a simple
way to realize relationships among entities.
Three well-known structural design patterns:
v Adapter pattern: ‘adapts’ one interface for a class into one that a client expects
v Composite pattern: a tree structure of objects where every object has the same
interface (leaf and composite nodes)
v Decorator pattern: add additional functionality to a class at runtime where sub-
classing would result in an exponential rise of new classes.
COMP2511: Course Review and Exam Structure 8
from the corresponding wikipedia page.
Design Patterns: Behavioral Patterns
Behavioral design patterns are design patterns that identify common communication patterns
among objects and realize these patterns. By doing so, these patterns increase flexibility in
carrying out this communication.
Six well-known structural design patterns:
v Iterator pattern: Iterators are used to access the elements of an aggregate object
sequentially without exposing its underlying representation.
v Observer pattern: Objects register to observe an event that may be raised by another
object. Also known as Publish/Subscribe or Event Listener.
v Strategy pattern: Algorithms can be selected at runtime, using composition.
v State pattern: A clean way for an object to partially change its type at runtime.
v Template method pattern: Describes the program skeleton of a program; algorithms
can be selected at runtime, using inheritance.
v Visitor pattern: A way to separate an algorithm from an object.
COMP2511: Course Review and Exam Structure 9
from the corresponding wikipedia page.
Exam Structure
10COMP2511: Course Review and Exam Structure
Final Exam : Structure
Three parts,
v Part 1: Multiple Choice questions (20 marks).
v Part 2: Short Answer (25 marks)
v Part 3: Programming Questions (55 marks)
COMP2511: Course Review and Exam Structure 11
Sample Final Exam
• Go to :
https://www.cse.unsw.edu.au/~cs2511/21T2/SampleExam/
COMP2511: Course Review and Exam Structure 12
https://www.cse.unsw.edu.au/~cs2511/21T2/SampleExam/
Evaluation
v CATEI Evaluation available via myUNSW.
v Tell us what you like/dislike about the course, we do take your input
seriously.
v Thanks …
COMP2511: Course Review and Exam Structure 13
And Finally … …
COMP2511: Course Review and Exam Structure 14
End
COMP2511: Course Review and Exam Structure 15