Professional Documents
Culture Documents
Slot : A1
Name of the Student : Anchit Agarwal
Registration Number : 19BCE2279
Title: Software Design Principles
Objective: Identify the design principle that is being violated in relation to the given scenario.
Background:
A good object oriented design not only meets the specified requirements but also addresses
implicit requirements. There are five design principles which address most of the implicit
requirements:
1. Abstraction: Focus on solving a problem by considering the relevant details and ignoring the
irrelevant
2. Encapsulation: Wrapping the internal details, thereby making these details inaccessible.
Encapsulation separates interface and implementation, specifying only the public interface to
the clients, hiding the details of implementation
3. Decomposition and Modularization: Dividing the problem into smaller, independent,
interactive subtasks for placing different functionalities in different components
4. Coupling & Cohesion: Coupling is the degree to which modules are dependent on each other.
Cohesion is the degree to which a module has a single, well defined task or responsibility. A
good design is one with loose coupling and strong cohesion.
5. Sufficiency, Completeness and Primitiveness: Design should ensure the completeness and
sufficiency with respect to the given specifications in a very simple way as possible
Problem Description:
Which of the following design principle(s) have been violated in the following scenarios?
1. Abstraction
2. Decomposition and Modularization
3. Coupling and Cohesion
4. Encapsulation
5. Sufficiency, Completeness and Primitiveness
6. NOTA [None of the Above]
Lab Assessment – 7
Description Principle Being Review Comments
Violated
Too many global variables in the Coupling & Cohesion, If there are too many global
program after implementing the Decomposition and variables then, when a
design Modularization module changes the value of
a variable, other modules will
have to use the updated
value. Here other modules
are dependent on this module
which increases coupling
between modules. Tasks
being performed in modules
now become less well
defined, thereby decreasing
cohesion. Due to many
global variables, different
functionalities cannot be put
into different components.
Hence it is also violating the
policy of decomposition and
modularization.
Unfulfilled requirements in the code Sufficiency, The design which the code
after the design has been implemented followed met with some
Completeness and
unfulfilled requirements. This
Primitiveness indicates that the design
violated the principle of
Sufficiency, Completeness
and Primitiveness.
Cyclic dependency among classes Coupling & Cohesion, Dependency among classes
Decomposition and increases the degree of
Modularization dependency between
different modules and each
module now does not just
have a singler task, thereby
increasing coupling and
decreasing cohesion. The
problem is not divided into
independent pieces of
components and different
functionalities cannot be put
into different components
since they are cyclically
dependent. Hence it also
violates Decomposition and
Modularization.
Huge class doing too many unrelated Abstraction, Irrelevant details are not
operations Decomposition and ignored in the given scenario
Modularization as it is given that it is doing
many unrelated operations.
Hence, abstraction is
violated. Also, it is given that
a huge class is used. Hence,
decomposition and
modularization is violated as
it is not divided into
components performing
different functions. .
Several un-related Decomposition and Performing a number of
functionalities/tasks are carried out Modularization, unrelated functions leads to
by a single module Abstraction irrelevance. Everything is
being done inside a single
module and not several task
based modules. Hence it is
violating Decomposition and
Modularization, Abstraction.
Design resulting in spaghetti code Sufficiency, The design which was used
Completeness and resulted in a code which was
Primitiveness difficult to maintain and
understand. This means that
the design was not sufficient,
complete and sophisticated.
Hence it violates Sufficiency,
Completeness and
Primitiveness.