SOLID In Rails - Open/Closed Principle


Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification

We have notification system


But if we need to chose - send sms or email? So we can add something like if else, but the good way is to create another services
It's a way from Design Patterns.



http://rubyblog.pro/

Comments