Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd820a1f

Browse files
committed
feat: finished SRP
1 parent75e8b5c commitd820a1f

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

‎README.md‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -819,15 +819,9 @@ class VersionCommentElement:
819819
VersionCommentElement(get_version("pip")).render()
820820
```
821821

822-
결과적으로 클래스는 그 자체를 렌더링 하는 것에만 신경쓰면 됩니다. 클래스는 인스턴트화 중에 버전 텍스트를 받고 이 텍스트는`get_version()`라는 분리된 함수에 의해 생성됩니다. 클래스를 변경하는 것이
823-
The result is that the class only needs to take care of rendering itself. It
824-
receives the version text during instantiation and this text is generated by
825-
calling a separate function,`get_version()`. Changing the class has no impact
826-
on the other, and vice-versa, as long as the contract between them does not
827-
change, i.e. the function provides a string and the class`__init__` method
828-
accepts a string.
829-
830-
As an added bonus, the`get_version()` is now reusable elsewhere.
822+
결과적으로 클래스는 렌더링 그 자체에만 신경쓰면 됩니다. 클래스는 인스턴트화 중에 버전 텍스트를 받고 이 텍스트는`get_version()`라는 분리된 함수에 의해 생성됩니다. 클래스를 변경해도 다른 요소에 영향이 가지 않으며, 이는 반대의 경우에도 마찬가지입니다. 즉, 함수는 문자열을 제공하고 클래스의`__init__` 메서드는 문자열을 수용합니다.
823+
824+
또한,`get_version()` 는 이제 어디서든 재사용할 수 있습니다.
831825

832826
###**Open/Closed Principle (OCP)**
833827

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp