buddybear
@deadass
100 Following
124 Followers
1 reply
6 recasts
3 reactions
6 replies
1 recast
17 reactions
0 reply
3 recasts
28 reactions
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
1 reply
10 recasts
21 reactions
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
3 recasts
15 reactions
0 reply
0 recast
0 reaction
0 reply
1 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
3 reactions
0 reply
0 recast
0 reaction
4. I - Interface Segregation Principle (ISP)
βClients should not be forced to depend on methods they do not use.β
ISP suggests splitting large, complex interfaces into smaller, more specific ones. This way, classes implementing an interface only need to be concerned with the methods relevant to them. By segregating interfaces, you make the code more flexible and avoid βfatβ interfaces that force classes to implement unused methods.
Example: In a drawing app, rather than having one big Drawable interface with methods for drawCircle, drawSquare, drawTriangle, break it into smaller interfaces like CircleDrawable, SquareDrawable, etc., so classes only implement what they need. 0 reply
0 recast
0 reaction
0 reply
3 recasts
6 reactions
0 reply
0 recast
0 reaction
7 replies
19 recasts
122 reactions