A programming paradigm based on objects instead of procedures. It is recognized as a method to effectively dissasemble and construct large and complicated systems and easily and efficiently handle them.
Object-oriented software fulfill the following standards:
Hides the internal details of an object.
Its purpose to is to hide data and create an object that can be easily changed. This allows to easily change the program design.
Javascript pretends to hide a member variable in a class with _
. However, TypeScript can set private member variables that cannot be directly called.
Inheritance refers to a class inheriting the characteristics (functions, variables and data) of another class. A child class can inherit the characteristics of a parent class to avoid writing the same code and allow reusability.
This allows to easily understand the systematic structure through inheritance relationships and maintain consistency.
This refers to when a object (class) performs calculations, each class can be restructured into another form due to its instrinsic properties. As such, polymorphism is using the same method name but being materializes differently by class.
A service's functions can be flexibly changed and expanded by separating the role (역할, interface) and and implementation using polymorphism to override.
Java's overloading (오버로딩) and overriding (오버라이딩) are examples of this.
Refers to newly declaring common parts of objects. This removes unnecessary details and modelizes?(모델화) common and important characteristics of objects.
This allows the user to avoid bothering about the complicated internal structure and use the external interface to write code.
When a class is designed, is is modeled by 1) abstracting common procedures, 2) creating an abstract class, then 3) creating an interface to later allow the class to polymorphize. The interface refers to only defining methods and properties
Refers to the degree of depencency when a object (module or class) depends on another object while collaborating. This also means that when a object is changed, the object it depends on will also change.
Refers to the degree of dependency of how much the object depends on another module.
A high dependency between objects is high in coupling. A high coupling of objects are more likely to change together, making it difficult to make changes.
An acceptable dependency between objects is low/loose in coupling.
Refers to the degree of relationship of internal elements in a module.
An object that only performs a related operation and delegate unrelated operations to another object has high cohesion.
If one method uses more vairables, that method and class has high cohesion.
Coupling can be lowered and cohesion can be increased by creating an autonomous object that processes its own data.
The object must be responsible for its own data to increase its cohesion.
The progrmaming paradigm refers what not to do instead of what to do.
The 3 most popular paradigms are:
1. Structured Programming (구조적 프로그래밍)
Directly proposes rules on the control flow (제어 흐름)
2. Object-Oriented Programming (OOP, 객체 지향 프로그래밍)
Indirectly proposes rules on the control flow
Pros of OOP:
OOP designing:
3. Functional Programming (함수형 프로그래밍)
Proposes rules on assignments
https://devopedia.org/solid-design-principles
One object must have one responsibility. Therefore there should only be one rason to change a class or module. This defines the adequate size of a class.
A sofware entity or an object (class, module, function, etc.) are open to expansion but must be closed to changes.
If you are required to make a small expansion but will have to make great edits to do so, it will result in high development costs.
An object in a program must maintain the program's accurately and can be changed to a lower (child) type instance.
Several interfaces for a certain client is better than one general interface.
The functions unnecessary for the client should not rely on the interface and the interface must be maintained as small as possible, e.g. maintain the interface as small as possible and don't let it depend on unnecessary functions.
The programmer should depend on abstraction, not actualization. The modules on the highest level (domain) should not rely on the lower level modules (substructures)