Design Patterns

ඩිපෙන්ඩන්සි ඉන්ජෙක්ෂන් පැටර්න් එක භාවිතා කරන විට ඩිපෙන්ඩන්සීස් හදන්නේ කෙසේද?

Submitted by Kamal Wickramanayake on සඳු, 11/16/2020 - 23:43

In object oriented design of software, the dependency injection pattern (or inversion of control pattern – abbreviated as IoC pattern) is widely used to avoid key classes from instantiating their dependencies but to accept the dependencies from outside. Accordingly, the concern of object usage and the concern of object instantiation are separated. It is a case where "separation of concerns" is seen.

Factory Method සහ Strategy යන ඩිසයින් පැටර්න් අතර වෙනස

Submitted by Kamal Wickramanayake on සඳු, 11/16/2020 - 22:06

Gang of Four (GoF) collection of design patterns talks about these patterns where the beginners sometimes fail to see the difference between. They often look at the code example of a pattern and attempt to guess what it is but fail to read through the details and understand the real intent of it. The Factory Method and Strategy patterns are coded similarly but with minor code differences. These minor code differences make the two patterns very different in the way they are used and the problems they solve. In this article, I describe these differences.