Posts

Showing posts with the label Design Patterns

Crisps abt Design Patterns

Problems are hard solve more than that, our solution should not make our appln disobey OCP (Open to extensions and Closed to Modifications) but what if they have a quality solution pre-existing :) That's what design patterns are :P They are generic reusable solutions for commonly occuring problems in S/W Design Design patterns are of various categories if u wanna know them in detail follow the link below Design Patterns :) I was just going thro some of the most commonly used Design Patterns in PHP and I wish to give them all a small introduction Singleton: A common scenario for this is a LOG BOOK. We might be recording various events at various times. So, whenever we need to record something we ll be declaring an object for the log book class and will be WRITING using some member functions of it. But what if we want a "GLOBAL LOG BOOK" for entire appln? Then choose singleton patterns. This pattern allows instantiation of object for a class only once. For Furthe...