Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass…
Category: Design Patterns
Inheritance vs Composition
What are the reasons for using Inheritance and Composition. Speaking of Inheritance, we refer to class, for Composition we refer to Module. We should know the main idea from this design. Why…
Module in Design Pattern
Have you ever considered about using class inheritance or modules while coding? So, when do we decide to use inheritance instead of module? Coding design is just about arranging code in our…
Four Meta-Design Patterns in ruby
1. Separating out the things that change from those that stay the same. Obviously, we do it to avoid the tight coupled code, get it easy to make changes with less cost….
Common design patterns for javascript
Learning a language programming is pretty simple. People think it’s hard just because they don’t really understand the “way of coding”. We might find that we really understand all of syntaxes but…
Angular Observer Pattern
Observer The Observable pattern is one that allows an object, called subject, to keep track of other objects, called observers, interested in the subject state. When the subject state changes, it notifies its observers…
Best Practices for Database
We learn a lot about programming. How to write a good code which is clean, maintainable, readable, reliable and many other dimensions. However, an ecosystem is not only the code but also…
Template method pattern in real case
Have you ever heard Template Method pattern? We thought we know it but we might be wrong. I just found a secret, a meaning of this pattern. Template method supported by inheritance….
How to have clean code with Isolation or Decoupling pattern
I have been coding for many years. I read many books about clean coding and practising them myself. I found that the rule for clean code is Decoupling. Another the name is…
Ruby on rails with programing to interface pattern
Developing methods of class for other classes to use, that is interface. Interfaces should not be changed time by time. Because that is knowledge which the other classes know about this class. Those are…