-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
35 lines (35 loc) · 2.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SOLID</title>
</head>
<body>
<h2>SOLID</h2>
<h3>- Single responsibility principle</h3>
<div id="s-comments"></div>
<h3>- The Open Closed Principle</h3>
<p>Class or function should be open for using and extending but not for modifying.</p>
<p>React lifecycles appropriate to Open-Closed Principle the same as decorators. (example_1)</p>
<p>Transaction classes appropriate to Open-Closed Principle. (example_2)</p>
<h3>- The Liskov Substitution Principle</h3>
<p>subtype that extends the basic class cannot be basic class of another subtype</p>
<p>Input Controller exists. It is basic type for searchPanl, DropdownWithSearch and Textarea.
But SearchPanel cannot be basic for DropDown And Textarea (example_1)</p>
<p>AuthHandler exists. It is basic type for GoogleAuth, FacebookAuth and TwitterAuth.
But GoogleAuth cannot be basic for FacebookAuth And TwitterAuth (auth_ex)</p>
<p>Request exists. It is basic type for User and Topics.
But User cannot be basic for Topics (requests)</p>
<h3>- The Interface Segregation Principle</h3>
<p>If not every subtype can implemnents methods from abstract class, abstract class mustn`t consist it</p>
<p>xbox abstract class exist. It has getKinect method. But not every type of xbox has kinect, so we compelling
to create stumbs.</p>
<p>authAbstract suppose to have some properties. But if we realize ownAuth method, the properties isn`t match with
abstract method. So abstract method need to create right props in advance</p>
<h3>- The Dependency Inversion Principle</h3>
<p>High-level modelu should not depend on details of another module. And vice versa. They should depend ob abstraction</p>
<p>Send message class has message method inside. Message can be created with link. And when parse link, we should ensure that every type of link are accepted</p>
<script src="src/SingleResponsibility/inheritance_es6.js"></script>
<script src="src/SingleResponsibility/composition_es6.js"></script>
</body>
</html>