Skip to main content

Posts

Showing posts from December, 2015

Design Pattern 3: Factory Pattern

Design Pattern 3: Factory Pattern The factory design pattern also falls under the Creational design patterns same as the Singleton pattern. But the scope is different. Ins singleton our scope was the object. Here we focus more on the class. Lets dig deep into this design pattern. What is Factory Pattern? In earlier we talked about the Singleton Pattern where a single object is created and is used throughout the life span of the program. This time its quite different. In Factory pattern what happens is that the user doesn't get to know the actual implementation of the system instead of that all the created objects are referred via an common interface. When I mentioned hiding the implementation you might get some familiar vibe. Yes the concept of polymorphism might have crossed your mind. Actually for the implementation of the Factory design pattern we are using interfaces. Other thing is you might wonder what I ment...

Design Patterns 2 : Singleton

Design Patterns 2 : Singleton  So welcome with the second post on Design patterns and this is gonna be about the Singleton Pattern. In the last post you might remember how I have mentioned the birth of the design patterns and how Developers used it for their convenience and standardization of codes. This will be the first design pattern that will be discussed.  The word Singleton means a Single person. From that itself you can take the Idea about the Singleton. If you remember the previous post (The table with the dimensions Scope and Purpose) you'll see that Singleton belongs to the Creational Design Pattern and to the scope of Objects. Let's discuss this further. The Singleton Design Pattern Singleton is one of the simplest design Patterns out there. The Singleton Design Pattern is used when once instance of an object is used throughout the entire life span of the program. A singleton design associates with a single class and only one single...

Design Patterns 1 : Introduction

Design Patterns : Introduction So its the holiday time and thought of starting with the Design patterns. In this post I'll talk about What are design patterns?, What good to us using them?, Why and when use them? and many more. So why wait? Lets start the journey to Design patterns. What are Design patterns? So over the years when programmers tried to build systems that can solve problems often they encountered problems that were difficult to overcome. So after finding a solution what they did was presenting it as an future guideline where other programmers when encountered the same problem can easily surpass that. These are what we called as Design Patterns. To see how it all started we have to go back in the past. History of Design Patterns? All these patterns buzz started in about 1977/79 when  Christopher Alexander  showed interest in using using pattern in architecture. That's right not in computer, in architectural ...