By admin on Jan 10, 2008 in .NET, Programming, Structural | 0 Comments
Download Sample Code
Facade Pattern provides a unified interface to a set of interfaces in a subsystem. It defines a higher-level interface that makes the subsystem easier to use.
E.g.
I have a Call Details Record (CDR) to be processed by different systems. It is defined in the CDR class
using System;
using System.Collections.Generic;
using System.Text;
namespace FacadePattern
{
class […]
By admin on Jan 9, 2008 in .NET, Programming, Structural | 0 Comments
Download Sample Code
Decorator Pattern attaches additional responsibilities to an object dynamically and provides a flexible alternative to subclassing for extending functionality.
E.g.
BaseMessage is defined
using System;
using System.Collections.Generic;
using System.Text;
namespace DecoratorPattern
{
abstract class BaseMessage
{
private string sender;
[…]
By admin on Jan 8, 2008 in .NET, Programming, Structural | 0 Comments
Download Sample Code
Proxy Pattern provides a surrogate or placeholder for another object to control access to it.
E.g.
I defined a IGreeting interface
using System;
using System.Collections.Generic;
using System.Text;
namespace ProxyPattern
{
interface IGreeting
{
void SayHello();
}
}
Greeting implements IGreeting
using System;
using System.Collections.Generic;
using System.Text;
namespace ProxyPattern
{
[…]