Professional Documents
Culture Documents
Lab 03
Lab 03
Course code CS2104 Course Title Software Design & Architecture Lab
Instructions:
You must use meaningful names of classes, attributes, methods, etc.
You will not add your name, identity, lab or task number or anything else inside
the document.
Write your file name as “ SAP-ID.pdf ” for example “ 22345.pdf ”.
In case of handwritten task, your presentation/handwriting must be representable.
Warning:
In case of cheating, all members whose files are caught gain zero marks without
any justification.
Marks distributions:
No Requirement Marks
1 Meaningful names 2
2 Problem identified 3
3 Provided solution 5
Demonstration:
Single Responsibility Principle
“A class should have one, and only one, responsibility”
This does not mean that one class will have only one method, there can be
multiple methods but of same type as the type of class.
Open-Close Principle
“Class should be open for extension, but closed for modification”
This requires if you want to add some extra functionality into your program,
you should not add new method. You must create a new class and extend that
class from the previous one.
Liskov Substitution Principle
“Objects in a program should be replaceable with instances of
their subtypes without disrupting the behavior of our program”
This principle requires that if you want to add some new class which extends any
class, then the new class must be completely interchange with its parent class.
Tasks
o Evaluation task
Add TelePhone & SmartPhone classes Add AudioBook, PrintedBook, EBook classes