Skip to content

Commit

Permalink
SOLID:SRP intro
Browse files Browse the repository at this point in the history
  • Loading branch information
codex31373 committed Dec 27, 2024
1 parent 097a8a7 commit 1311726
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is repo for udemy cpp tasks and exercies
# v 0.01

# vs_code launch.json contents for lld debug
# vs_code launch.json contents for lldb debug

```bash
{
Expand Down
10 changes: 10 additions & 0 deletions design_patterns/solid.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// ---- single responsibility principle (SRP)
class book{}; // this class is responsible for storing information about a book
class magazine{}; // this class is responsible for storing information about a magazine
class printer{}; // this class is responsible for printing, it should not know anything about books or magazines
// every class should have only one responsibility

// ---- open-closed principle (OCP)
// ---- Liskov substitution principle (LSP)
// ---- interface segregation principle (ISP)
// ---- dependency inversion principle (DIP)

0 comments on commit 1311726

Please sign in to comment.