<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ehanders</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ehanders"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Ehanders"/>
	<updated>2026-07-21T23:41:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43329</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43329"/>
		<updated>2010-12-02T06:41:26Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* Dynamically Named Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel Implementations of Design Patterns in Dynamic Languages=&lt;br /&gt;
&lt;br /&gt;
Dynamic languages such as Ruby and Javascript allow many novel implementations of the design patterns we cover in previous chapters, which would not be possible or feasible in complied languages such as Java and C. Language features only available in dynamic languages give developers an increased amount of flexibility in how they can implement design patterns. These language features and the some examples of the implementations they allow are detailed in this section, with a focus on implementations in the Ruby language.&lt;br /&gt;
&lt;br /&gt;
=Language Features=&lt;br /&gt;
&lt;br /&gt;
&amp;quot;These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them&amp;quot; [http://en.wikipedia.org/wiki/Dynamic_programming_language]. Some of the most helpful tools are as follows:&lt;br /&gt;
&lt;br /&gt;
==Closures==&lt;br /&gt;
&lt;br /&gt;
Closures are a feature that allow blocks of code to be passed around as arguments to functions. Closures are also known as lambdas or procs in Ruby. The code in a closure has access to all variables in the scope where it was created, and it can have additional data passed in as parameters to the closure from the caller. [http://jibbering.com/faq/notes/closures/]&lt;br /&gt;
&lt;br /&gt;
==eval==&lt;br /&gt;
&lt;br /&gt;
In dynamic languages, any arbitrary code can be executed dynamically at runtime. This can include code that is generated from user input. This is a subset of metaprogramming. Eval is explored further in section 3E.&lt;br /&gt;
&lt;br /&gt;
==Reflection==&lt;br /&gt;
&lt;br /&gt;
Reflection is the ability of a language to inspect the different methods exist on an object. Reflection is explored further in section 1C.&lt;br /&gt;
&lt;br /&gt;
==Runtime Object Modification==&lt;br /&gt;
&lt;br /&gt;
Dynamic languages allow metaprogramming, or the ability of the program to modify itself, creating or adding to objects and classes. This is explored further in section 4G.&lt;br /&gt;
&lt;br /&gt;
==Dynamically Named Methods==&lt;br /&gt;
&lt;br /&gt;
Dynamic languages often allow objects to handle method calls to methods that do not exist. In ruby, method_missing provides this functionality.&lt;br /&gt;
&lt;br /&gt;
=Design Pattern Implementations=&lt;br /&gt;
&lt;br /&gt;
==Strategy Pattern==&lt;br /&gt;
&lt;br /&gt;
Using '''closures''', dynamic languages are able to simply pass in blocks of code that implement the strategy to be used.&lt;br /&gt;
&lt;br /&gt;
For example, the Ruby sort method accepts a closure block, with which you can pass in the sorting metric.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt; list = [&amp;quot;10&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;]&lt;br /&gt;
 =&amp;gt; [&amp;quot;10&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;]&lt;br /&gt;
 &amp;gt;&amp;gt; list.sort{|a, b| a.length &amp;lt;=&amp;gt; b.length}  # length strategy&lt;br /&gt;
 =&amp;gt; [&amp;quot;5&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;10&amp;quot;]&lt;br /&gt;
 &amp;gt;&amp;gt; list.sort{|a, b| a.to_i &amp;lt;=&amp;gt; b.to_i}      # integer strategy&lt;br /&gt;
 =&amp;gt; [&amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;, &amp;quot;10&amp;quot;]&lt;br /&gt;
 &amp;gt;&amp;gt; list.sort{|a, b| a &amp;lt;=&amp;gt; b}                # string strategy&lt;br /&gt;
 =&amp;gt; [&amp;quot;10&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
These strategies can also be stored and used later or chosen based on a conditional. For example:&lt;br /&gt;
&lt;br /&gt;
 length_strategy = lambda {|a, b| a.length &amp;lt;=&amp;gt; b.length}&lt;br /&gt;
 list.sort(&amp;amp;length_strategy)&lt;br /&gt;
&lt;br /&gt;
==Command Pattern==&lt;br /&gt;
&lt;br /&gt;
Using '''eval''' or '''send''', one can implement the command pattern. This is implemented in Ruby on Rails' ActionController. A web application user enters a URL, which is the a form of a command. The URL typically contains the name of the controller and the action (command) that is to be executed on that controller. &lt;br /&gt;
&lt;br /&gt;
The application checks to see if the a method with the action name exists in the controller and runs that method if so. Checking to see if the method exists is an example of class '''reflection'''. Without this language capability, the controller would have to keep an external list of its actions.&lt;br /&gt;
&lt;br /&gt;
==Object Relational Mapping==&lt;br /&gt;
&lt;br /&gt;
Ruby on Rails' ActiveRecord implementation of the Object Relational Mapping (ORM) pattern uses '''runtime object modification''' and '''dynamically named methods''' to achieve a very clean implementation.&lt;br /&gt;
&lt;br /&gt;
===Runtime Object Modification===&lt;br /&gt;
&lt;br /&gt;
Every ActiveRecord model contains accessors for each field in the corresponding database table. These accessors are created at runtime and do not require the programmer to manually create and update accessors for each field in the database. It does this by inspecting the database and adding accessor methods to the model's class for each field.&lt;br /&gt;
[http://ar.rubyonrails.org] This allows for much cleaner model code.&lt;br /&gt;
&lt;br /&gt;
===Dynamically Named Methods===&lt;br /&gt;
By overriding Ruby's method_missing method in models, ActiveRecord can look for certain patterns in method calls on the models where no method is explicitly defined. One such example is &amp;lt;code&amp;gt;find_all_by_FIELD_NAME()&amp;lt;/code&amp;gt;, where FIELD_NAME can be any field in the model's database table. Using these convenience methods, the models can be less cluttered, and Rails developers can write code that is easier to read.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Dynamic programming languages have several features which allow for novel ways to implement existing design patterns. These implementations are simpler and far less tedious than their compiled language counterparts.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Wikipedia. Dynamic programming language. 2 October 2010. http://en.wikipedia.org/wiki/Dynamic_programming_language&lt;br /&gt;
# Cornford, Richard. Javascript Closures. March 2004. http://jibbering.com/faq/notes/closures&lt;br /&gt;
# 37Signals. Active Record — Object-relation mapping put on rails. 27 June 2008. http://ar.rubyonrails.org&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43328</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43328"/>
		<updated>2010-12-02T06:39:35Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel Implementations of Design Patterns in Dynamic Languages=&lt;br /&gt;
&lt;br /&gt;
Dynamic languages such as Ruby and Javascript allow many novel implementations of the design patterns we cover in previous chapters, which would not be possible or feasible in complied languages such as Java and C. Language features only available in dynamic languages give developers an increased amount of flexibility in how they can implement design patterns. These language features and the some examples of the implementations they allow are detailed in this section, with a focus on implementations in the Ruby language.&lt;br /&gt;
&lt;br /&gt;
=Language Features=&lt;br /&gt;
&lt;br /&gt;
&amp;quot;These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them&amp;quot; [http://en.wikipedia.org/wiki/Dynamic_programming_language]. Some of the most helpful tools are as follows:&lt;br /&gt;
&lt;br /&gt;
==Closures==&lt;br /&gt;
&lt;br /&gt;
Closures are a feature that allow blocks of code to be passed around as arguments to functions. Closures are also known as lambdas or procs in Ruby. The code in a closure has access to all variables in the scope where it was created, and it can have additional data passed in as parameters to the closure from the caller. [http://jibbering.com/faq/notes/closures/]&lt;br /&gt;
&lt;br /&gt;
==eval==&lt;br /&gt;
&lt;br /&gt;
In dynamic languages, any arbitrary code can be executed dynamically at runtime. This can include code that is generated from user input. This is a subset of metaprogramming. Eval is explored further in section 3E.&lt;br /&gt;
&lt;br /&gt;
==Reflection==&lt;br /&gt;
&lt;br /&gt;
Reflection is the ability of a language to inspect the different methods exist on an object. Reflection is explored further in section 1C.&lt;br /&gt;
&lt;br /&gt;
==Runtime Object Modification==&lt;br /&gt;
&lt;br /&gt;
Dynamic languages allow metaprogramming, or the ability of the program to modify itself, creating or adding to objects and classes. This is explored further in section 4G.&lt;br /&gt;
&lt;br /&gt;
==Dynamically Named Methods==&lt;br /&gt;
&lt;br /&gt;
Dynamic languages often allow objects to handle method calls to methods that do not exist. In ruby, method_missing provides this functionality.&lt;br /&gt;
&lt;br /&gt;
=Design Pattern Implementations=&lt;br /&gt;
&lt;br /&gt;
==Strategy Pattern==&lt;br /&gt;
&lt;br /&gt;
Using '''closures''', dynamic languages are able to simply pass in blocks of code that implement the strategy to be used.&lt;br /&gt;
&lt;br /&gt;
For example, the Ruby sort method accepts a closure block, with which you can pass in the sorting metric.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt; list = [&amp;quot;10&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;]&lt;br /&gt;
 =&amp;gt; [&amp;quot;10&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;]&lt;br /&gt;
 &amp;gt;&amp;gt; list.sort{|a, b| a.length &amp;lt;=&amp;gt; b.length}  # length strategy&lt;br /&gt;
 =&amp;gt; [&amp;quot;5&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;10&amp;quot;]&lt;br /&gt;
 &amp;gt;&amp;gt; list.sort{|a, b| a.to_i &amp;lt;=&amp;gt; b.to_i}      # integer strategy&lt;br /&gt;
 =&amp;gt; [&amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;, &amp;quot;10&amp;quot;]&lt;br /&gt;
 &amp;gt;&amp;gt; list.sort{|a, b| a &amp;lt;=&amp;gt; b}                # string strategy&lt;br /&gt;
 =&amp;gt; [&amp;quot;10&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
These strategies can also be stored and used later or chosen based on a conditional. For example:&lt;br /&gt;
&lt;br /&gt;
 length_strategy = lambda {|a, b| a.length &amp;lt;=&amp;gt; b.length}&lt;br /&gt;
 list.sort(&amp;amp;length_strategy)&lt;br /&gt;
&lt;br /&gt;
==Command Pattern==&lt;br /&gt;
&lt;br /&gt;
Using '''eval''' or '''send''', one can implement the command pattern. This is implemented in Ruby on Rails' ActionController. A web application user enters a URL, which is the a form of a command. The URL typically contains the name of the controller and the action (command) that is to be executed on that controller. &lt;br /&gt;
&lt;br /&gt;
The application checks to see if the a method with the action name exists in the controller and runs that method if so. Checking to see if the method exists is an example of class '''reflection'''. Without this language capability, the controller would have to keep an external list of its actions.&lt;br /&gt;
&lt;br /&gt;
==Object Relational Mapping==&lt;br /&gt;
&lt;br /&gt;
Ruby on Rails' ActiveRecord implementation of the Object Relational Mapping (ORM) pattern uses '''runtime object modification''' and '''dynamically named methods''' to achieve a very clean implementation.&lt;br /&gt;
&lt;br /&gt;
===Runtime Object Modification===&lt;br /&gt;
&lt;br /&gt;
Every ActiveRecord model contains accessors for each field in the corresponding database table. These accessors are created at runtime and do not require the programmer to manually create and update accessors for each field in the database. It does this by inspecting the database and adding accessor methods to the model's class for each field.&lt;br /&gt;
[http://ar.rubyonrails.org] This allows for much cleaner model code.&lt;br /&gt;
&lt;br /&gt;
===Dynamically Named Methods===&lt;br /&gt;
By overriding Ruby's method_missing method in models, ActiveRecord can look for certain patterns in method calls on the models where no method is explicitly defined. One such pattern is &amp;lt;code&amp;gt;find_all_by_FIELD_NAME&amp;lt;/code&amp;gt;, where FIELD_NAME can be any field in the model's database table. Using these convenience methods, the models can be less cluttered, and Rails developers can write code that is easier to read.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Dynamic programming languages have several features which allow for novel ways to implement existing design patterns. These implementations are simpler and far less tedious than their compiled language counterparts.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Wikipedia. Dynamic programming language. 2 October 2010. http://en.wikipedia.org/wiki/Dynamic_programming_language&lt;br /&gt;
# Cornford, Richard. Javascript Closures. March 2004. http://jibbering.com/faq/notes/closures&lt;br /&gt;
# 37Signals. Active Record — Object-relation mapping put on rails. 27 June 2008. http://ar.rubyonrails.org&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43326</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43326"/>
		<updated>2010-12-02T06:35:21Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel Implementations of Design Patterns in Dynamic Languages=&lt;br /&gt;
&lt;br /&gt;
Dynamic languages such as Ruby and Javascript allow many novel implementations of the design patterns we cover in previous chapters, which would not be possible or feasible in complied languages such as Java and C. Language features only available in dynamic languages give developers an increased amount of flexibility in how they can implement design patterns. These language features and the some examples of the implementations they allow are detailed in this section, with a focus on implementations in the Ruby language.&lt;br /&gt;
&lt;br /&gt;
=Language Features=&lt;br /&gt;
&lt;br /&gt;
&amp;quot;These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them&amp;quot; [http://en.wikipedia.org/wiki/Dynamic_programming_language]. Some of the most helpful tools are as follows:&lt;br /&gt;
&lt;br /&gt;
==Closures==&lt;br /&gt;
&lt;br /&gt;
Closures are a feature that allow blocks of code to be passed around as arguments to functions. Closures are also known as lambdas or procs in Ruby. The code in a closure has access to all variables in the scope where it was created, and it can have additional data passed in as parameters to the closure from the caller. [http://jibbering.com/faq/notes/closures/]&lt;br /&gt;
&lt;br /&gt;
==eval==&lt;br /&gt;
&lt;br /&gt;
In dynamic languages, any arbitrary code can be executed dynamically at runtime. This can include code that is generated from user input. This is a subset of metaprogramming. Eval is explored further in section 3E.&lt;br /&gt;
&lt;br /&gt;
==Reflection==&lt;br /&gt;
&lt;br /&gt;
Reflection is the ability of a language to inspect the different methods exist on an object. Reflection is explored further in section 1C.&lt;br /&gt;
&lt;br /&gt;
==Runtime Object Modification==&lt;br /&gt;
&lt;br /&gt;
Dynamic languages allow metaprogramming, or the ability of the program to modify itself, creating or adding to objects and classes. This is explored further in section 4G.&lt;br /&gt;
&lt;br /&gt;
==Dynamically Named Methods==&lt;br /&gt;
&lt;br /&gt;
Dynamic languages often allow objects to handle method calls to methods that do not exist. In ruby, method_missing provides this functionality.&lt;br /&gt;
&lt;br /&gt;
=Design Pattern Implementations=&lt;br /&gt;
&lt;br /&gt;
==Strategy Pattern==&lt;br /&gt;
&lt;br /&gt;
Using '''closures''', dynamic languages are able to simply pass in blocks of code that implement the strategy to be used.&lt;br /&gt;
&lt;br /&gt;
For example, the Ruby sort method accepts a closure block, with which you can pass in the sorting metric.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt; list = [&amp;quot;10&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;]&lt;br /&gt;
 =&amp;gt; [&amp;quot;10&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;]&lt;br /&gt;
 &amp;gt;&amp;gt; list.sort{|a, b| a.length &amp;lt;=&amp;gt; b.length}  # length strategy&lt;br /&gt;
 =&amp;gt; [&amp;quot;5&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;10&amp;quot;]&lt;br /&gt;
 &amp;gt;&amp;gt; list.sort{|a, b| a.to_i &amp;lt;=&amp;gt; b.to_i}      # integer strategy&lt;br /&gt;
 =&amp;gt; [&amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;, &amp;quot;10&amp;quot;]&lt;br /&gt;
 &amp;gt;&amp;gt; list.sort{|a, b| a &amp;lt;=&amp;gt; b}                # string strategy&lt;br /&gt;
 =&amp;gt; [&amp;quot;10&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
These strategies can also be stored and used later or chosen based on a conditional. For example:&lt;br /&gt;
&lt;br /&gt;
 length_strategy = lambda {|a, b| a.length &amp;lt;=&amp;gt; b.length}&lt;br /&gt;
 list.sort(&amp;amp;length_strategy)&lt;br /&gt;
&lt;br /&gt;
==Command Pattern==&lt;br /&gt;
&lt;br /&gt;
Using '''eval''' or '''send''', one can implement the command pattern. This is implemented in Ruby on Rails' ActionController. A web application user enters a URL, which is the a form of a command. The URL typically contains the name of the controller and the action (command) that is to be executed on that controller. &lt;br /&gt;
&lt;br /&gt;
The application checks to see if the a method with the action name exists in the controller and runs that method if so. Checking to see if the method exists is an example of class '''reflection'''. Without this language capability, the controller would have to keep an external list of its actions.&lt;br /&gt;
&lt;br /&gt;
==Object Relational Mapping==&lt;br /&gt;
&lt;br /&gt;
Ruby on Rails' ActiveRecord implementation of the Object Relational Mapping (ORM) pattern uses '''runtime object modification''' and '''dynamically named methods''' to achieve a very clean implementation.&lt;br /&gt;
&lt;br /&gt;
===Runtime Object Modification===&lt;br /&gt;
&lt;br /&gt;
Every ActiveRecord model contains accessors for each field in the corresponding database table. These accessors are created at runtime and do not require the programmer to manually create and update accessors for each field in the database. It does this by inspecting the database and adding accessor methods to the model's class for each field.&lt;br /&gt;
[http://ar.rubyonrails.org] This allows for much cleaner model code.&lt;br /&gt;
&lt;br /&gt;
===Dynamically Named Methods===&lt;br /&gt;
By overriding Ruby's method_missing method in models, ActiveRecord can look for certain patterns in method calls on the models where no method is explicitly defined. One such pattern is &amp;lt;code&amp;gt;find_all_by_FIELD_NAME&amp;lt;/code&amp;gt;, where FIELD_NAME can be any field in the model's database table. Using these convenience methods, the models can be less cluttered, and Rails developers can write code that is easier to read.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Wikipedia. Dynamic programming language. 2 October 2010. http://en.wikipedia.org/wiki/Dynamic_programming_language&lt;br /&gt;
# Cornford, Richard. Javascript Closures. March 2004. http://jibbering.com/faq/notes/closures&lt;br /&gt;
# 37Signals. Active Record — Object-relation mapping put on rails. 27 June 2008. http://ar.rubyonrails.org&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43324</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43324"/>
		<updated>2010-12-02T06:29:51Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel Implementations of Design Patterns in Dynamic Languages=&lt;br /&gt;
&lt;br /&gt;
Dynamic languages such as Ruby and Javascript allow many novel implementations of the design patterns we cover in previous chapters, which would not be possible or feasible in complied languages such as Java and C. Language features only available in dynamic languages give developers an increased amount of flexibility in how they can implement design patterns. These language features and the some examples of the implementations they allow are detailed in this section, with a focus on implementations in the Ruby language.&lt;br /&gt;
&lt;br /&gt;
=Language Features=&lt;br /&gt;
&lt;br /&gt;
&amp;quot;These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them&amp;quot; [http://en.wikipedia.org/wiki/Dynamic_programming_language]. Some of the most helpful tools are as follows:&lt;br /&gt;
&lt;br /&gt;
==Closures==&lt;br /&gt;
&lt;br /&gt;
Closures are a feature that allow blocks of code to be passed around as arguments to functions. Closures are also known as lambdas or procs in Ruby. The code in a closure has access to all variables in the scope where it was created, and it can have additional data passed in as parameters to the closure from the caller. [http://jibbering.com/faq/notes/closures/]&lt;br /&gt;
&lt;br /&gt;
==Reflection==&lt;br /&gt;
&lt;br /&gt;
Reflection is the ability of a language to inspect the different methods exist on an object. Reflection is explored further in section 1C.&lt;br /&gt;
&lt;br /&gt;
==eval==&lt;br /&gt;
&lt;br /&gt;
In dynamic languages, any arbitrary code can be executed dynamically at runtime. This can include code that is generated from user input. This is a subset of metaprogramming. Eval is explored further in section 3E.&lt;br /&gt;
&lt;br /&gt;
==Runtime Object Modification==&lt;br /&gt;
&lt;br /&gt;
Dynamic languages allow metaprogramming, or the ability of the program to modify itself, creating or adding to objects and classes. This is explored further in section 4G.&lt;br /&gt;
&lt;br /&gt;
==Dynamically Named Methods==&lt;br /&gt;
&lt;br /&gt;
Dynamic languages often allow objects to handle method calls to methods that do not exist. In ruby, method_missing provides this functionality.&lt;br /&gt;
&lt;br /&gt;
=Design Pattern Implementations=&lt;br /&gt;
&lt;br /&gt;
==Strategy Pattern==&lt;br /&gt;
&lt;br /&gt;
Using '''closures''', dynamic languages are able to simply pass in blocks of code that implement the strategy to be used.&lt;br /&gt;
&lt;br /&gt;
For example, the Ruby sort method accepts a closure block, with which you can pass in the sorting metric.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt; list = [&amp;quot;10&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;]&lt;br /&gt;
 =&amp;gt; [&amp;quot;10&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;]&lt;br /&gt;
 &amp;gt;&amp;gt; list.sort{|a, b| a.length &amp;lt;=&amp;gt; b.length}  # length strategy&lt;br /&gt;
 =&amp;gt; [&amp;quot;5&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;10&amp;quot;]&lt;br /&gt;
 &amp;gt;&amp;gt; list.sort{|a, b| a.to_i &amp;lt;=&amp;gt; b.to_i}      # integer strategy&lt;br /&gt;
 =&amp;gt; [&amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;, &amp;quot;10&amp;quot;]&lt;br /&gt;
 &amp;gt;&amp;gt; list.sort{|a, b| a &amp;lt;=&amp;gt; b}                # string strategy&lt;br /&gt;
 =&amp;gt; [&amp;quot;10&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
These strategies can also be stored and used later or chosen based on a conditional. For example:&lt;br /&gt;
&lt;br /&gt;
 length_strategy = lambda {|a, b| a.length &amp;lt;=&amp;gt; b.length}&lt;br /&gt;
 list.sort(&amp;amp;length_strategy)&lt;br /&gt;
&lt;br /&gt;
==(reflection)==&lt;br /&gt;
&lt;br /&gt;
==Command Pattern==&lt;br /&gt;
&lt;br /&gt;
Using '''eval''' or '''send''', one can implement the command pattern. This is implemented in Ruby on Rails' ActionController. A web application user enters a URL, which is the a form of a command. The URL typically contains the name of the controller and the action (command) that is to be executed on that controller. The application checks to see if the a method with the action name exists in the controller and runs that method if so.&lt;br /&gt;
&lt;br /&gt;
==Object Relational Mapping==&lt;br /&gt;
&lt;br /&gt;
Ruby on Rails' ActiveRecord implementation of the Object Relational Mapping (ORM) pattern uses '''runtime object modification''' and '''dynamically named methods''' to achieve a very clean implementation.&lt;br /&gt;
&lt;br /&gt;
===Runtime Object Modification===&lt;br /&gt;
&lt;br /&gt;
Every ActiveRecord model contains accessors for each field in the corresponding database table. These accessors are created at runtime and do not require the programmer to manually create and update accessors for each field in the database. It does this by inspecting the database and adding accessor methods to the model's class for each field.&lt;br /&gt;
[http://ar.rubyonrails.org] This allows for much cleaner model code.&lt;br /&gt;
&lt;br /&gt;
===Dynamically Named Methods===&lt;br /&gt;
By overriding Ruby's method_missing method in models, ActiveRecord can look for certain patterns in method calls on the models where no method is explicitly defined. One such pattern is &amp;lt;code&amp;gt;find_all_by_FIELD_NAME&amp;lt;/code&amp;gt;, where FIELD_NAME can be any field in the model's database table. Using these convenience methods, the models can be less cluttered, and Rails developers can write code that is easier to read.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Wikipedia. Dynamic programming language. 2 October 2010. http://en.wikipedia.org/wiki/Dynamic_programming_language&lt;br /&gt;
# Cornford, Richard. Javascript Closures. March 2004. http://jibbering.com/faq/notes/closures&lt;br /&gt;
# 37Signals. Active Record — Object-relation mapping put on rails. 27 June 2008. http://ar.rubyonrails.org&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43322</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43322"/>
		<updated>2010-12-02T06:27:24Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel Implementations of Design Patterns in Dynamic Languages=&lt;br /&gt;
&lt;br /&gt;
Dynamic languages such as Ruby and Javascript allow many novel implementations of the design patterns we cover in previous chapters, which would not be possible or feasible in complied languages such as Java and C. Language features only available in dynamic languages give developers an increased amount of flexibility in how they can implement design patterns. These language features and the some examples of the implementations they allow are detailed in this section, with a focus on implementations in the Ruby language.&lt;br /&gt;
&lt;br /&gt;
=Language Features=&lt;br /&gt;
&lt;br /&gt;
&amp;quot;These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them&amp;quot; [http://en.wikipedia.org/wiki/Dynamic_programming_language]. Some of the most helpful tools are as follows:&lt;br /&gt;
&lt;br /&gt;
==Closures==&lt;br /&gt;
&lt;br /&gt;
Closures are a feature that allow blocks of code to be passed around as arguments to functions. Closures are also known as lambdas or procs in Ruby. The code in a closure has access to all variables in the scope where it was created, and it can have additional data passed in as parameters to the closure from the caller. [http://jibbering.com/faq/notes/closures/]&lt;br /&gt;
&lt;br /&gt;
==Runtime Object Modification==&lt;br /&gt;
&lt;br /&gt;
Dynamic languages allow metaprogramming, or the ability of the program to modify itself, creating or adding to objects and classes. This is explored further in section 4G.&lt;br /&gt;
&lt;br /&gt;
==eval==&lt;br /&gt;
&lt;br /&gt;
In dynamic languages, any arbitrary code can be executed dynamically at runtime. This can include code that is generated from user input. This is a subset of metaprogramming. Eval is explored further in section 3E.&lt;br /&gt;
&lt;br /&gt;
==Reflection==&lt;br /&gt;
&lt;br /&gt;
Reflection is the ability of a language to inspect the different methods exist on an object. Reflection is explored further in section 1C.&lt;br /&gt;
&lt;br /&gt;
==Dynamically Named Methods==&lt;br /&gt;
&lt;br /&gt;
Dynamic languages often allow objects to handle method calls to methods that do not exist. In ruby, method_missing provides this functionality.&lt;br /&gt;
&lt;br /&gt;
=Design Pattern Implementations=&lt;br /&gt;
&lt;br /&gt;
==Strategy Pattern==&lt;br /&gt;
&lt;br /&gt;
Using closures, dynamic languages are able to simply pass in blocks of code that implement the strategy to be used.&lt;br /&gt;
&lt;br /&gt;
For example, the Ruby sort method accepts a closure block, with which you can pass in the sorting metric.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt; list = [&amp;quot;10&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;]&lt;br /&gt;
 =&amp;gt; [&amp;quot;10&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;]&lt;br /&gt;
 &amp;gt;&amp;gt; list.sort{|a, b| a.length &amp;lt;=&amp;gt; b.length}  # length strategy&lt;br /&gt;
 =&amp;gt; [&amp;quot;5&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;10&amp;quot;]&lt;br /&gt;
 &amp;gt;&amp;gt; list.sort{|a, b| a.to_i &amp;lt;=&amp;gt; b.to_i}      # integer strategy&lt;br /&gt;
 =&amp;gt; [&amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;, &amp;quot;10&amp;quot;]&lt;br /&gt;
 &amp;gt;&amp;gt; list.sort{|a, b| a &amp;lt;=&amp;gt; b}                # string strategy&lt;br /&gt;
 =&amp;gt; [&amp;quot;10&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;5&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
These strategies can also be stored and used later or chosen based on a conditional. For example:&lt;br /&gt;
&lt;br /&gt;
 length_strategy = lambda {|a, b| a.length &amp;lt;=&amp;gt; b.length}&lt;br /&gt;
 list.sort(&amp;amp;length_strategy)&lt;br /&gt;
&lt;br /&gt;
==(reflection)==&lt;br /&gt;
&lt;br /&gt;
==Command Pattern==&lt;br /&gt;
&lt;br /&gt;
Using '''eval''' or '''send''', one can implement the command pattern. This is implemented in Ruby on Rails' ActionController. A web application user enters a URL, which is the a form of a command. The URL typically contains the name of the controller and the action (command) that is to be executed on that controller. The application checks to see if the a method with the action name exists in the controller and runs that method if so.&lt;br /&gt;
&lt;br /&gt;
==Object Relational Mapping==&lt;br /&gt;
&lt;br /&gt;
Ruby on Rails' ActiveRecord implementation of the Object Relational Mapping (ORM) pattern uses '''runtime object modification''' and '''dynamically named methods''' to achieve a very clean implementation.&lt;br /&gt;
&lt;br /&gt;
===Runtime Object Modification===&lt;br /&gt;
&lt;br /&gt;
Every ActiveRecord model contains accessors for each field in the corresponding database table. These accessors are created at runtime and do not require the programmer to manually create and update accessors for each field in the database. It does this by inspecting the database and adding accessor methods to the model's class for each field.&lt;br /&gt;
[http://ar.rubyonrails.org] This allows for much cleaner model code.&lt;br /&gt;
&lt;br /&gt;
===Dynamically Named Methods===&lt;br /&gt;
By overriding Ruby's method_missing method in models, ActiveRecord can look for certain patterns in method calls on the models where no method is explicitly defined. One such pattern is &amp;lt;code&amp;gt;find_all_by_FIELD_NAME&amp;lt;/code&amp;gt;, where FIELD_NAME can be any field in the model's database table. Using these convenience methods, the models can be less cluttered, and Rails developers can write code that is easier to read.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Wikipedia. Dynamic programming language. 2 October 2010. http://en.wikipedia.org/wiki/Dynamic_programming_language&lt;br /&gt;
# Cornford, Richard. Javascript Closures. March 2004. http://jibbering.com/faq/notes/closures&lt;br /&gt;
# 37Signals. Active Record — Object-relation mapping put on rails. 27 June 2008. http://ar.rubyonrails.org&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43315</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43315"/>
		<updated>2010-12-02T05:46:13Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel Implementations of Design Patterns in Dynamic Languages=&lt;br /&gt;
&lt;br /&gt;
Dynamic languages such as Ruby and Javascript allow many novel implementations of the design patterns we cover in previous chapters, which would not be possible or feasible in complied languages such as Java and C. Language features only available in dynamic languages give developers an increased amount of flexibility in how they can implement design patterns. These language features and the some examples of the implementations they allow are detailed in this section, with a focus on implementations in the Ruby language.&lt;br /&gt;
&lt;br /&gt;
=Language Features=&lt;br /&gt;
&lt;br /&gt;
&amp;quot;These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them&amp;quot; [http://en.wikipedia.org/wiki/Dynamic_programming_language]. Some of the most helpful tools are as follows:&lt;br /&gt;
&lt;br /&gt;
==Closures==&lt;br /&gt;
&lt;br /&gt;
Closures are a feature that allow blocks of code to be passed around as arguments to functions. Closures are also known as lambdas or procs in Ruby. The code in a closure has access to all variables in the scope where it was created, and it can have additional data passed in as parameters to the closure from the caller. [http://jibbering.com/faq/notes/closures/]&lt;br /&gt;
&lt;br /&gt;
==Runtime Object Modification==&lt;br /&gt;
&lt;br /&gt;
Dynamic languages allow metaprogramming, or the ability of the program to modify itself, creating or adding to objects and classes. This is explored further in section 4G.&lt;br /&gt;
&lt;br /&gt;
==eval==&lt;br /&gt;
&lt;br /&gt;
In dynamic languages, any arbitrary code can be executed dynamically at runtime. This can include code that is generated from user input. This is a subset of metaprogramming. Eval is explored further in section 3E.&lt;br /&gt;
&lt;br /&gt;
==Reflection==&lt;br /&gt;
&lt;br /&gt;
Reflection is the ability of a language to inspect the different methods exist on an object. Reflection is explored further in section 1C.&lt;br /&gt;
&lt;br /&gt;
==Dynamically Named Methods==&lt;br /&gt;
&lt;br /&gt;
Dynamic languages often allow objects to handle method calls to methods that do not exist. In ruby, method_missing provides this functionality.&lt;br /&gt;
&lt;br /&gt;
=Design Pattern Implementations=&lt;br /&gt;
&lt;br /&gt;
==(Closures)==&lt;br /&gt;
&lt;br /&gt;
==(reflection)==&lt;br /&gt;
&lt;br /&gt;
==Command Pattern==&lt;br /&gt;
&lt;br /&gt;
Using '''eval''' or '''send''', one can implement the command pattern. This is implemented in Ruby on Rails' ActionController. A web application user enters a URL, which is the a form of a command. The URL typically contains the name of the controller and the action (command) that is to be executed on that controller. The application checks to see if the a method with the action name exists in the controller and runs that method if so.&lt;br /&gt;
&lt;br /&gt;
==Object Relational Mapping==&lt;br /&gt;
&lt;br /&gt;
Ruby on Rails' ActiveRecord implementation of the Object Relational Mapping (ORM) pattern uses '''runtime object modification''' and '''dynamically named methods''' to achieve a very clean implementation.&lt;br /&gt;
&lt;br /&gt;
===Runtime Object Modification===&lt;br /&gt;
&lt;br /&gt;
Every ActiveRecord model contains accessors for each field in the corresponding database table. These accessors are created at runtime and do not require the programmer to manually create and update accessors for each field in the database. It does this by inspecting the database and adding accessor methods to the model's class for each field.&lt;br /&gt;
[http://ar.rubyonrails.org] This allows for much cleaner model code.&lt;br /&gt;
&lt;br /&gt;
===Dynamically Named Methods===&lt;br /&gt;
By overriding Ruby's method_missing method in models, ActiveRecord can look for certain patterns in method calls on the models where no method is explicitly defined. One such pattern is &amp;lt;code&amp;gt;find_all_by_FIELD_NAME&amp;lt;/code&amp;gt;, where FIELD_NAME can be any field in the model's database table. Using these convenience methods, the models can be less cluttered, and Rails developers can write code that is easier to read.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Wikipedia. Dynamic programming language. 2 October 2010. http://en.wikipedia.org/wiki/Dynamic_programming_language&lt;br /&gt;
# Cornford, Richard. Javascript Closures. March 2004. http://jibbering.com/faq/notes/closures&lt;br /&gt;
# 37Signals. Active Record — Object-relation mapping put on rails. 27 June 2008. http://ar.rubyonrails.org&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43294</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43294"/>
		<updated>2010-12-02T04:35:46Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* Language Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel Implementations of Design Patterns in Dynamic Languages=&lt;br /&gt;
&lt;br /&gt;
Dynamic languages such as Ruby and Javascript allow many novel implementations of the design patterns we cover in previous chapters, which would not be possible or feasible in complied languages such as Java and C. Language features only available in dynamic languages give developers an increased amount of flexibility in how they can implement design patterns. These language features and the some examples of the implementations they allow are detailed in this section.&lt;br /&gt;
&lt;br /&gt;
=Language Features=&lt;br /&gt;
&lt;br /&gt;
&amp;quot;These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them&amp;quot; [http://en.wikipedia.org/wiki/Dynamic_programming_language]. Some of the most helpful tools are as follows:&lt;br /&gt;
&lt;br /&gt;
==Closures==&lt;br /&gt;
&lt;br /&gt;
Closures are a feature that allow blocks of code to be passed around as arguments to functions. Closures are also known as lambdas or procs in Ruby. The code in a closure has access to all variables in the scope where it was created, and it can have additional data passed in as parameters to the closure from the caller. [http://jibbering.com/faq/notes/closures/]&lt;br /&gt;
&lt;br /&gt;
==Object Runtime Evaluation==&lt;br /&gt;
&lt;br /&gt;
Dynamic languages allow metaprogramming, or the ability of the program to modify itself, creating or adding to objects and classes. This is explored further in section 4G.&lt;br /&gt;
&lt;br /&gt;
==eval==&lt;br /&gt;
&lt;br /&gt;
In dynamic languages, any arbitrary code can be executed dynamically at runtime. This can include code that is generated from user input. This is a subset of metaprogramming. Eval is explored further in section 3E.&lt;br /&gt;
&lt;br /&gt;
==Reflection==&lt;br /&gt;
&lt;br /&gt;
Reflection is the ability of a language to inspect the different methods exist on an object. Reflection is explored further in section 1C.&lt;br /&gt;
&lt;br /&gt;
==Dynamically Named Methods==&lt;br /&gt;
&lt;br /&gt;
Dynamic languages often allow objects to handle method calls to methods that do not exist. In ruby, method_missing provides this functionality.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Wikipedia. Dynamic programming language. 2 October 2010. http://en.wikipedia.org/wiki/Dynamic_programming_language&lt;br /&gt;
# Cornford, Richard. Javascript Closures. March 2004. http://jibbering.com/faq/notes/closures/&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43253</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43253"/>
		<updated>2010-12-02T03:56:43Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* eval */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel Implementations of Design Patterns in Dynamic Languages=&lt;br /&gt;
&lt;br /&gt;
Dynamic languages such as Ruby and Javascript allow many novel implementations of the design patterns we cover in previous chapters, which would not be possible or feasible in complied languages such as Java and C. Language features only available in dynamic languages give developers an increased amount of flexibility in how they can implement design patterns. These language features and the some examples of the implementations they allow are detailed in this section.&lt;br /&gt;
&lt;br /&gt;
=Language Features=&lt;br /&gt;
&lt;br /&gt;
&amp;quot;These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them&amp;quot; [http://en.wikipedia.org/wiki/Dynamic_programming_language]. Some of the most helpful tools are as follows:&lt;br /&gt;
&lt;br /&gt;
==Closures==&lt;br /&gt;
&lt;br /&gt;
Closures are a feature that allow blocks of code to be passed around as arguments to functions. Closures are also known as lambdas or procs in Ruby. The code in a closure has access to all variables in the scope where it was created, and it can have additional data passed in as parameters to the closure from the caller. [http://jibbering.com/faq/notes/closures/]&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming==&lt;br /&gt;
&lt;br /&gt;
Dynamic languages allow metaprogramming, or the ability of the program to modify itself, creating or adding to classes. This is explored further in section 4G.&lt;br /&gt;
&lt;br /&gt;
===eval===&lt;br /&gt;
&lt;br /&gt;
In dynamic languages, any arbitrary code can be executed dynamically at runtime. This can include code that is generated from user input. This is a subset of metaprogramming. Eval is explored further in section 3E.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Wikipedia. Dynamic programming language. 2 October 2010. http://en.wikipedia.org/wiki/Dynamic_programming_language&lt;br /&gt;
# Cornford, Richard. Javascript Closures. March 2004. http://jibbering.com/faq/notes/closures/&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43247</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43247"/>
		<updated>2010-12-02T03:50:34Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* Closures */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel Implementations of Design Patterns in Dynamic Languages=&lt;br /&gt;
&lt;br /&gt;
Dynamic languages such as Ruby and Javascript allow many novel implementations of the design patterns we cover in previous chapters, which would not be possible or feasible in complied languages such as Java and C. Language features only available in dynamic languages give developers an increased amount of flexibility in how they can implement design patterns. These language features and the some examples of the implementations they allow are detailed in this section.&lt;br /&gt;
&lt;br /&gt;
=Language Features=&lt;br /&gt;
&lt;br /&gt;
&amp;quot;These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them&amp;quot; [http://en.wikipedia.org/wiki/Dynamic_programming_language]. Some of the most helpful tools are as follows:&lt;br /&gt;
&lt;br /&gt;
==Closures==&lt;br /&gt;
&lt;br /&gt;
Closures are a feature that allow blocks of code to be passed around as arguments to functions. Closures are also known as lambdas or procs in Ruby. The code in a closure has access to all variables in the scope where it was created, and it can have additional data passed in as parameters to the closure from the caller. [http://jibbering.com/faq/notes/closures/]&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming==&lt;br /&gt;
&lt;br /&gt;
===eval===&lt;br /&gt;
&lt;br /&gt;
In dynamic languages, any arbitrary code can be executed dynamically at runtime. This can include code that is generated from user input. This is a subset of metaprogramming.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Wikipedia. Dynamic programming language. 2 October 2010. http://en.wikipedia.org/wiki/Dynamic_programming_language&lt;br /&gt;
# Cornford, Richard. Javascript Closures. March 2004. http://jibbering.com/faq/notes/closures/&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43243</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43243"/>
		<updated>2010-12-02T03:47:02Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel Implementations of Design Patterns in Dynamic Languages=&lt;br /&gt;
&lt;br /&gt;
Dynamic languages such as Ruby and Javascript allow many novel implementations of the design patterns we cover in previous chapters, which would not be possible or feasible in complied languages such as Java and C. Language features only available in dynamic languages give developers an increased amount of flexibility in how they can implement design patterns. These language features and the some examples of the implementations they allow are detailed in this section.&lt;br /&gt;
&lt;br /&gt;
=Language Features=&lt;br /&gt;
&lt;br /&gt;
&amp;quot;These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them&amp;quot; [http://en.wikipedia.org/wiki/Dynamic_programming_language]. Some of the most helpful tools are as follows:&lt;br /&gt;
&lt;br /&gt;
==Closures==&lt;br /&gt;
&lt;br /&gt;
[http://jibbering.com/faq/notes/closures/]&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming==&lt;br /&gt;
&lt;br /&gt;
===eval===&lt;br /&gt;
&lt;br /&gt;
In dynamic languages, any arbitrary code can be executed dynamically at runtime. This can include code that is generated from user input. This is a subset of metaprogramming.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Wikipedia. Dynamic programming language. 2 October 2010. http://en.wikipedia.org/wiki/Dynamic_programming_language&lt;br /&gt;
# Cornford, Richard. Javascript Closures. March 2004. http://jibbering.com/faq/notes/closures/&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43231</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43231"/>
		<updated>2010-12-02T03:31:43Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* Novel Implementations of Design Patterns in Dynamic Languages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel Implementations of Design Patterns in Dynamic Languages=&lt;br /&gt;
&lt;br /&gt;
Dynamic languages such as Ruby and Javascript allow many novel implementations of the design patterns we cover in previous chapters, which would not be possible or feasible in complied languages such as Java and C. Language features only available in dynamic languages give developers an increased amount of flexibility in how they can implement design patterns. These language features and the some examples of the implementations they allow are detailed in this section.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43229</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43229"/>
		<updated>2010-12-02T03:30:10Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* Novel Implementations of Design Patterns in Dynamic Languages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel Implementations of Design Patterns in Dynamic Languages=&lt;br /&gt;
&lt;br /&gt;
Dynamic languages such as Ruby and Javascript allow many novel implementations of design patterns which would not be possible or feasible in complied languages such as Java and C. Language features only available in dynamic languages give developers an increased amount of flexibility in how they can implement design patterns. These language features and the some examples of the implementations they allow are detailed in this section.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch1_S10_ms&amp;diff=43225</id>
		<title>CSC/ECE 517 Fall 2010/ch1 S10 ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch1_S10_ms&amp;diff=43225"/>
		<updated>2010-12-02T03:28:57Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: 7a,7e&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[CSC/ECE 517 Fall 2010/ch1 1a vc]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch1 1a br]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch1 1b mg]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch1 1c JF]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch1 1e az]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch1 1e bb]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch1 1f vn]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch1 25 ag]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch2 2b dg]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch1 2e RI]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch1 S6 aa]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch1 S6 km]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch1 S10 GP]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch1 S10 MS]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch1 S10 MM]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch1 S10 PH]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch2 2a CB]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch2 2a mw]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch2 2c ck]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch2 S23 GP]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch2 S24 NS]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch2 S23 SS]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch2 S23 NR]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch2 S20 TT]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch2 2d AS]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch2 S24 rm]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch3 3a SN]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch3 3b ka]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch3 3e br]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch3 3f lj]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch3 3h az]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch3 3h PW]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch3 3i IC]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch3 3i MM]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch3 3j KS]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch3 S30 SK]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch3 4b mt]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch4 4e ms]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch4 4f sv]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch4 4g HW]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch4 4g km]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch4 4h am]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch5 5b mt]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch5 5b jz]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch5 5c ck]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch5 5c IC]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch5 5f SN]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch5 5a KR]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch5 5b RR]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch5 5e ms]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/chd 6d isb]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch6 6b SK]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch6 6c AW]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch6 6d bb]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch6 6h AS]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch6 6f AZ]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch6 6b AK]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch6 6g ss]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch6 6d NM]]&lt;br /&gt;
&lt;br /&gt;
*[[ CSC/ECE 517 Fall 2010/ch6 6a PC]]&lt;br /&gt;
&lt;br /&gt;
*[[ CSC/ECE 517 Fall 2010/ch2 4d RB]]&lt;br /&gt;
&lt;br /&gt;
*[[ CSC/ECE 517 Fall 2010/ch7 71 ed]]&lt;br /&gt;
&lt;br /&gt;
*[[ CSC/ECE 517 Fall 2010/ch7 7c ed]]&lt;br /&gt;
&lt;br /&gt;
*[[ CSC/ECE 517 Fall 2010/ch7 7e GP]]&lt;br /&gt;
&lt;br /&gt;
*[[ CSC/ECE 517 Fall 2010/ch7 7e GS]]&lt;br /&gt;
&lt;br /&gt;
*[[ CSC/ECE 517 Fall 2010/ch7 7f PW]]&lt;br /&gt;
&lt;br /&gt;
*[[ CSC/ECE 517 Fall 2010/ch7 7g ms]]&lt;br /&gt;
&lt;br /&gt;
*[[ CSC/ECE 517 Fall 2010/ch7 7i sr]]&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43206</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43206"/>
		<updated>2010-12-02T03:10:42Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel Implementations of Design Patterns in Dynamic Languages=&lt;br /&gt;
&lt;br /&gt;
=References=&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43191</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7c ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43191"/>
		<updated>2010-12-02T02:56:36Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* Disadvantages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Pure Fabrication=&lt;br /&gt;
Pure Fabrication is a design pattern in which objects are created that do not correlate directly to real-world objects. This is generally used to achieve low cohesion and high coupling, as discussed in previous chapters. Although low cohesion and high coupling is an important design principle, fabricating objects that do not exist in the problem domain may lead to problems [http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx], thus classifying it as an anti-pattern.&lt;br /&gt;
&lt;br /&gt;
Pure Fabrication is the second [http://en.wikipedia.org/wiki/GRASP_(object-oriented_design) GRASP] (General Responsibility Assignment Software Principles) principle covered in this chapter. All of these are general principles that &amp;quot;help aid developers in assigning responsibilities to objects&amp;quot; [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx].&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Larman, the author of this design principle, provides an example of the Pure Fabrication pattern in his book ''Applying UML and Patterns''. [http://www.amazon.com/Applying-UML-Patterns-Introduction-Object-Oriented/dp/0130925691/ref=sr_11_1?ie=UTF8&amp;amp;qid=1216994566&amp;amp;sr=11-1]&lt;br /&gt;
&lt;br /&gt;
Scenario: A retail sales application contains the classes Sale and DatabaseA. The Sale class represents a purchase transaction, and DatabaseA is the database backend it is stored in.&lt;br /&gt;
&lt;br /&gt;
With only these two objects, the Sale class would need to contain the logic required to persist a sale to the database, which violates high cohesion. If DatabaseA were to change, the Sale class would also have to change. This violates low coupling [http://www.ibm.com/developerworks/rational/library/jun07/cuellar/].&lt;br /&gt;
If the database were to change to DatabaseB, an adapter would be required, as visualized in Figure 1:&lt;br /&gt;
&lt;br /&gt;
[[Image:Wiki3A.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Figure 1'''&lt;br /&gt;
&lt;br /&gt;
Instead, one could create a Broker class in the initial design that sits between the Sale and database, as in Figure 2 below: &lt;br /&gt;
&lt;br /&gt;
[[Image:Wiki3B.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Figure 2'''&lt;br /&gt;
&lt;br /&gt;
The Broker would contain all the logic necessary to take the data from a Sale-like object and all the logic needed to persist that data in the database. Sale and other Sale-like objects would all interact with Broker in the same way and would not need to know about the database, thus achieving high cohesion. If the DatabaseA is replaced with DatabaseB, only the Broker class must change, thus achieving low coupling. Since there is no Broker concept in the problem domain, this qualifies as a Pure Fabrication.&lt;br /&gt;
&lt;br /&gt;
==Similar Patterns==&lt;br /&gt;
&lt;br /&gt;
===Adapter===&lt;br /&gt;
&lt;br /&gt;
This is similar to the Adapter pattern, except for a few key differences. The Adapter pattern applies when a new class is created to sit in the middle of to two existing classes that interact, such as in Figure 1. This does not decrease coupling or increase cohesion. Instead, the Broker class is part of the initial design, and the Sale never has to know how to interact with a database [3].&lt;br /&gt;
&lt;br /&gt;
===Controllers in MVC===&lt;br /&gt;
&lt;br /&gt;
In the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model View Controller pattern], the Controller could be viewed as a Pure Fabrication, because it does not represent a concept in the problem domain. Instead, it is a layer that sits in between the Views and Models, allowing each to main high cohesion and low coupling [http://www.martinfowler.com/eaaDev/PassiveScreen.html]. MVC is such a common application of the Pure Fabrication principle that it has become its own design principle.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
In many cases, adhering excessively to the low cohesion principle makes things more complicated and harder to maintain. &amp;quot;Obviously if you are building frameworks and reusable components the idea of low coupling and coding to interfaces is important, but I have seen and done this myself in the past with custom / opinionated software as a 'just-in-case.' In more times than not, this just-in-case type of development leads to over-architected and hard to maintain software&amp;quot; [1].&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Hayden, David. Over-Architecting Via Pure Fabrication and Indirection to Reduce Coupling. 26 Aug 2006. http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx&lt;br /&gt;
# Hayden, David. Pure Fabrication GRASP Pattern - Software Design Patterns and Principles - Applying UML and Patterns - Domain-Driven Design. 18 September 2005. http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx&lt;br /&gt;
# Larman, Craig. ''Applying UML and Patterns: an Introduction to Object-oriented Analysis and Design and Iterative Development''. Upper Saddle River, NJ: Prentice Hall PTR, 2005. Print.&lt;br /&gt;
# Cuellar, Ezequiel. Performing use-case realizations: The case for high cohesion and low coupling. 15 Jun 2007. http://www.ibm.com/developerworks/rational/library/jun07/cuellar&lt;br /&gt;
# Fowler, Martin. Passive View. 18 July 2006. http://www.martinfowler.com/eaaDev/PassiveScreen.html&lt;br /&gt;
# Wikipedia. GRASP (object-oriented design). 18 October 2010. http://en.wikipedia.org/wiki/GRASP_(object-oriented_design)&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43189</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7c ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43189"/>
		<updated>2010-12-02T02:56:08Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* Pure Fabrication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Pure Fabrication=&lt;br /&gt;
Pure Fabrication is a design pattern in which objects are created that do not correlate directly to real-world objects. This is generally used to achieve low cohesion and high coupling, as discussed in previous chapters. Although low cohesion and high coupling is an important design principle, fabricating objects that do not exist in the problem domain may lead to problems [http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx], thus classifying it as an anti-pattern.&lt;br /&gt;
&lt;br /&gt;
Pure Fabrication is the second [http://en.wikipedia.org/wiki/GRASP_(object-oriented_design) GRASP] (General Responsibility Assignment Software Principles) principle covered in this chapter. All of these are general principles that &amp;quot;help aid developers in assigning responsibilities to objects&amp;quot; [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx].&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Larman, the author of this design principle, provides an example of the Pure Fabrication pattern in his book ''Applying UML and Patterns''. [http://www.amazon.com/Applying-UML-Patterns-Introduction-Object-Oriented/dp/0130925691/ref=sr_11_1?ie=UTF8&amp;amp;qid=1216994566&amp;amp;sr=11-1]&lt;br /&gt;
&lt;br /&gt;
Scenario: A retail sales application contains the classes Sale and DatabaseA. The Sale class represents a purchase transaction, and DatabaseA is the database backend it is stored in.&lt;br /&gt;
&lt;br /&gt;
With only these two objects, the Sale class would need to contain the logic required to persist a sale to the database, which violates high cohesion. If DatabaseA were to change, the Sale class would also have to change. This violates low coupling [http://www.ibm.com/developerworks/rational/library/jun07/cuellar/].&lt;br /&gt;
If the database were to change to DatabaseB, an adapter would be required, as visualized in Figure 1:&lt;br /&gt;
&lt;br /&gt;
[[Image:Wiki3A.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Figure 1'''&lt;br /&gt;
&lt;br /&gt;
Instead, one could create a Broker class in the initial design that sits between the Sale and database, as in Figure 2 below: &lt;br /&gt;
&lt;br /&gt;
[[Image:Wiki3B.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Figure 2'''&lt;br /&gt;
&lt;br /&gt;
The Broker would contain all the logic necessary to take the data from a Sale-like object and all the logic needed to persist that data in the database. Sale and other Sale-like objects would all interact with Broker in the same way and would not need to know about the database, thus achieving high cohesion. If the DatabaseA is replaced with DatabaseB, only the Broker class must change, thus achieving low coupling. Since there is no Broker concept in the problem domain, this qualifies as a Pure Fabrication.&lt;br /&gt;
&lt;br /&gt;
==Similar Patterns==&lt;br /&gt;
&lt;br /&gt;
===Adapter===&lt;br /&gt;
&lt;br /&gt;
This is similar to the Adapter pattern, except for a few key differences. The Adapter pattern applies when a new class is created to sit in the middle of to two existing classes that interact, such as in Figure 1. This does not decrease coupling or increase cohesion. Instead, the Broker class is part of the initial design, and the Sale never has to know how to interact with a database [3].&lt;br /&gt;
&lt;br /&gt;
===Controllers in MVC===&lt;br /&gt;
&lt;br /&gt;
In the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model View Controller pattern], the Controller could be viewed as a Pure Fabrication, because it does not represent a concept in the problem domain. Instead, it is a layer that sits in between the Views and Models, allowing each to main high cohesion and low coupling [http://www.martinfowler.com/eaaDev/PassiveScreen.html]. MVC is such a common application of the Pure Fabrication principle that it has become its own design principle.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
In many cases, adhering excessively to the low cohesion principle just makes things more complicated. &amp;quot;Obviously if you are building frameworks and reusable components the idea of low coupling and coding to interfaces is important, but I have seen and done this myself in the past with custom / opinionated software as a 'just-in-case.' In more times than not, this just-in-case type of development leads to over-architected and hard to maintain software&amp;quot; [1].&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Hayden, David. Over-Architecting Via Pure Fabrication and Indirection to Reduce Coupling. 26 Aug 2006. http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx&lt;br /&gt;
# Hayden, David. Pure Fabrication GRASP Pattern - Software Design Patterns and Principles - Applying UML and Patterns - Domain-Driven Design. 18 September 2005. http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx&lt;br /&gt;
# Larman, Craig. ''Applying UML and Patterns: an Introduction to Object-oriented Analysis and Design and Iterative Development''. Upper Saddle River, NJ: Prentice Hall PTR, 2005. Print.&lt;br /&gt;
# Cuellar, Ezequiel. Performing use-case realizations: The case for high cohesion and low coupling. 15 Jun 2007. http://www.ibm.com/developerworks/rational/library/jun07/cuellar&lt;br /&gt;
# Fowler, Martin. Passive View. 18 July 2006. http://www.martinfowler.com/eaaDev/PassiveScreen.html&lt;br /&gt;
# Wikipedia. GRASP (object-oriented design). 18 October 2010. http://en.wikipedia.org/wiki/GRASP_(object-oriented_design)&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43184</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7c ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43184"/>
		<updated>2010-12-02T02:49:41Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Pure Fabrication=&lt;br /&gt;
Pure Fabrication is a design pattern in which objects are created that do not correlate directly to real-world objects. This is generally used to achieve low cohesion and high coupling, as discussed in previous chapters. Although low cohesion and high coupling is an important design principle, fabricating objects that do not exist in the problem domain may lead to problems [http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx], thus classifying it as an anti-pattern.&lt;br /&gt;
&lt;br /&gt;
Pure Fabrication is the second [http://en.wikipedia.org/wiki/GRASP_(object-oriented_design) GRASP] (General Responsibility Assignment Software Principles) principle covered in this chapter. All of these are general principles that &amp;quot;help aid developers in assigning responsibilities to objects&amp;quot; [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx].&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Larman, the author of this design principle, provides an example of the Pure Fabrication pattern in his book ''Applying UML and Patterns''. [http://www.amazon.com/Applying-UML-Patterns-Introduction-Object-Oriented/dp/0130925691/ref=sr_11_1?ie=UTF8&amp;amp;qid=1216994566&amp;amp;sr=11-1]&lt;br /&gt;
&lt;br /&gt;
Scenario: A retail sales application contains the classes Sale and DatabaseA. The Sale class represents a purchase transaction, and DatabaseA is the database backend it is stored in.&lt;br /&gt;
&lt;br /&gt;
With only these two objects, the Sale class would need to contain the logic required to persist a sale to the database, which violates high cohesion. If DatabaseA were to change, the Sale class would also have to change. This violates low coupling [http://www.ibm.com/developerworks/rational/library/jun07/cuellar/].&lt;br /&gt;
If the database were to change to DatabaseB, an adapter would be required, as visualized in Figure 1:&lt;br /&gt;
&lt;br /&gt;
[[Image:Wiki3A.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Figure 1'''&lt;br /&gt;
&lt;br /&gt;
Instead, one could create a Broker class in the initial design that sits between the Sale and database, as in Figure 2 below: &lt;br /&gt;
&lt;br /&gt;
[[Image:Wiki3B.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Figure 2'''&lt;br /&gt;
&lt;br /&gt;
The Broker would contain all the logic necessary to take the data from a Sale-like object and all the logic needed to persist that data in the database. Sale and other Sale-like objects would all interact with Broker in the same way and would not need to know about the database, thus achieving high cohesion. If the DatabaseA is replaced with DatabaseB, only the Broker class must change, thus achieving low coupling. Since there is no Broker concept in the problem domain, this qualifies as a Pure Fabrication.&lt;br /&gt;
&lt;br /&gt;
==Similar Patterns==&lt;br /&gt;
&lt;br /&gt;
===Adapter===&lt;br /&gt;
&lt;br /&gt;
This is similar to the Adapter pattern, except for a few key differences. The Adapter pattern applies when a new class is created to sit in the middle of to two existing classes that interact, such as in Figure 1. This does not decrease coupling or increase cohesion. Instead, the Broker class is part of the initial design, and the Sale never has to know how to interact with a database [3].&lt;br /&gt;
&lt;br /&gt;
===Controllers in MVC===&lt;br /&gt;
&lt;br /&gt;
In the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model View Controller pattern], the Controller could be viewed as a Pure Fabrication, because it does not represent a concept in the problem domain. Instead, it is a layer that sits in between the Views and Models, allowing each to main high cohesion and low coupling [http://www.martinfowler.com/eaaDev/PassiveScreen.html]. MVC is such a common application of the Pure Fabrication principle that it has become its own design principle.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Hayden, David. Over-Architecting Via Pure Fabrication and Indirection to Reduce Coupling. 26 Aug 2006. http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx&lt;br /&gt;
# Hayden, David. Pure Fabrication GRASP Pattern - Software Design Patterns and Principles - Applying UML and Patterns - Domain-Driven Design. 18 September 2005. http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx&lt;br /&gt;
# Larman, Craig. ''Applying UML and Patterns: an Introduction to Object-oriented Analysis and Design and Iterative Development''. Upper Saddle River, NJ: Prentice Hall PTR, 2005. Print.&lt;br /&gt;
# Cuellar, Ezequiel. Performing use-case realizations: The case for high cohesion and low coupling. 15 Jun 2007. http://www.ibm.com/developerworks/rational/library/jun07/cuellar&lt;br /&gt;
# Fowler, Martin. Passive View. 18 July 2006. http://www.martinfowler.com/eaaDev/PassiveScreen.html&lt;br /&gt;
# Wikipedia. GRASP (object-oriented design). 18 October 2010. http://en.wikipedia.org/wiki/GRASP_(object-oriented_design)&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43177</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7c ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43177"/>
		<updated>2010-12-02T02:47:03Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Pure Fabrication=&lt;br /&gt;
Pure Fabrication is a design pattern in which objects are created that do not correlate directly to real-world objects. This is generally used to achieve low cohesion and high coupling, as discussed in previous chapters. Although low cohesion and high coupling is an important design principle, fabricating objects that do not exist in the problem domain may lead to problems [http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx], thus classifying it as an anti-pattern.&lt;br /&gt;
&lt;br /&gt;
Pure Fabrication is the second [http://en.wikipedia.org/wiki/GRASP_(object-oriented_design) GRASP] (General Responsibility Assignment Software Principles) principle covered in this chapter. All of these are general principles that &amp;quot;help aid developers in assigning responsibilities to objects&amp;quot; [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx].&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Larman, the author of this design principle, provides an example of the Pure Fabrication pattern in his book ''Applying UML and Patterns''. [http://www.amazon.com/Applying-UML-Patterns-Introduction-Object-Oriented/dp/0130925691/ref=sr_11_1?ie=UTF8&amp;amp;qid=1216994566&amp;amp;sr=11-1]&lt;br /&gt;
&lt;br /&gt;
Scenario: A retail sales application contains the classes Sale and DatabaseA. The Sale class represents a purchase transaction, and DatabaseA is the database backend it is stored in.&lt;br /&gt;
&lt;br /&gt;
With only these two objects, the Sale class would need to contain the logic required to persist a sale to the database, which violates high cohesion. If DatabaseA were to change, the Sale class would also have to change. This violates low coupling [http://www.ibm.com/developerworks/rational/library/jun07/cuellar/].&lt;br /&gt;
If the database were to change to DatabaseB, an adapter would be required, as visualized in Figure 1:&lt;br /&gt;
&lt;br /&gt;
[[Image:Wiki3A.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Figure 1'''&lt;br /&gt;
&lt;br /&gt;
Instead, one could create a Broker class in the initial design that sits between the Sale and database, as in Figure 2 below: &lt;br /&gt;
&lt;br /&gt;
[[Image:Wiki3B.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Figure 2'''&lt;br /&gt;
&lt;br /&gt;
The Broker would contain all the logic necessary to take the data from a Sale-like object and all the logic needed to persist that data in the database. Sale and other Sale-like objects would all interact with Broker in the same way and would not need to know about the database, thus achieving high cohesion. If the DatabaseA is replaced with DatabaseB, only the Broker class must change, thus achieving low coupling. Since there is no Broker concept in the problem domain, this qualifies as a Pure Fabrication.&lt;br /&gt;
&lt;br /&gt;
==Similar Patterns==&lt;br /&gt;
&lt;br /&gt;
===Adapter===&lt;br /&gt;
&lt;br /&gt;
This is similar to the Adapter pattern, except for a few key differences. The Adapter pattern applies when a new class is created to sit in the middle of to two existing classes that interact, such as in Figure 1. This does not decrease coupling or increase cohesion. Instead, the Broker class is part of the initial design, and the Sale never has to know how to interact with a database [3].&lt;br /&gt;
&lt;br /&gt;
===Controllers in MVC===&lt;br /&gt;
&lt;br /&gt;
In the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model View Controller pattern], the Controller could be viewed as a Pure Fabrication, because it does not represent a concept in the problem domain. Instead, it is a layer that sits in between the Views and Models, allowing each to main high cohesion and low coupling [http://www.martinfowler.com/eaaDev/PassiveScreen.html]. MVC is such a common application of the Pure Fabrication principle that it has become its own design principle.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Hayden, David. Over-Architecting Via Pure Fabrication and Indirection to Reduce Coupling. 26 Aug 2006. http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx&lt;br /&gt;
# Larman, Craig. ''Applying UML and Patterns: an Introduction to Object-oriented Analysis and Design and Iterative Development''. Upper Saddle River, NJ: Prentice Hall PTR, 2005. Print.&lt;br /&gt;
# Cuellar, Ezequiel. Performing use-case realizations: The case for high cohesion and low coupling. 15 Jun 2007. http://www.ibm.com/developerworks/rational/library/jun07/cuellar&lt;br /&gt;
# Fowler, Martin. Passive View. 18 July 2006. http://www.martinfowler.com/eaaDev/PassiveScreen.html&lt;br /&gt;
# Wikipedia. GRASP (object-oriented design). 18 October 2010. http://en.wikipedia.org/wiki/GRASP_(object-oriented_design)&lt;br /&gt;
# Hayden, David. Pure Fabrication GRASP Pattern - Software Design Patterns and Principles - Applying UML and Patterns - Domain-Driven Design. 18 September 2005. http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43174</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7c ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43174"/>
		<updated>2010-12-02T02:46:28Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Pure Fabrication=&lt;br /&gt;
Pure Fabrication is a design pattern in which objects are created that do not correlate directly to real-world objects. This is generally used to achieve low cohesion and high coupling, as discussed in previous chapters. Although low cohesion and high coupling is an important design principle, fabricating objects that do not exist in the problem domain may lead to problems [http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx], thus classifying it as an anti-pattern.&lt;br /&gt;
&lt;br /&gt;
Pure Fabrication is the second [http://en.wikipedia.org/wiki/GRASP_(object-oriented_design) GRASP] (General Responsibility Assignment Software Principles) principle covered in this chapter. All of these are general principles that &amp;quot;help aid developers in assigning responsibilities to objects&amp;quot; [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx].&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Larman provides an example of the Pure Fabrication pattern in his book ''Applying UML and Patterns''. [http://www.amazon.com/Applying-UML-Patterns-Introduction-Object-Oriented/dp/0130925691/ref=sr_11_1?ie=UTF8&amp;amp;qid=1216994566&amp;amp;sr=11-1]&lt;br /&gt;
&lt;br /&gt;
Scenario: A retail sales application contains the classes Sale and DatabaseA. The Sale class represents a purchase transaction, and DatabaseA is the database backend it is stored in.&lt;br /&gt;
&lt;br /&gt;
With only these two objects, the Sale class would need to contain the logic required to persist a sale to the database, which violates high cohesion. If DatabaseA were to change, the Sale class would also have to change. This violates low coupling [http://www.ibm.com/developerworks/rational/library/jun07/cuellar/].&lt;br /&gt;
If the database were to change to DatabaseB, an adapter would be required, as visualized in Figure 1:&lt;br /&gt;
&lt;br /&gt;
[[Image:Wiki3A.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Figure 1'''&lt;br /&gt;
&lt;br /&gt;
Instead, one could create a Broker class in the initial design that sits between the Sale and database, as in Figure 2 below: &lt;br /&gt;
&lt;br /&gt;
[[Image:Wiki3B.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Figure 2'''&lt;br /&gt;
&lt;br /&gt;
The Broker would contain all the logic necessary to take the data from a Sale-like object and all the logic needed to persist that data in the database. Sale and other Sale-like objects would all interact with Broker in the same way and would not need to know about the database, thus achieving high cohesion. If the DatabaseA is replaced with DatabaseB, only the Broker class must change, thus achieving low coupling. Since there is no Broker concept in the problem domain, this qualifies as a Pure Fabrication.&lt;br /&gt;
&lt;br /&gt;
==Similar Patterns==&lt;br /&gt;
&lt;br /&gt;
===Adapter===&lt;br /&gt;
&lt;br /&gt;
This is similar to the Adapter pattern, except for a few key differences. The Adapter pattern applies when a new class is created to sit in the middle of to two existing classes that interact, such as in Figure 1. This does not decrease coupling or increase cohesion. Instead, the Broker class is part of the initial design, and the Sale never has to know how to interact with a database [3].&lt;br /&gt;
&lt;br /&gt;
===Controllers in MVC===&lt;br /&gt;
&lt;br /&gt;
In the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model View Controller pattern], the Controller could be viewed as a Pure Fabrication, because it does not represent a concept in the problem domain. Instead, it is a layer that sits in between the Views and Models, allowing each to main high cohesion and low coupling [http://www.martinfowler.com/eaaDev/PassiveScreen.html]. MVC is such a common application of the Pure Fabrication principle that it has become its own design principle.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Hayden, David. Over-Architecting Via Pure Fabrication and Indirection to Reduce Coupling. 26 Aug 2006. http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx&lt;br /&gt;
# Larman, Craig. ''Applying UML and Patterns: an Introduction to Object-oriented Analysis and Design and Iterative Development''. Upper Saddle River, NJ: Prentice Hall PTR, 2005. Print.&lt;br /&gt;
# Cuellar, Ezequiel. Performing use-case realizations: The case for high cohesion and low coupling. 15 Jun 2007. http://www.ibm.com/developerworks/rational/library/jun07/cuellar&lt;br /&gt;
# Fowler, Martin. Passive View. 18 July 2006. http://www.martinfowler.com/eaaDev/PassiveScreen.html&lt;br /&gt;
# Wikipedia. GRASP (object-oriented design). 18 October 2010. http://en.wikipedia.org/wiki/GRASP_(object-oriented_design)&lt;br /&gt;
# Hayden, David. Pure Fabrication GRASP Pattern - Software Design Patterns and Principles - Applying UML and Patterns - Domain-Driven Design. 18 September 2005. http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43149</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7c ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43149"/>
		<updated>2010-12-02T02:23:45Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
Pure Fabrication is a design pattern in which objects are created that do not correlate directly to real-world objects. This is generally used to achieve low cohesion and high coupling, as discussed in previous chapters. Although low cohesion and high coupling is an important design principle, fabricating objects that do not exist in the problem domain may lead to problems [http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx], thus classifying it as an anti-pattern.&lt;br /&gt;
&lt;br /&gt;
=Pure Fabrication=&lt;br /&gt;
Pure Fabrication is a [http://en.wikipedia.org/wiki/GRASP_(object-oriented_design) GRASP] (General Responsibility Assignment Software Patterns) principle.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Larman provides an example of the Pure Fabrication pattern in his book ''Applying UML and Patterns''. [http://www.amazon.com/Applying-UML-Patterns-Introduction-Object-Oriented/dp/0130925691/ref=sr_11_1?ie=UTF8&amp;amp;qid=1216994566&amp;amp;sr=11-1]&lt;br /&gt;
&lt;br /&gt;
Scenario: A retail sales application contains the classes Sale and DatabaseA. The Sale class represents a purchase transaction, and DatabaseA is the database backend it is stored in.&lt;br /&gt;
&lt;br /&gt;
With only these two objects, the Sale class would need to contain the logic required to persist a sale to the database, which violates high cohesion. If DatabaseA were to change, the Sale class would also have to change. This violates low coupling [http://www.ibm.com/developerworks/rational/library/jun07/cuellar/].&lt;br /&gt;
If the database were to change to DatabaseB, an adapter would be required, as visualized in Figure 1:&lt;br /&gt;
&lt;br /&gt;
[[Image:Wiki3A.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Figure 1'''&lt;br /&gt;
&lt;br /&gt;
Instead, one could create a Broker class in the initial design that sits between the Sale and database, as in Figure 2 below: &lt;br /&gt;
&lt;br /&gt;
[[Image:Wiki3B.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Figure 2'''&lt;br /&gt;
&lt;br /&gt;
The Broker would contain all the logic necessary to take the data from a Sale-like object and all the logic needed to persist that data in the database. Sale and other Sale-like objects would all interact with Broker in the same way and would not need to know about the database, thus achieving high cohesion. If the DatabaseA is replaced with DatabaseB, only the Broker class must change, thus achieving low coupling. Since there is no Broker concept in the problem domain, this qualifies as a Pure Fabrication.&lt;br /&gt;
&lt;br /&gt;
==Similar Patterns==&lt;br /&gt;
&lt;br /&gt;
===Adapter===&lt;br /&gt;
&lt;br /&gt;
This is similar to the Adapter pattern, except for a few key differences. The Adapter pattern applies when a new class is created to sit in the middle of to two existing classes that interact, such as in Figure 1. This does not decrease coupling or increase cohesion. Instead, the Broker class is part of the initial design, and the Sale never has to know how to interact with a database [2].&lt;br /&gt;
&lt;br /&gt;
===Controllers in MVC===&lt;br /&gt;
&lt;br /&gt;
In the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model View Controller pattern], the Controller could be viewed as a Pure Fabrication, because it does not represent a concept in the problem domain. Instead, it is a layer that sits in between the Views and Models, allowing each to main high cohesion and low coupling [http://www.martinfowler.com/eaaDev/PassiveScreen.html]. MVC is such a common application of the Pure Fabrication principle that it has become its own design principle.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Hayden, David. Over-Architecting Via Pure Fabrication and Indirection to Reduce Coupling. 26 Aug 2006. http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx&lt;br /&gt;
# Larman, Craig. ''Applying UML and Patterns: an Introduction to Object-oriented Analysis and Design and Iterative Development''. Upper Saddle River, NJ: Prentice Hall PTR, 2005. Print.&lt;br /&gt;
# Cuellar, Ezequiel. Performing use-case realizations: The case for high cohesion and low coupling. 15 Jun 2007. http://www.ibm.com/developerworks/rational/library/jun07/cuellar&lt;br /&gt;
# Fowler, Martin. Passive View. 18 July 2006. http://www.martinfowler.com/eaaDev/PassiveScreen.html&lt;br /&gt;
# Wikipedia. GRASP (object-oriented design). 18 October 2010. http://en.wikipedia.org/wiki/GRASP_(object-oriented_design)&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43140</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7c ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43140"/>
		<updated>2010-12-02T02:09:47Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
Pure Fabrication is a design pattern in which objects are created that do not correlate directly to real-world objects. This is generally used to achieve low cohesion and high coupling, as discussed in previous chapters. Although low cohesion and high coupling is an important design principle, fabricating objects that do not exist in the problem domain may lead to problems [http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx], thus classifying it as an anti-pattern.&lt;br /&gt;
&lt;br /&gt;
=Pure Fabrication=&lt;br /&gt;
Pure Fabrication is a [http://en.wikipedia.org/wiki/GRASP_(object-oriented_design) GRASP] (General Responsibility Assignment Software Patterns) principle.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Larman provides an example of the Pure Fabrication pattern in his book ''Applying UML and Patterns''. [http://www.amazon.com/Applying-UML-Patterns-Introduction-Object-Oriented/dp/0130925691/ref=sr_11_1?ie=UTF8&amp;amp;qid=1216994566&amp;amp;sr=11-1]&lt;br /&gt;
&lt;br /&gt;
Scenario: A retail sales application contains the classes Sale and DatabaseA. The Sale class represents a purchase transaction, and DatabaseA is the database backend it is stored in.&lt;br /&gt;
&lt;br /&gt;
With only these two objects, the Sale class would need to contain the logic required to persist a sale to the database, which violates high cohesion. If DatabaseA were to change, the Sale class would also have to change. This violates low coupling [http://www.ibm.com/developerworks/rational/library/jun07/cuellar/].&lt;br /&gt;
If the database were to change to DatabaseB, an adapter would be required, as visualized in Figure 1:&lt;br /&gt;
&lt;br /&gt;
[[Image:Wiki3A.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Figure 1'''&lt;br /&gt;
&lt;br /&gt;
Instead, one could &lt;br /&gt;
&lt;br /&gt;
[[Image:Wiki3B.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Figure 2'''&lt;br /&gt;
&lt;br /&gt;
==Similar Patterns==&lt;br /&gt;
&lt;br /&gt;
===Adapter===&lt;br /&gt;
&lt;br /&gt;
This is similar to the Adapter pattern, except for a few key differences. The Adapter pattern applies when a new class is created to sit in the middle of to two existing classes that interact, such as in Figure 1. This does not decrease coupling or increase cohesion. Instead, the Broker class is part of the initial design, and the Sale never has to know how to interact with a database [2].&lt;br /&gt;
&lt;br /&gt;
===Controllers in MVC===&lt;br /&gt;
&lt;br /&gt;
In the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model View Controller pattern], the Controller could be viewed as a Pure Fabrication, because it does not represent a concept in the problem domain. Instead, it is a layer that sits in between the Views and Models, allowing each to main high cohesion and low coupling [http://www.martinfowler.com/eaaDev/PassiveScreen.html]. MVC is such a common application of the Pure Fabrication principle that it has become its own design principle.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Hayden, David. Over-Architecting Via Pure Fabrication and Indirection to Reduce Coupling. 26 Aug 2006. http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx&lt;br /&gt;
# Larman, Craig. ''Applying UML and Patterns: an Introduction to Object-oriented Analysis and Design and Iterative Development''. Upper Saddle River, NJ: Prentice Hall PTR, 2005. Print.&lt;br /&gt;
# Cuellar, Ezequiel. Performing use-case realizations: The case for high cohesion and low coupling. 15 Jun 2007. http://www.ibm.com/developerworks/rational/library/jun07/cuellar&lt;br /&gt;
# Fowler, Martin. Passive View. 18 July 2006. http://www.martinfowler.com/eaaDev/PassiveScreen.html&lt;br /&gt;
# Wikipedia. GRASP (object-oriented design). 18 October 2010. http://en.wikipedia.org/wiki/GRASP_(object-oriented_design)&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43096</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7c ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43096"/>
		<updated>2010-12-02T00:49:30Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
Pure Fabrication is a design pattern in which objects are created that do not correlate directly to real-world objects. This is generally used to achieve low cohesion and high coupling, as discussed in previous chapters. Although low cohesion and high coupling is an important design principle, fabricating objects that do not exist in the problem domain may lead to problems [http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx], thus classifying it as an anti-pattern.&lt;br /&gt;
&lt;br /&gt;
=Pure Fabrication=&lt;br /&gt;
Pure Fabrication is a [http://en.wikipedia.org/wiki/GRASP_(object-oriented_design) GRASP] (General Responsibility Assignment Software Patterns) principle.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Hayden, David. Over-Architecting Via Pure Fabrication and Indirection to Reduce Coupling. 26 Aug 2006. http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx&lt;br /&gt;
# Wikipedia. GRASP (object-oriented design). 18 October 2010. http://en.wikipedia.org/wiki/GRASP_(object-oriented_design)&lt;br /&gt;
# Larman, Craig. ''Applying UML and Patterns: an Introduction to Object-oriented Analysis and Design and Iterative Development''. Upper Saddle River, NJ: Prentice Hall PTR, 2005. Print.&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43094</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_ed&amp;diff=43094"/>
		<updated>2010-12-02T00:39:49Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
&lt;br /&gt;
=References=&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43084</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7c ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43084"/>
		<updated>2010-12-01T23:43:27Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
Pure Fabrication is a design pattern in which objects are created that do not correlate directly to real-world objects. This is generally used to achieve low cohesion and high coupling, as discussed in previous chapters. Although low cohesion and high coupling is an important design principle, fabricating objects that do not exist in the problem domain may lead to problems [http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx], thus classifying it as an anti-pattern.&lt;br /&gt;
&lt;br /&gt;
=Pure Fabrication=&lt;br /&gt;
Pure Fabrication is a [http://en.wikipedia.org/wiki/GRASP_(object-oriented_design) GRASP] (General Responsibility Assignment Software Patterns) principle.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# Hayden, David. Over-Architecting Via Pure Fabrication and Indirection to Reduce Coupling. 26 Aug 2006. http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx&lt;br /&gt;
# Wikipedia. GRASP (object-oriented design). 18 October 2010. http://en.wikipedia.org/wiki/GRASP_(object-oriented_design)&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43083</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7c ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43083"/>
		<updated>2010-12-01T23:42:28Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
Pure Fabrication is a design pattern in which objects are created that do not correlate directly to real-world objects. This is generally used to achieve low cohesion and high coupling, as discussed in previous chapters. Although low cohesion and high coupling is an important design principle, fabricating objects that do not exist in the problem domain may lead to problems [http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx], thus classifying it as an anti-pattern.&lt;br /&gt;
&lt;br /&gt;
=Pure Fabrication=&lt;br /&gt;
Pure Fabrication is a [http://en.wikipedia.org/wiki/GRASP_(object-oriented_design) GRASP] (General Responsibility Assignment Software Patterns) principle.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1. Hayden, David. Over-Architecting Via Pure Fabrication and Indirection to Reduce Coupling. 26 Aug 2006. http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43082</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7c ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43082"/>
		<updated>2010-12-01T23:40:32Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* Pure Fabrication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
Pure Fabrication is a design pattern in which objects are created that do not correlate directly to real-world objects. This is generally used to achieve low cohesion and high coupling, as discussed in previous chapters. Although low cohesion and high coupling is an important design principle, fabricating objects that do not exist in the problem domain may lead to problems [http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx], thus classifying it as an anti-pattern.&lt;br /&gt;
&lt;br /&gt;
=Pure Fabrication=&lt;br /&gt;
Pure Fabrication is a [http://en.wikipedia.org/wiki/GRASP_(object-oriented_design) GRASP] (General Responsibility Assignment Software Patterns) principle.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1.&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43081</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7c ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43081"/>
		<updated>2010-12-01T23:40:22Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
Pure Fabrication is a design pattern in which objects are created that do not correlate directly to real-world objects. This is generally used to achieve low cohesion and high coupling, as discussed in previous chapters. Although low cohesion and high coupling is an important design principle, fabricating objects that do not exist in the problem domain may lead to problems [http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx], thus classifying it as an anti-pattern.&lt;br /&gt;
&lt;br /&gt;
=Pure Fabrication=&lt;br /&gt;
Pure Fabrication is a [http://en.wikipedia.org/wiki/GRASP_(object-oriented_design) GRASP] (General Responsibility Assignment Software Patterns) principle.&lt;br /&gt;
&lt;br /&gt;
=References&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43080</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7c ed</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7c_ed&amp;diff=43080"/>
		<updated>2010-12-01T23:39:39Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
Pure Fabrication is a design pattern in which objects are created that do not correlate directly to real-world objects. This is generally used to achieve low cohesion and high coupling, as discussed in previous chapters. Although low cohesion and high coupling is an important design principle, fabricating objects that do not exist in the problem domain may lead to problems, thus classifying this as an anti-pattern. [http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx]&lt;br /&gt;
&lt;br /&gt;
=Pure Fabrication=&lt;br /&gt;
Pure Fabrication is a [http://en.wikipedia.org/wiki/GRASP_(object-oriented_design) GRASP] (General Responsibility Assignment Software Patterns) principle.&lt;br /&gt;
&lt;br /&gt;
=References&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC_216/s08/wholesome_discipline&amp;diff=11414</id>
		<title>CSC 216/s08/wholesome discipline</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC_216/s08/wholesome_discipline&amp;diff=11414"/>
		<updated>2008-04-23T21:20:00Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Stacks &amp;amp; Queues==&lt;br /&gt;
&lt;br /&gt;
===The problem===&lt;br /&gt;
&lt;br /&gt;
In this exercise, students will learn the difference between stacks and queues, mainly which end to push and pop from.  In a stack, the items are added and removed from the top of a stack (LIFO); where as in a queue the items are added to the end and removed from the front (FIFO).&lt;br /&gt;
&lt;br /&gt;
===Participants and props===&lt;br /&gt;
&lt;br /&gt;
For this exercise about seven students will be needed to act as objects. The props will be plates, and candy.&lt;br /&gt;
&lt;br /&gt;
===The script===&lt;br /&gt;
&lt;br /&gt;
Each participant will be given a plate to write their name on, and will then stack them in a pile (Push). Afterwards, a certain name will have to be found, and the only way to get to it will be by taking off the top plate (Pop), until the desired name is found. This demonstrates the Last In First Out concept of a stack.&lt;br /&gt;
&lt;br /&gt;
Then another group of students will demonstrate how queues work.  Each student will line up to get a piece of candy.  The first person to line up will be in the front and everyone else in the line will line up behind him (Push).  Once the first person gets his piece of candy and leaves (Pop), the next person in line will then be able to get a piece of candy (which will most definitely raise class participation). This demonstrates the First In First Out concept of a queue.&lt;br /&gt;
&lt;br /&gt;
After having done the exercise, give some examples of where queues and stacks are used in real programming.  For example, stacks are used to keep track of method calls.  Queues are used whenever using a buffer, or keeping track of things to do.&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC_216/s08/wholesome_discipline&amp;diff=11413</id>
		<title>CSC 216/s08/wholesome discipline</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC_216/s08/wholesome_discipline&amp;diff=11413"/>
		<updated>2008-04-23T20:25:44Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: quick formatting fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Stacks &amp;amp; Queues==&lt;br /&gt;
&lt;br /&gt;
===The problem===&lt;br /&gt;
&lt;br /&gt;
In this exercise, students will learn the difference between stacks and queues, mainly which end to push and pop from.  In a stack, the items are added and removed from the top of a stack (LIFO); where as in a queue the items are added to the end and removed from the front (FIFO).   &lt;br /&gt;
&lt;br /&gt;
===Participants and props===&lt;br /&gt;
&lt;br /&gt;
For this exercise about seven students will be needed to act as objects. The props will be plates, and candy.&lt;br /&gt;
&lt;br /&gt;
===The script===&lt;br /&gt;
&lt;br /&gt;
Each participant will be given a plate to  write their name on, and will then stack them in a pile (Push). &lt;br /&gt;
Afterwards, a certain name will have to be found, and the only way to get to it will be by taking off the top &lt;br /&gt;
plate (Pop), until the desired name is found. This demonstrates the last in first out concept of a stack.  &lt;br /&gt;
&lt;br /&gt;
Then another group of students will demonstrate how queues work.  Each student will line up to get a &lt;br /&gt;
piece of candy.  The first person to line up will be in the front and everyone else in the line will line up&lt;br /&gt;
behind him (Push).  Once the first person gets his piece of candy and leaves (Pop), the next person in line &lt;br /&gt;
will then be able to get a piece of candy.  This demonstrates the First in First out concept of a queue.  &lt;br /&gt;
&lt;br /&gt;
Side note: the promise of candy will most definitely raise class participation.&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC_216/s08/be_cheerful&amp;diff=11064</id>
		<title>CSC 216/s08/be cheerful</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC_216/s08/be_cheerful&amp;diff=11064"/>
		<updated>2008-04-03T22:06:19Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: Clarify how the code doesn't match.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==That's what it's all about!==&lt;br /&gt;
&lt;br /&gt;
===Overview===&lt;br /&gt;
&lt;br /&gt;
In this active learning exercise, you can teach the value of superclassing and writing &amp;quot;don't repeat yourself&amp;quot; code to prevent error. When a programmer writes the same code twice, to do the same job, this increases logistical overhead and introduces more chances for error. But if he writes the code once and tells the classes that use it to look at the same piece of code, this can be handily eliminated. This is where inheritance comes in.&lt;br /&gt;
&lt;br /&gt;
===How It's Done===&lt;br /&gt;
&lt;br /&gt;
To model writing the code twice, and writing it once, you'll need two volunteers and an inside man -- you could do this yourself or delegate it. Your insider will instruct each of the two volunteers in how to do the hokey pokey. You can do this however you like: by word of mouth, by written instructions, whatever. But the one thing that you have to make sure is that one of the sets of instructions is ''wrong''. You'll see why in a second.&lt;br /&gt;
&lt;br /&gt;
Now, have your two volunteers start dancing, strictly adhering to their instructions. Soon enough, they'll come out of sync, and you'll have your error. As you should reveal to the class at this time, this represents what happens when your two sections of supposedly identical code don't match perfectly. The program breaks or contains bugs.&lt;br /&gt;
&lt;br /&gt;
To fix this, you can use a superclass that they will both take their instructions from. In this case, a nice Google video of a [http://video.google.com/videoplay?docid=-4742763335053216439 strange man doing the hokey pokey]. (This video will also be of use if your volunteers are a little too nervous: it's hard to be more ridiculous than that guy.) Once they've both received the same set of instructions, they can dance the hokey pokey in unison 'til the cows come home.&lt;br /&gt;
&lt;br /&gt;
After a bit more dancing, bring it all together with a nice review of what each part of the exercise represents: repetitive coding, unintended errors, and the efficacy of a superclass. If done right, this will leave a strong impression of the importance of not repeating code.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [http://courses.ncsu.edu/csc216/lec/001/homework/le Learning activity assignment]&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC_216/s08/be_cheerful&amp;diff=10593</id>
		<title>CSC 216/s08/be cheerful</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC_216/s08/be_cheerful&amp;diff=10593"/>
		<updated>2008-03-22T20:48:09Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* Participants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==That's what it's all about!==&lt;br /&gt;
&lt;br /&gt;
===The problem===&lt;br /&gt;
&lt;br /&gt;
Teach the value of superclassing and writing DRY code to prevent error.&lt;br /&gt;
&lt;br /&gt;
===Participants===&lt;br /&gt;
&lt;br /&gt;
3 group members: 1 programmer and 2 classes&lt;br /&gt;
Possibly volunteers to do the hokey pokey?&lt;br /&gt;
&lt;br /&gt;
===Hokey Pokey Music/Video Candidates===&lt;br /&gt;
&lt;br /&gt;
* http://video.google.com/videoplay?docid=-4742763335053216439&lt;br /&gt;
* http://video.google.com/videoplay?docid=8805519462208735145&lt;br /&gt;
&lt;br /&gt;
===The script===&lt;br /&gt;
&lt;br /&gt;
# The coder first creates two or more people classes that are supposed to do the Hokey Pokey.  He tells them individually how to do the hokey pokey.  &lt;br /&gt;
# Because he has a bad memory, he forgets to tell one to turn himself about and to do the incorrect 2nd action.&lt;br /&gt;
# They dance the first 2 segments (right foot, left foot) and get it wrong.&lt;br /&gt;
# The coder decides to use superclassing and inheritance so that all of his people share the same instructions -&amp;gt; show the video.&lt;br /&gt;
# They dance the next 2 segments (right arm, left arm) right!&lt;br /&gt;
# The best part is that now that I have a superclass, I can extend HokeyPokey to as many classes as I want! Like... the whole class! ;)&lt;br /&gt;
# Those willing can watch the video and do the hokey pokey with us. :D&lt;br /&gt;
# Reiterate how this example applies to real programming.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [http://courses.ncsu.edu/csc216/lec/001/homework/le Learning activity assignment]&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC_216/s08/be_cheerful&amp;diff=10592</id>
		<title>CSC 216/s08/be cheerful</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC_216/s08/be_cheerful&amp;diff=10592"/>
		<updated>2008-03-22T20:47:56Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: /* Participants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==That's what it's all about!==&lt;br /&gt;
&lt;br /&gt;
===The problem===&lt;br /&gt;
&lt;br /&gt;
Teach the value of superclassing and writing DRY code to prevent error.&lt;br /&gt;
&lt;br /&gt;
===Participants===&lt;br /&gt;
&lt;br /&gt;
3 group members: 1 programmer and 2 classes&lt;br /&gt;
Possibly volunteers to do the hokey pokey?&lt;br /&gt;
How many students will participate?  What else do you need (e.g., old tennis ball, Powerpoint slides, software).&lt;br /&gt;
&lt;br /&gt;
===Hokey Pokey Music/Video Candidates===&lt;br /&gt;
&lt;br /&gt;
* http://video.google.com/videoplay?docid=-4742763335053216439&lt;br /&gt;
* http://video.google.com/videoplay?docid=8805519462208735145&lt;br /&gt;
&lt;br /&gt;
===The script===&lt;br /&gt;
&lt;br /&gt;
# The coder first creates two or more people classes that are supposed to do the Hokey Pokey.  He tells them individually how to do the hokey pokey.  &lt;br /&gt;
# Because he has a bad memory, he forgets to tell one to turn himself about and to do the incorrect 2nd action.&lt;br /&gt;
# They dance the first 2 segments (right foot, left foot) and get it wrong.&lt;br /&gt;
# The coder decides to use superclassing and inheritance so that all of his people share the same instructions -&amp;gt; show the video.&lt;br /&gt;
# They dance the next 2 segments (right arm, left arm) right!&lt;br /&gt;
# The best part is that now that I have a superclass, I can extend HokeyPokey to as many classes as I want! Like... the whole class! ;)&lt;br /&gt;
# Those willing can watch the video and do the hokey pokey with us. :D&lt;br /&gt;
# Reiterate how this example applies to real programming.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [http://courses.ncsu.edu/csc216/lec/001/homework/le Learning activity assignment]&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC_216/s08/be_cheerful&amp;diff=10591</id>
		<title>CSC 216/s08/be cheerful</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC_216/s08/be_cheerful&amp;diff=10591"/>
		<updated>2008-03-22T20:47:13Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: Add link to assignment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==That's what it's all about!==&lt;br /&gt;
&lt;br /&gt;
===The problem===&lt;br /&gt;
&lt;br /&gt;
Teach the value of superclassing and writing DRY code to prevent error.&lt;br /&gt;
&lt;br /&gt;
===Participants===&lt;br /&gt;
&lt;br /&gt;
3 group members: 1 programmer and 2 classes&lt;br /&gt;
Possibly volunteers to do the hokey pokey?&lt;br /&gt;
How many students will participate?  What else do you need (e.g., old tennis ball, Powerpoint slides, software).&lt;br /&gt;
Participants:&lt;br /&gt;
&lt;br /&gt;
===Hokey Pokey Music/Video Candidates===&lt;br /&gt;
&lt;br /&gt;
* http://video.google.com/videoplay?docid=-4742763335053216439&lt;br /&gt;
* http://video.google.com/videoplay?docid=8805519462208735145&lt;br /&gt;
&lt;br /&gt;
===The script===&lt;br /&gt;
&lt;br /&gt;
# The coder first creates two or more people classes that are supposed to do the Hokey Pokey.  He tells them individually how to do the hokey pokey.  &lt;br /&gt;
# Because he has a bad memory, he forgets to tell one to turn himself about and to do the incorrect 2nd action.&lt;br /&gt;
# They dance the first 2 segments (right foot, left foot) and get it wrong.&lt;br /&gt;
# The coder decides to use superclassing and inheritance so that all of his people share the same instructions -&amp;gt; show the video.&lt;br /&gt;
# They dance the next 2 segments (right arm, left arm) right!&lt;br /&gt;
# The best part is that now that I have a superclass, I can extend HokeyPokey to as many classes as I want! Like... the whole class! ;)&lt;br /&gt;
# Those willing can watch the video and do the hokey pokey with us. :D&lt;br /&gt;
# Reiterate how this example applies to real programming.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [http://courses.ncsu.edu/csc216/lec/001/homework/le Learning activity assignment]&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC_216/s08/be_cheerful&amp;diff=10590</id>
		<title>CSC 216/s08/be cheerful</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC_216/s08/be_cheerful&amp;diff=10590"/>
		<updated>2008-03-22T20:42:18Z</updated>

		<summary type="html">&lt;p&gt;Ehanders: Initial proposal&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==That's what it's all about!==&lt;br /&gt;
&lt;br /&gt;
===The problem===&lt;br /&gt;
&lt;br /&gt;
Teach the value of superclassing and writing DRY code to prevent error.&lt;br /&gt;
&lt;br /&gt;
===Participants===&lt;br /&gt;
&lt;br /&gt;
3 group members: 1 programmer and 2 classes&lt;br /&gt;
Possibly volunteers to do the hokey pokey?&lt;br /&gt;
How many students will participate?  What else do you need (e.g., old tennis ball, Powerpoint slides, software).&lt;br /&gt;
Participants:&lt;br /&gt;
&lt;br /&gt;
===Hokey Pokey Music/Video Candidates===&lt;br /&gt;
&lt;br /&gt;
* http://video.google.com/videoplay?docid=-4742763335053216439&lt;br /&gt;
* http://video.google.com/videoplay?docid=8805519462208735145&lt;br /&gt;
&lt;br /&gt;
===The script===&lt;br /&gt;
&lt;br /&gt;
# The coder first creates two or more people classes that are supposed to do the Hokey Pokey.  He tells them individually how to do the hokey pokey.  &lt;br /&gt;
# Because he has a bad memory, he forgets to tell one to turn himself about and to do the incorrect 2nd action.&lt;br /&gt;
# They dance the first 2 segments (right foot, left foot) and get it wrong.&lt;br /&gt;
# The coder decides to use superclassing and inheritance so that all of his people share the same instructions -&amp;gt; show the video.&lt;br /&gt;
# They dance the next 2 segments (right arm, left arm) right!&lt;br /&gt;
# The best part is that now that I have a superclass, I can extend HokeyPokey to as many classes as I want! Like... the whole class! ;)&lt;br /&gt;
# Those willing can watch the video and do the hokey pokey with us. :D&lt;br /&gt;
# Reiterate how this example applies to real programming.&lt;/div&gt;</summary>
		<author><name>Ehanders</name></author>
	</entry>
</feed>