CSC/ECE 517 Fall 2007/wiki1b 3 an

From Expertiza_Wiki
Revision as of 00:12, 11 October 2007 by Aanayak (talk | contribs)
Jump to navigation Jump to search

We have said that closures in Ruby can be used to implement the Command and Strategy patterns. Closures are useful in implementing various other design patterns too. Explain which patterns, and give examples, using pseudo-Ruby code (i.e., your code should illustrate how to solve the problem with closures in Ruby, but it doesn't actually have to run, if it would be too complicated to give a running example).

Closures

What are Closures?

A Simple Closure Example

Advantages of Closures

Design Pattern

Closures And Design Patterns

Observer Pattern

Description

Typical Uses

Examples

Terminology

Structure

Closures and Observer Pattern

Pseudocode

Iterator Pattern

Description

Typical Uses

Examples

Terminology

Structure

Closures and Iterator Pattern

Pseudocode

References

1. Programming Ruby:The Pragmatic Programmers Guide

2. Head First Design Patterns

3. Design Patterns - Elements Of Reusable Object Oriented Software

External Links

Ruby Standard Library Documentation