Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Correct/Incorrect Example header for OCP. #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 17.SOLID.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ This means that the behavior of a module/class/function can be extended without

Let's consider an example of a `TaxCalculator` class that calculates tax based on the type of product. Initially, the class is not following `OCP`, because **_every time a new tax type is introduced, the class has to be modified._**

#### Correct Example
#### Incorrect Example

```python
class TaxCalculator:
Expand All @@ -138,7 +138,7 @@ class TaxCalculator:
# More conditions for other product types
```

#### Incorrect Example
#### Correct Example

To follow the `OCP`, we can define a generic `TaxCalculator` class and then extend it for each specific tax type.

Expand Down