Click here to see young celeb models exposed
| Singleton pattern in PHP |
| Published: September 7, 2007, 1:10 pm |
| Tags: Web Development, Application Design, Design Patterns, Object Oriented Programming, Oop, Php, Php 5, Singleton Pattern |
| engine, we can talk about patterns, and better solutions to our applications. Speaking of better solutions, let’s try a simple one, that is called the “singleton pattern” which can be applied in many programming languages, like Java, Python, C#, C++, etc, and now, in PHP. The singleton pattern A singleton pattern is used |
|
|
| * Design Patterns : Gang of Four |
| Published: September 19, 2007, 5:02 am |
| Tags: Productivity, Software Development, Design Patterns, Architecture |
| the implementation of GOF design patterns in CSharp. I wont be discussing the benefits of Design Patterns here ... you can read about them here : Design Patterns. In one line : "They bring best practice for solving common design problems to software development which helps in ensuring success of design and increase in productivity." Here is a |
|
|
| * Pattern : Abstract Factory Creational Pattern |
| Published: September 20, 2007, 2:06 am |
| Tags: Design Patterns, Architecture, Csharp |
| Provides a single interface for creating families of related or dependent objects without using the concrete type name. Consider the following class diagram : In above diagram, CreateShapes acts as an single interface for creating various families of products. The diagram shows only Red shapes but it can be extended to create more color shapes. |
|
|
| * Patterns : Builder Creational Pattern |
| Published: September 21, 2007, 6:00 am |
| Tags: Design Patterns, Tutorials, Architecture, Csharp |
| Builder Creational Pattern separates the process of construction of a complex object from its actual representation. This means that the same process can create different representations of same object. Consider the following diagram : The main class here is ShapeCreator which is called Director and controls the process of construction of |
|
|
| * Patterns : Prototype Creational Pattern |
| Published: September 24, 2007, 3:19 am |
| Tags: Net, Design Patterns, Tutorials, Architecture, Csharp |
| Prototype Creational Pattern provides an interface which can be used by client to get access to already existing instance of a type which can be used as prototype by client to create new instance. Client can clone the existing object using deep or shallow copy and use it. It is used mainly when inherent cost of creating a new object is high. |
|
|
| * Patterns : Factory Method Creational Pattern |
| Published: September 24, 2007, 12:46 am |
| Tags: Net, Design Patterns, Tutorials, Architecture, Csharp |
| It provides an interface for creating an object but lets subclass decide which class to instantiates. So, it can also be called as virtual constructor. Consider the following class diagram : ShapeCreator class provides an factory method to create objects of BaseShape. Client always uses ShapeCreator and BaseShape type variables to work on |
|
|
| * Singleton Creational Pattern |
| Published: September 28, 2007, 12:40 am |
| Tags: Net, Design Patterns, Tutorials, Architecture, Csharp |
| One of the most popular creational pattern. It is used to restrict the number of instances of a type to one and so all clients use the same instance. Consider the following class diagram : Client creates two variables of type Singleton, s1 and s2. The client code looks like following : public class Client Singleton s1,s2; |
|
|
| * Patterns : Adapter Structural Pattern |
| Published: October 3, 2007, 4:10 am |
| Tags: Net, Design Patterns, Tutorials, Architecture, Csharp |
| than what client has been designed for. Clients continue using the original definitions and adapter takes care of transformation. Consider the class diagram below : Client calls the ClientBase class which is client's default framework. Now Client is supposed to use FrameworkBase which has Print method instead of PrintString method. Now |
|
|
| * Patterns : Bridge Structural Pattern |
| Published: October 5, 2007, 1:24 am |
| Tags: Net, Design Patterns, Tutorials, Architecture, Csharp |
| Bridge Structural Pattern decouples an abstraction from its implementation so that the two can vary independently. Multiple variants of abstraction can be created provided they implement the common interface. Similarly, multiple variants of implementations can be created provided they implement the common interface. Given the option of multiple |
|
|
| * Patterns : Composite Structural Pattern |
| Published: October 9, 2007, 12:38 am |
| Tags: Net, Design Patterns, Tutorials, Architecture, Csharp |
| Composite Structural Pattern is applicable when you need to deal with whole-part kind of relationships or tree kind of structures. It helps client to deal with individual or composite objects in a uniform manner and thus abstracts the client from complexities of internal structure. Consider the following class diagram : In the above diagram |
|
|
| * Patterns : Decorator Structural Pattern |
| Published: October 15, 2007, 6:22 am |
| Tags: Net, Design Patterns, Architecture, Csharp |
| The primary use of 'Decorator Structural Pattern' is to add behaviors to object at runtime. It generally involves wrapping the original object with the decorator object which adds the new behaviors but keep the structure of original object intact. Multiple behaviors can be added out of given options based on decision criteria. Consider the class |
|
|
| * Patterns : Facade Structural Pattern |
| Published: October 18, 2007, 6:39 am |
| Tags: Net, Design Patterns, Tutorials, Architecture, Csharp |
| 'Facade Structural Pattern' is primarily used to unify and simply a set of interfaces of subsystems. This helps the client in using the interface with less effort. Consider the class diagram below : Above shows a typical scenario of a Bank where a new Customer approaches the Bank to open new account and also deposit some initial amount. |
|
|
| * Patterns : Flyweight Structural Pattern |
| Published: November 6, 2007, 12:32 am |
| Tags: Net, Design Patterns, Tutorials, Architecture, Csharp |
| Flyweight Structural Pattern is used to manage large number of shared objects. They are maintained in a collection and same instances used whenever required. These objects have their own attributes/features but they can have a common feature also which can be externalized. Consider a scenario where a picture has to be drawn which consists of |
|
|
| An inside look at the Pattern Library |
| Published: December 7, 2007, 2:06 pm |
| Tags: Design, Yui Theater, Brown Bag, Design Patterns, Hci, Pattern Library, Patterns, Process, Theater, Video, Xian |
| the library, updating the patterns, and shepherding a new generation of patterns through our internal refinement and review process, with an eye toward identifying useful social and openness patterns that we can share with the whole Web. So when people come up to me at conferences or find me on mailing lists for information architects and |
|
|
| Sample Chapter Pro JavaScript Design Patterns by Ross Harmes and Dustin Diaz |
| Published: December 17, 2007, 2:46 pm |
| Tags: Development, Apress, Dustin Diaz, Flyweight Pattern, Javascript Design Patterns, Ross Harmes |
| Apress, Pro JavaScript Design Patterns. As the title suggests, this volume focuses on the implementation of common object-oriented design patterns in the JavaScript language. Ross and Dustin “wanted to show programmers that JavaScript contains features on par with other high-level languages and is an object-oriented programming |
|
|