Skip to content

adithamafadil/dart_solid

Repository files navigation

S.O.L.I.D Principle

Solid Principle, introduced by Robert C. Martin is 5 design principle Object Oriented Programming that purposed to make software designs more understandable, flexible, and maintainable.

Each letters stand for their principles, they are:

This means the class better will not have any changes. So seperate it based on their methods/jobs to their correct classes to make sure it will be easy to maintain. This will connect to the next principle. image

Because class will still remain like the previous, make sure to seperate it from the beginning implementing the first principle. When you need changes or additional feature, then inherit the class will be better than change the existing class. image

When the class inherited from its parent, it may change how the method reach its goal. But don't change it to be useless or doing other stuff out of the method's purposes because user will expect that inherited class will do something there based on its method's purposes/name. Make sure all methods from its parent and its own methods are work as expected. image

Clients should not depend on methods that they don't use. Its fine to define many interfaces to make sure the contract/interface declared and seperated well. Then it will be easier to implement to other class that needs that contract(s). image

This principle taught that developer needs to depend on abstraction, not its detail. The abstraction should not depend on its detail, but the details need to depend to their abstraction. So when the abstraction has more than 1 detail for the implementations, developers only need to change its module that refered by the abstraction according to the implementation of algorithm they need. image

References

Notes

Any feedback feel free to reach me to my LinkedIn, mail, or Instagram

About

S.O.L.I.D example written in Dart

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages