Have been thinking about putting together a collection of Jump Start Tutorials on some core concepts on Programming, finally getting everything together Design Patterns GOF: Adapter Pattern GOF: Strategy Pattern GOF: Singleton Pattern (Lazy) GOF: Fascade Pattern GOF: Chain Of Responsibility Pattern (CoR) GOF: Template Method GOF: Null Object Pattern GOF: State Pattern GOF: Decorator … Continue reading Patterns,Principles and Programming.
Category: Best Practices
Design Patterns : Strategy Pattern
If there is one thing that is constant in every software development projects, then it has to be CHANGE. Requirements evolve overtime and you might end up with fairly different set of requirements that you initially started of. As developers one has to be aware of the possibility of change and design applications that are flexible … Continue reading Design Patterns : Strategy Pattern
Design Patterns : Adapter Pattern
There is already a large amount of literature on the Internet which discusses Adapter Pattern. However, the purpose of article is to showcase the implementations of the Adapter Pattern, rather than discussing the application of the pattern. In this post, adapter class is implemented using 1. Inheritance 2. Dependency Injection 3. Generics Consider your old … Continue reading Design Patterns : Adapter Pattern
SOLID : Open / Closed Principle
The Open / Closed Principle focuses on one basic requirement, the classes should be Open for extensions, but closed for modification. The better way to explain the principle would be to first express the issue in hand. Consider the below class. The class itself looks good, but what if in future one needs to add … Continue reading SOLID : Open / Closed Principle
SOLID : Single Responsibility Principle
While OOPs is rich with features like inheritance, polymorphism, encapsulation and overloading enabling developers to extract more from modern day programming languages like C#, it is equally important to understand when to use these features based on design principles. SOLID, is a set of 5 principles which when properly applied intend to guide a programmer … Continue reading SOLID : Single Responsibility Principle
Singleton using Lazy(T)
Singleton Design Pattern is probably the simplest and most straightforward design pattern. So instead of explaining further, let me get to the code. The whole idea behind the above implementation of Singleton is to make use of the Lazy(T) class provided by Framework 4.0 and provide a lazy initialized version of the pattern, in addition … Continue reading Singleton using Lazy(T)