mirror of
https://github.com/labs42io/clean-code-typescript.git
synced 2024-11-26 22:44:04 +00:00
ISP sample: review formatting
This commit is contained in:
parent
58606c8fce
commit
a3564af820
16
README.md
16
README.md
|
@ -1660,13 +1660,13 @@ What it really means is that you should always design your abstractions in a way
|
|||
**Bad:**
|
||||
|
||||
```ts
|
||||
interface ISmartPrinter {
|
||||
interface SmartPrinter {
|
||||
print();
|
||||
fax();
|
||||
scan();
|
||||
}
|
||||
|
||||
class AllInOnePrinter implements ISmartPrinter {
|
||||
class AllInOnePrinter implements SmartPrinter {
|
||||
print() {
|
||||
// ...
|
||||
}
|
||||
|
@ -1680,7 +1680,7 @@ class AllInOnePrinter implements ISmartPrinter {
|
|||
}
|
||||
}
|
||||
|
||||
class EconomicPrinter implements ISmartPrinter {
|
||||
class EconomicPrinter implements SmartPrinter {
|
||||
print() {
|
||||
// ...
|
||||
}
|
||||
|
@ -1698,19 +1698,19 @@ class EconomicPrinter implements ISmartPrinter {
|
|||
**Good:**
|
||||
|
||||
```ts
|
||||
interface IPrinter {
|
||||
interface Printer {
|
||||
print();
|
||||
}
|
||||
|
||||
interface IFax {
|
||||
interface Fax {
|
||||
fax();
|
||||
}
|
||||
|
||||
interface IScanner {
|
||||
interface Scanner {
|
||||
scan();
|
||||
}
|
||||
|
||||
class AllInOnePrinter implements IPrinter, IFax, IScanner {
|
||||
class AllInOnePrinter implements Printer, Fax, Scanner {
|
||||
print() {
|
||||
// ...
|
||||
}
|
||||
|
@ -1724,7 +1724,7 @@ class AllInOnePrinter implements IPrinter, IFax, IScanner {
|
|||
}
|
||||
}
|
||||
|
||||
class EconomicPrinter implements IPrinter {
|
||||
class EconomicPrinter implements Printer {
|
||||
print() {
|
||||
// ...
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue