You are on page 1of 4

Lab Assessment – 7

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

Important information of a module is Encapsulation The internal details of the


directly accessible by other modules modules must be wrapped to
be hidden, which is not the
case in the given scenario.
Hence, encapsulation is being
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.

Code breaks in unexpected places Sufficiency, If code is breaking into


Completeness and unexpected places then, it
means that a situation is
Primitiveness arriving which the code is not
able to manage. It indicates
that the design which the
code followed, was not
sufficient and complete or it
was not given in a simple
way to be followed. Hence,
Sufficiency, Completeness
and Primitiveness

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.

All data of all classes in public Encapsulation Internal details will be


accessible to all as all the
classes are public which
means they are not wrapped..
Hence it violates
encapsulation.

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.

An algorithm documented as part of Sufficiency, Programmers could not


design is not understandable by the Completeness and understand as the
programmers Primitiveness documented algorithm was
not written in a primitive way
and did not have complete
and sufficient information.
Hence it violates Sufficiency,
Completeness and
Primitiveness.

You might also like