CSC/ECE 517 Fall 2012/ch2b 2w63 sp: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 12: Line 12:


'''Provides: ''' Deep definition, multiple examples, one diagram
'''Provides: ''' Deep definition, multiple examples, one diagram
= Blackwasp =
[http://www.blackwasp.co.uk/State.aspx Blackwasp.co.uk] gives a slightly more detailed explanation of the pattern than the previous two articles that includes explanations of each part of the implementation diagram of the state pattern.  The article also contains a very different example of using the state pattern in the form of a music player written in C#.  The example is simple in its implementation but also helps to show how useful the pattern can really be.
""Provides: "" Expanded definition, unique coding example, single diagram

Revision as of 15:18, 19 November 2012

Introduction

The State pattern is a simple behavioral design pattern intended to represent the different possible states of an object. The following sites are those found to be helpful in understanding the pattern.

Wikipedia

The Wikiepdia article on the State pattern provides a small overview of the pattern and provides a pair code examples, in Java and pseudocode. The article also provides two diagrams explaining the class layout of the pattern and a basic FSM. The benefit of the article is that it provides quick examples and definitions for reference.

Provides: Simple definition, simple examples, some diagrams


Sourcemaking

Sourcemaking.com provides a much deeper look at the pattern overall, including the intent, problem addressed, and structure of the pattern. The site provides a list of common qualities and rules of thumb seen when using the design pattern. This site's explanation of the pattern is much richer overall and it provides more examples in the same language than found on the Wikipedia article.

Provides: Deep definition, multiple examples, one diagram

Blackwasp

Blackwasp.co.uk gives a slightly more detailed explanation of the pattern than the previous two articles that includes explanations of each part of the implementation diagram of the state pattern. The article also contains a very different example of using the state pattern in the form of a music player written in C#. The example is simple in its implementation but also helps to show how useful the pattern can really be.

""Provides: "" Expanded definition, unique coding example, single diagram