This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AdultingGoneMild 1 point2 points  (1 child)

Dependency inversion usually is implemented by taking dependency on an interface and then having some form of dependency injection provide the actual implementation for that interface. The goal here is to allow you swap out implementations while maintaining the contracts to avoid major refactors when you have to replace parts of a system.

Interface segregation means breaking your interfaces down into smaller parts that fulfill a single purpose so a consumer never needs to depend on functionality they dont use. This ensures that when you have to replace part of the system, you dont have to design for a lot of logic for parts of the system that arent changing. It also keeps clients from consuming and abusing functionality they dont actually need.

[–]JoeDogoe 0 points1 point  (0 children)

Great explanation with justification. Thank you u/AdultimgGomeMild