• Home
  • About

‘Design Patterns’ Archive

The Command Pattern

April 17, 2012, filed under Design Patterns; 2 Comments.
Tags: Actionscript, command pattern, Flex

Here is a quick example of working with the Command Pattern. I made this application related to a box being draggable and scalable, and able to update its color. For each of those commands, we keep a stack in order to do and undo them. download, and preview souce code Drag the box,  use slider [...]

Decorator Pattern – good use

July 27, 2008, filed under Design Patterns; No Comments.
Tags: decorator patterns

A good practice In this collaborative decoration example: var o:AbstractDecorator = new ObjectOfDecoration(); var a:AbstractDecorator = new Decorator[2] ( o ); a = new Decorator[1]( a ); a = new Decorator[0]( a ); Please allow object of decoration to remain encapsulated. As all other decorators can make modifications that can bring unwanted decoration results… It [...]

Decorator Pattern – Decorating among Decorators

, filed under Design Patterns; No Comments.
Tags: chain of decorators, Decorator Pattern

Chain decorators The following is a decoration done independently to the object of decoration. decorator[ 2 ] decorates  Object. decorator[ 1 ] decorates  Object. decorator[ 0 ] decorates Object. This is very direct.. All of the decorators do their work and none of them interact between each other. Consider this as if you were to [...]

Decorator Pattern – Definitions

, filed under Design Patterns; No Comments.
Tags: Commutative, Decorator Pattern

what is commutative and non-commutative? Wikipedia describes Commutative as follows: In mathematics, commutativity is the ability to change the order of something without changing the end result. It is a fundamental property in most branches of mathematics and many proofs depend on it. So non-commtative represents that the order can bring different results. Why we [...]

Categories

  • Actionscript (19)
  • Android (3)
  • CSS (2)
  • Design Patterns (4)
  • Flex (18)
  • Geek (2)
  • Javascript (12)
  • PHP (3)
  • Wordpress (2)

RSS

  • RSS Blog
  • RSS Comments