CSC/ECE 517 Fall 2007/wiki1b 3 an: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 35: Line 35:
===Pseudocode===
===Pseudocode===
==References==
==References==
[http://www.ruby-doc.org/core/ Ruby Standard Library Documentation]
[http://www.rubycentral.com/pickaxe/ 1. Programming Ruby:The Pragmatic Programmers Guide]


[http://www.amazon.com/Head-First-Design-Patterns/dp/0596007124 2. Head First Design Patterns]
[http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612 3. Design Patterns - Elements Of Reusable Object Oriented Software]


==External Links==
==External Links==


[http://www.ruby-doc.org/core/ Ruby Standard Library Documentation]
[http://www.ruby-doc.org/core/ Ruby Standard Library Documentation]

Revision as of 00:12, 11 October 2007

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