Application Development Flashcards
there are three (3) important characteristics of a bad design architecture that should be avoided:
Rigidity, Fragility, Immobility
The software is hard to change because every applied change will affect many parts of the software.
Rigidity
When applying changes, unexpected parts of the software breaks..
Fragility
The modules of the software are hard to reuse ins another software because these cannot be extracted from
the current software
Immobility
s are a set of guidelines
to be followed that helps developers arrange methods and data structures into classes,
Design principles
Martin assembled a set of five (5) software design principles, and Michael Feathers arranged these principles into an acronym
called SOLID.
(SRP), (OCP) , (LSP) , (ISP) , (DIP)
S-O-L-I-D
(SRP), (OCP) , (LSP) , (ISP) , (DIP)
This is one of the basic principles most developers apply to build robust and
maintainable software.
S: Single Responsibility Principle (SRP)
This suggests that each software module, class, or interface should have only one (1) reason to
change.
S: Single Responsibility Principle (SRP)
This states that for a software to be easy to change,
O: Open-Closed Principle (OCP)
the software classes must be designed to allow the behavior of those classes to be changed by adding new code rather than changing existing code.
O: Open-Closed Principle (OCP)
Barbara Liskov introduced this principle which states that the derived classes should be substitutable for their base classes to build a software from interchangeable modules or classes.
L: Liskov Substitution Principle (LSP)
This principle advises software designers to avoid depending on things that they don’t use.
I: Interface Segregation Principle (ISP)
This principle suggests that flexible software are those with classes that depend on abstract classes or interfaces.
D: Dependency Inversion Principle (DIP)
The blank instructs developers to design each module, interface, or class of a software system to
have only one (1) responsibility.
Single Responsibility Principle (SRP)
The accounting personnel is responsible
for computing the salary of an employee.
It should use the calculatePay()
method
Single Responsibility Principle (SRP)
The human resource personnel is
responsible for creating a report of hours
of an employee. It should use the
reportHours() method.
Single Responsibility Principle (SRP)
The database administrator is
responsible for saving an employee’s
details. It should use the
saveEmployee() method.
Single Responsibility Principle (SRP)
The blank states that software modules, interfaces, or classes should be open for extension but closed
for modification.
Open-Closed Principle (OCP)
For every newly added method, the unit testing of the software should
be done again.
Open-Closed Principle (OCP)
When a new requirement is added, the maintenance and adding
function may take time.
Open-Closed Principle (OCP)
Adding a new requirement might affect the other functionality of
software even if the new requirement works.
Open-Closed Principle (OCP)
To blank , use an interface,
an abstract class, or abstract methods to
extend the functionality of the class
Implement the OCP
The blank suggests that when creating a new derived class of an existing class, make sure that the
derived class can be a substitute for its base class.
Liskov Substitution Principle (LSP)
The blank should be extended to the level of architecture. A simple violation of substitution can cause a system’s architecture to
break.
LSP
The blank suggests avoiding depending on things that are not used.
Interface Segregation Principle (ISP)
This means that clients
should not be forced to implement interfaces they don’t use. I
Interface Segregation Principle (ISP)
The blank suggests that the most flexible software systems are those in which source code
dependencies refer only to abstractions, not to concretions.
Dependency Inversion Principle (DIP)
software engineer, blank are the reusable solutions to commonly occurring problems in software design.
design patterns
Design patterns are said to have four (4) essential features:
Pattern Name, Problem, Solution, Consequences
This is the name of a pattern that can be used to describe a design problem, its solution, and consequences.
Pattern Name
This describes when to use the pattern. It explains the problem and its context.
Problem
This describes the elements that make up the design, their relationships, responsibilities, and collaborations.
The pattern provides an abstract description of a design problem and how a general arrangement of element solves it.
Solution
These are the results and interchanges of applying the pattern to the problem. They include time and space tradeoffs, but also flexibility, extensibility, and portability, among others.
Consequences
3 Categories of Patterns
Creational Patterns, Structural Patterns, Behavioral Patterns
These patterns deal with when and how objects are created. These provide object creation
mechanisms that increase flexibility and reuse of existing codes.
Creational Patterns
These describe how objects are composed into larger groups and explain how to assemble objects and classes into larger structures while keeping their structures flexible and efficient.
Structural Patterns
These describe how responsibilities are distributed between objects in the design and how communication happens between objects.
Behavioral Patterns
are all about class instantiation. These are patterns that deal with object creation mechanisms, trying
to create objects in a manner suitable to a certain situation.
Creational design patterns
This design pattern lets developers ensure that a class has only one (1) instance while providing a global
access point to the instance.
Singleton Pattern
Ensure that a class has just a single instance. This is to control access to some shared resource—for example, a database
or a file.
Singleton Pattern
. Make the default constructor private to prevent other objects from using the new operator with a Singleton class
Singleton Pattern