<?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=Jwpaul</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=Jwpaul"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Jwpaul"/>
	<updated>2026-06-26T06:53:23Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=16054</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=16054"/>
		<updated>2008-07-28T00:40:03Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* How would you classify it */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication can be thought of assigning a highly cohesive set of responsibilities to an artificial class.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication; they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develop code for short term. Following patterns can help make your code more reusable and readable but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===Suggestion of where to use pure fabrication===&lt;br /&gt;
Sometimes you may be ask to modify code that hasn't been developed well or you will need to [http://en.wikipedia.org/wiki/Refactoring refactor] the code to make it useful. In this situation you may just want to write a coupler that allows the code to go between the new code and the old. This would allow you to finish the job and help prevent a complete rewrite of the old code. The coupler would be considered pure fabrication because it will never be used again.&lt;br /&gt;
&lt;br /&gt;
[[Image:PureFab.gif]]&lt;br /&gt;
* Example 1 -Let us consider another example of saving sale instances in a database. According to [http://davidhayden.com/blog/dave/archive/2005/03/28/903.aspx Expert Pattern], we need to assign this responsibility to Sales. However, there are a large number of database operations performed. In this case, we are coupling our application to the database. Also, saving objects in a database is a common task; therefore, many classes need to know how to work with the database. Also, there is low cohesion because the Sales class performs more than one function.&lt;br /&gt;
[[Image:LowCohesion.gif]]&lt;br /&gt;
&lt;br /&gt;
One of the easy solution is to create a class that is solely responsible for saving objects in the database. Let us name this class as SalesStorage. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
[[Image:SalesStorage.gif]]&lt;br /&gt;
&lt;br /&gt;
== Where not to use pure fabrication ==&lt;br /&gt;
1. Pure fabrication should be used only when necessary. It should not be overused as in general, its not a good thing to separate behavior from the relevant information. In case of the above example of sales instances, sale could use another fabricated class to add a line item: SalesLineItemAdder. But that increases the complexity of the system. It also increases coupling as it leads to a class that knows things (the Sale) and another class that does things with that knowledge (SalesLineItemAdder).&lt;br /&gt;
&lt;br /&gt;
2. Also, pure fabrication violates a basic OO principle &amp;quot;Do not talk to strangers&amp;quot;. So in places where maintaining data and  is crucial pure fabrication should not be used.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later. We need to remember to let Design Patterns emerge, don't force them in&lt;br /&gt;
just for the sake of using a pattern. Always use the simplest solution that meets your needs, even if it doesn't include a pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf Pure Fabrication Notes]&lt;br /&gt;
*[http://www.christmann.ws/ucis342/class9/class9.html Object Oriented Analysis and Logical design]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=16053</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=16053"/>
		<updated>2008-07-28T00:38:58Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Suggestion of where to use pure fabrication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication can be thought of assigning a highly cohesive set of responsibilities to an artificial class.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===Suggestion of where to use pure fabrication===&lt;br /&gt;
Sometimes you may be ask to modify code that hasn't been developed well or you will need to [http://en.wikipedia.org/wiki/Refactoring refactor] the code to make it useful. In this situation you may just want to write a coupler that allows the code to go between the new code and the old. This would allow you to finish the job and help prevent a complete rewrite of the old code. The coupler would be considered pure fabrication because it will never be used again.&lt;br /&gt;
&lt;br /&gt;
[[Image:PureFab.gif]]&lt;br /&gt;
* Example 1 -Let us consider another example of saving sale instances in a database. According to [http://davidhayden.com/blog/dave/archive/2005/03/28/903.aspx Expert Pattern], we need to assign this responsibility to Sales. However, there are a large number of database operations performed. In this case, we are coupling our application to the database. Also, saving objects in a database is a common task; therefore, many classes need to know how to work with the database. Also, there is low cohesion because the Sales class performs more than one function.&lt;br /&gt;
[[Image:LowCohesion.gif]]&lt;br /&gt;
&lt;br /&gt;
One of the easy solution is to create a class that is solely responsible for saving objects in the database. Let us name this class as SalesStorage. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
[[Image:SalesStorage.gif]]&lt;br /&gt;
&lt;br /&gt;
== Where not to use pure fabrication ==&lt;br /&gt;
1. Pure fabrication should be used only when necessary. It should not be overused as in general, its not a good thing to separate behavior from the relevant information. In case of the above example of sales instances, sale could use another fabricated class to add a line item: SalesLineItemAdder. But that increases the complexity of the system. It also increases coupling as it leads to a class that knows things (the Sale) and another class that does things with that knowledge (SalesLineItemAdder).&lt;br /&gt;
&lt;br /&gt;
2. Also, pure fabrication violates a basic OO principle &amp;quot;Do not talk to strangers&amp;quot;. So in places where maintaining data and  is crucial pure fabrication should not be used.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later. We need to remember to let Design Patterns emerge, don't force them in&lt;br /&gt;
just for the sake of using a pattern. Always use the simplest solution that meets your needs, even if it doesn't include a pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf Pure Fabrication Notes]&lt;br /&gt;
*[http://www.christmann.ws/ucis342/class9/class9.html Object Oriented Analysis and Logical design]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15572</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15572"/>
		<updated>2008-07-25T13:43:07Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Suggestion of where to use pure fabrication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===Suggestion of where to use pure fabrication===&lt;br /&gt;
Sometimes you may be ask to modify code that hasn't been developed well or you will need to refactor the code to make it useful. In this situation you may just want to write a coupler that allows the code to go between the new code and the old. This would allow you to finish the job and help prevent a complete rewrite of the old code. The coupler would be considered pure fabrication because it will never be used again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:PureFab.gif]]&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later. We need to remember to let Design Patterns emerge, don't force them in&lt;br /&gt;
just for the sake of using a pattern. Always use the simplest solution that meets your needs, even if it doesn't include a pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf Pure Fabrication Notes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:PureFab.gif&amp;diff=15571</id>
		<title>File:PureFab.gif</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:PureFab.gif&amp;diff=15571"/>
		<updated>2008-07-25T13:41:08Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15570</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15570"/>
		<updated>2008-07-25T13:40:54Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Suggestion of where to use pure fabrication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===Suggestion of where to use pure fabrication===&lt;br /&gt;
Sometimes you may be ask to modify code that hasn't been developed well or you will need to refactor the code to make it useful. In this situation you may just want to write a coupler that allows the code to go between the new code and the old. This would allow you to finish the job and help prevent a complete rewrite of the old code. The coupler would be considered pure fabrication because it will never be used again.&lt;br /&gt;
[[Image:PureFab.gif]]&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later. We need to remember to let Design Patterns emerge, don't force them in&lt;br /&gt;
just for the sake of using a pattern. Always use the simplest solution that meets your needs, even if it doesn't include a pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf Pure Fabrication Notes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Purefab.GIF&amp;diff=15569</id>
		<title>File:Purefab.GIF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Purefab.GIF&amp;diff=15569"/>
		<updated>2008-07-25T13:38:48Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15568</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15568"/>
		<updated>2008-07-25T13:35:43Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Suggestion of where to use pure fabrication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===Suggestion of where to use pure fabrication===&lt;br /&gt;
Sometimes you may be ask to modify code that hasn't been developed well or you will need to refactor the code to make it useful. In this situation you may just want to write a coupler that allows the code to go between the new code and the old. This would allow you to finish the job and help prevent a complete rewrite of the old code. The coupler would be considered pure fabrication because it will never be used again.&lt;br /&gt;
[[Image:purefab.gif]]&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later. We need to remember to let Design Patterns emerge, don't force them in&lt;br /&gt;
just for the sake of using a pattern. Always use the simplest solution that meets your needs, even if it doesn't include a pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf Pure Fabrication Notes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15567</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15567"/>
		<updated>2008-07-25T13:35:18Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Suggestion of where to use pure fabrication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===Suggestion of where to use pure fabrication===&lt;br /&gt;
Sometimes you may be ask to modify code that hasn't been developed well or you will need to refactor the code to make it useful. In this situation you may just want to write a coupler that allows the code to go between the new code and the old. This would allow you to finish the job and help prevent a complete rewrite of the old code. The coupler would be considered pure fabrication because it will never be used again.&lt;br /&gt;
[[Image:PureFab]]&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later. We need to remember to let Design Patterns emerge, don't force them in&lt;br /&gt;
just for the sake of using a pattern. Always use the simplest solution that meets your needs, even if it doesn't include a pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf Pure Fabrication Notes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15566</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15566"/>
		<updated>2008-07-25T13:31:51Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Suggestion of where to use pure fabrication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===Suggestion of where to use pure fabrication===&lt;br /&gt;
Sometimes you may be ask to modify code that hasn't been developed well or you will need to refactor the code to make it useful. In this situation you may just want to write a coupler that allows the code to go between the new code and the old. This would allow you to finish the job and help prevent a complete rewrite of the old code. The coupler would be considered pure fabrication because it will never be used again.&lt;br /&gt;
[[Image:pf.bmp]]&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later. We need to remember to let Design Patterns emerge, don't force them in&lt;br /&gt;
just for the sake of using a pattern. Always use the simplest solution that meets your needs, even if it doesn't include a pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf Pure Fabrication Notes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15565</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15565"/>
		<updated>2008-07-25T13:30:49Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Suggestion of where to use pure fabrication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===Suggestion of where to use pure fabrication===&lt;br /&gt;
Sometimes you may be ask to modify code that hasn't been developed well or you will need to refactor the code to make it useful. In this situation you may just want to write a coupler that allows the code to go between the new code and the old. This would allow you to finish the job and help prevent a complete rewrite of the old code. The coupler would be considered pure fabrication because it will never be used again.&lt;br /&gt;
[[media:pf.bmp]]&lt;br /&gt;
[[Media:Example.ogg]][[Image:Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later. We need to remember to let Design Patterns emerge, don't force them in&lt;br /&gt;
just for the sake of using a pattern. Always use the simplest solution that meets your needs, even if it doesn't include a pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf Pure Fabrication Notes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15564</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15564"/>
		<updated>2008-07-25T13:29:29Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Suggestion of where to use pure fabrication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===Suggestion of where to use pure fabrication===&lt;br /&gt;
Sometimes you may be ask to modify code that hasn't been developed well or you will need to refactor the code to make it useful. In this situation you may just want to write a coupler that allows the code to go between the new code and the old. This would allow you to finish the job and help prevent a complete rewrite of the old code. The coupler would be considered pure fabrication because it will never be used again.&lt;br /&gt;
[[pf.bmp]]&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later. We need to remember to let Design Patterns emerge, don't force them in&lt;br /&gt;
just for the sake of using a pattern. Always use the simplest solution that meets your needs, even if it doesn't include a pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf Pure Fabrication Notes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15561</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15561"/>
		<updated>2008-07-25T13:19:03Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Suggestion of where to use pure fabrication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===Suggestion of where to use pure fabrication===&lt;br /&gt;
Sometimes your ask to modify code that hasnt been developed well or you will need to refactor the code to make it useful. In this situation you may just want to write a coupler that allows the code to go between the new code and the old. This would allow you to finish the job and help prevent a complete rewrite of the old code.&lt;br /&gt;
[[Image:pf.bmp]]&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later. We need to remember to let Design Patterns emerge, don't force them in&lt;br /&gt;
just for the sake of using a pattern. Always use the simplest solution that meets your needs, even if it doesn't include a pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf Pure Fabrication Notes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15559</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15559"/>
		<updated>2008-07-25T13:13:06Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* External links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===Suggestion of where to use pure fabrication===&lt;br /&gt;
Sometimes your ask to modify code that hasnt been developed well or you will need to refactor the code to make it useful. In this situation you may just want to write a coupler that allows the code to go between the new code and the old. This would allow you to finish the job and help prevent a complete rewrite of the old code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later. We need to remember to let Design Patterns emerge, don't force them in&lt;br /&gt;
just for the sake of using a pattern. Always use the simplest solution that meets your needs, even if it doesn't include a pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf Pure Fabrication Notes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15558</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15558"/>
		<updated>2008-07-25T13:12:52Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* External links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===Suggestion of where to use pure fabrication===&lt;br /&gt;
Sometimes your ask to modify code that hasnt been developed well or you will need to refactor the code to make it useful. In this situation you may just want to write a coupler that allows the code to go between the new code and the old. This would allow you to finish the job and help prevent a complete rewrite of the old code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later. We need to remember to let Design Patterns emerge, don't force them in&lt;br /&gt;
just for the sake of using a pattern. Always use the simplest solution that meets your needs, even if it doesn't include a pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf Pure Fabrication Notes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15557</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15557"/>
		<updated>2008-07-25T13:12:09Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* examples of where to use pure fabrication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===Suggestion of where to use pure fabrication===&lt;br /&gt;
Sometimes your ask to modify code that hasnt been developed well or you will need to refactor the code to make it useful. In this situation you may just want to write a coupler that allows the code to go between the new code and the old. This would allow you to finish the job and help prevent a complete rewrite of the old code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later. We need to remember to let Design Patterns emerge, don't force them in&lt;br /&gt;
just for the sake of using a pattern. Always use the simplest solution that meets your needs, even if it doesn't include a pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15555</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15555"/>
		<updated>2008-07-25T12:45:17Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===examples of where to use pure fabrication===&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later. We need to remember to let Design Patterns emerge, don't force them in&lt;br /&gt;
just for the sake of using a pattern. Always use the simplest solution that meets your needs, even if it doesn't include a pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15554</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15554"/>
		<updated>2008-07-25T12:35:42Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* examples of code sequences that would be awkward */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===examples of where to use pure fabrication===&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15550</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15550"/>
		<updated>2008-07-25T12:26:29Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* External links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
*[[http://alcor.concordia.ca/~smw/comp354/L22web-2x2.pdf]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15549</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15549"/>
		<updated>2008-07-25T12:22:09Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15548</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15548"/>
		<updated>2008-07-25T12:22:02Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* External links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later.   &lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15546</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15546"/>
		<updated>2008-07-25T12:21:42Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later.   &lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15543</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15543"/>
		<updated>2008-07-25T12:19:37Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* How would you classify it */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications. [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later.   &lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15542</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15542"/>
		<updated>2008-07-25T12:18:31Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications.  Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice.&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later.   &lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15540</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=15540"/>
		<updated>2008-07-25T12:16:29Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a [[http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 design pattern]] can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a pattern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Pure Fabrication] is more of a design strategy than a design pattern. It helps designers create flexible solutions to a problem, and isolate changes to a subset of objects in applications to preserve the low-coupling&lt;br /&gt;
and high cohesion of classes in design and to increase software maintainability. &lt;br /&gt;
&lt;br /&gt;
=== Why pure fabrication? ===&lt;br /&gt;
We do not want our clients to know the fine grained entities to the client, so we'll have to provide a high level view to them. To achieve this, we do not want to change the interface of the entity. Therefore, to solve this problem, we can provide an additional element that provides a distributable view to the system. It also facilitates the co-ordination of the business entities, so that they still remain independent of each other. This approach is called &amp;quot;Pure Fabrication&amp;quot;, because, from the business point of view, an insignificant class was introduced to decouple the client from the business objects.&lt;br /&gt;
&lt;br /&gt;
* Pure fabrication is used when an operation does not conceptually belong to any object. For example, a class is not conceptually related to relational database, but it may be used to manage the database. Following the natural contours of the problem, you can implement these operations in services. It is known as &amp;quot;Pure Fabrication&amp;quot; in GRASP.&lt;br /&gt;
&lt;br /&gt;
* Let us consider another scenario, a system in which we may need a class that is solely responsible for saving objects in relational database. Let us name this class as PersistentManager. It will take care of the insert, update, delete etc. operations. It encapsulates the database from the clients, by providing them coarse view of database operations. Also, it facilitates co-ordination among different databases. The PersistentManager class is itself relatively cohesive and has the sole purpose of managing and storing objects. It is a generic and reusable object and a good example of pure fabrication.&lt;br /&gt;
&lt;br /&gt;
* The controller, in a MVC architecture can be viewed as an elegant example of pure fabrication pattern.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications.  Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice.&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later.  Depositories and [http://en.wikipedia.org/wiki/Factory_method_pattern Factories] are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. &lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
*[http://ai.ee.ccu.edu.tw/oose/Fall05/notes/sec-Ch05.pdf Pattern oriented software development]&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14998</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14998"/>
		<updated>2008-07-23T10:03:34Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* How would you classify it */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a design pattern can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a patttern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is classified as one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications.  Most code is created for a specific application. Plug-in and refactoring can help redesign code to be used in the next generation. At some point when your developing code you may decide that the life cycle of the code is short and so you develope code for short term. Following patterns can help make your code more reusable and readble but in some situations writing code for just that application where it doesn't follow any pattern is the best choice.&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later.  Depositories and Factories are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. &lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14997</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14997"/>
		<updated>2008-07-23T09:48:24Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* How would you classify it */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a design pattern can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a patttern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is one of the nine [http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx GRASP Patterns] that help aid developers in assigning responsibilities to objects in your web applications and winform applications.  These nine GRASP Patterns are found in Craig Larman's excellent book, Applying UML and Patterns, An Introduction to Object-Oriented Analysis and Design and Iterative Development.  I have talked about a number of these GRASP Patterns already, which you can find at the end of the article&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later.  Depositories and Factories are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. &lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14996</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14996"/>
		<updated>2008-07-23T09:46:27Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a design pattern can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a patttern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is one of the nine GRASP Patterns that help aid developers in assigning responsibilities to objects in your web applications and winform applications.  These nine GRASP Patterns are found in Craig Larman's excellent book, Applying UML and Patterns, An Introduction to Object-Oriented Analysis and Design and Iterative Development.  I have talked about a number of these GRASP Patterns already, which you can find at the end of the article&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#High_Cohesion high cohesion] and [http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Low_Coupling low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later.  Depositories and Factories are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. &lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14995</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14995"/>
		<updated>2008-07-23T09:44:34Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a design pattern can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a patttern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is one of the nine GRASP Patterns that help aid developers in assigning responsibilities to objects in your web applications and winform applications.  These nine GRASP Patterns are found in Craig Larman's excellent book, Applying UML and Patterns, An Introduction to Object-Oriented Analysis and Design and Iterative Development.  I have talked about a number of these GRASP Patterns already, which you can find at the end of the article&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create high cohesion and [http://davidhayden.com/blog/dave/archive/2004/12/14/690.aspx low coupling]. Today with code changing at a rapid pace it may be easier to design something one time and redesign it or refactor it later.  Depositories and Factories are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data. &lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14994</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14994"/>
		<updated>2008-07-23T09:41:05Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a design pattern can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a patttern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is one of the nine GRASP Patterns that help aid developers in assigning responsibilities to objects in your web applications and winform applications.  These nine GRASP Patterns are found in Craig Larman's excellent book, Applying UML and Patterns, An Introduction to Object-Oriented Analysis and Design and Iterative Development.  I have talked about a number of these GRASP Patterns already, which you can find at the end of the article&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isn't a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create high cohesion and [http://davidhayden.com/blog/dave/archive/2004/12/14/690.aspx low coupling]. This usually will allow better code re-use from application to application.  Depositories and Factories are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14993</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14993"/>
		<updated>2008-07-23T09:39:59Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* External links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a design pattern can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a patttern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is one of the nine GRASP Patterns that help aid developers in assigning responsibilities to objects in your web applications and winform applications.  These nine GRASP Patterns are found in Craig Larman's excellent book, Applying UML and Patterns, An Introduction to Object-Oriented Analysis and Design and Iterative Development.  I have talked about a number of these GRASP Patterns already, which you can find at the end of the article&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isnt a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create high cohesion and [http://davidhayden.com/blog/dave/archive/2004/12/14/690.aspx low coupling]. This usually will allow better code re-use from application to application.  Depositories and Factories are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
*[http://www.ibm.com/developerworks/rational/library/jun07/cuellar/ the case for High Cohesion and low coupling]&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14992</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14992"/>
		<updated>2008-07-23T09:36:52Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a design pattern can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a patttern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is one of the nine GRASP Patterns that help aid developers in assigning responsibilities to objects in your web applications and winform applications.  These nine GRASP Patterns are found in Craig Larman's excellent book, Applying UML and Patterns, An Introduction to Object-Oriented Analysis and Design and Iterative Development.  I have talked about a number of these GRASP Patterns already, which you can find at the end of the article&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isnt a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create high cohesion and [http://davidhayden.com/blog/dave/archive/2004/12/14/690.aspx low coupling]. This usually will allow better code re-use from application to application.  Depositories and Factories are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14991</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14991"/>
		<updated>2008-07-23T09:28:56Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a design pattern can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a patttern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is one of the nine GRASP Patterns that help aid developers in assigning responsibilities to objects in your web applications and winform applications.  These nine GRASP Patterns are found in Craig Larman's excellent book, Applying UML and Patterns, An Introduction to Object-Oriented Analysis and Design and Iterative Development.  I have talked about a number of these GRASP Patterns already, which you can find at the end of the article&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isnt a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create high cohesion and low coupling. This usually will allow better code re-use from application to application.  Depositories and Factories are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14990</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14990"/>
		<updated>2008-07-23T09:27:40Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* examples of code sequences that would be awkward */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a design pattern can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a patttern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is one of the nine GRASP Patterns that help aid developers in assigning responsibilities to objects in your web applications and winform applications.  These nine GRASP Patterns are found in Craig Larman's excellent book, Applying UML and Patterns, An Introduction to Object-Oriented Analysis and Design and Iterative Development.  I have talked about a number of these GRASP Patterns already, which you can find at the end of the article&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
Sometimes its better to develop something that works better in your code but isnt a perfect pattern. The Pure Fabrication Pattern is where you add classes into your application to create high cohesion and low coupling. This usually will allow better code re-use from application to application.  Depositories and Factories are very similar to pure fabrication, they help with object persistence and object creation. They delegate object reconstitution and creation to specialized classes so domain objects are mere data containers and behaviors that act on that data.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14989</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14989"/>
		<updated>2008-07-23T09:19:29Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Comparisons of */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a design pattern can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a patttern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
==How would you classify it ==&lt;br /&gt;
Pure Fabrication is one of the nine GRASP Patterns that help aid developers in assigning responsibilities to objects in your web applications and winform applications.  These nine GRASP Patterns are found in Craig Larman's excellent book, Applying UML and Patterns, An Introduction to Object-Oriented Analysis and Design and Iterative Development.  I have talked about a number of these GRASP Patterns already, which you can find at the end of the article&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14988</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14988"/>
		<updated>2008-07-23T09:15:04Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Programming all code by a design pattern can make the code more readable and easy to manipulate in the future. What do you do when you don't have any patterns that actually work in the design? A pure fabrication is a class that does not represent a concept in the problem domain. It is specially made up to achieve low coupling, high cohesion, and the reuse potential only if needed. So in code where you need to put something in and you can't come up with a patttern to match it, it may be time to just write the code and worry about a perfect solution later.&lt;br /&gt;
&lt;br /&gt;
==Comparisons of ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14987</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14987"/>
		<updated>2008-07-23T09:07:58Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
A pure fabrication is a class that does not represent a concept in the problem domain, specially made up to achieve low coupling, high cohesion, and the reuse potential thereof derived (when a solution presented by the Information Expert pattern does not).&lt;br /&gt;
&lt;br /&gt;
==Comparisons of ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14929</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14929"/>
		<updated>2008-07-23T02:02:12Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* External links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
==Comparisons of ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
*[http://web.njit.edu/~gblank/cis683/Larman%20Chapter%2025.ppt GRASP Pure Fabrication]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14928</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14928"/>
		<updated>2008-07-23T01:59:58Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* External links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
==Comparisons of ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
*[http://codebetter.com/blogs/david.hayden/archive/2006/08/26/Over_2D00_Architecting-Via-Pure-Fabrication-and-Indirection-to-Reduce-Coupling.aspx Over-Architecting Via Pure Fabrication]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)#Pure_Fabrication  Grasp OOD]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14924</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14924"/>
		<updated>2008-07-23T01:56:16Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* External links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
==Comparisons of ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
*[http://davidhayden.com/blog/dave/archive/2005/09/18/2476.aspx Grasp Pattern]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_Assignment&amp;diff=14920</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 Assignment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_Assignment&amp;diff=14920"/>
		<updated>2008-07-23T01:51:39Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#[[CSC/ECE_517_Summer_2008/wiki3_1_th | RDB/OO Patterns]]&lt;br /&gt;
#[[CSC/ECE_517_Summer_2008/wiki3_1_PF | Pure Fabrication]]&lt;br /&gt;
----&lt;br /&gt;
[[CSC/ECE 517 Summer 2008]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14918</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14918"/>
		<updated>2008-07-23T01:50:44Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* External links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
==Comparisons of ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14917</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14917"/>
		<updated>2008-07-23T01:49:53Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
==Comparisons of ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki1 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14916</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14916"/>
		<updated>2008-07-23T01:49:26Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the beloved features of '''[http://www.ruby-lang.org/en/ Ruby]''' is the block based '''[http://en.wikipedia.org/wiki/Iterator Iterator]'''. A Ruby Iterator is simply a method that loops over the contents of an object without exposing its underlying representation. &lt;br /&gt;
The verb 'iterate' means &amp;quot;do the same thing many times' so 'iterator' means &amp;quot;one which does the same thing many times&amp;quot;. It can also be considered as an object that behaves like a ''[http://www.faqs.org/docs/learnc/x658.html generic pointer]''. The iterator usually references to one particular element in the object collection and then modifies itself so that it points to the next element. '''[http://en.wikipedia.org/wiki/Generator_%28computer_science%29 Generators]''' are a similar feature in '''[http://www.python.org/ Python]'''. The name came as it is the entity which generate iterators. It allows you to write a function that can return a result and pause, resuming in the same place the next time you call the function. The generator feature in Ruby can be implemented by adding a library class called Generator or external iterator. In python the generator is a feature and part of the language.&lt;br /&gt;
 &lt;br /&gt;
===Problem Definition===&lt;br /&gt;
Ruby, like Java, has iterators to facilitate doing operations on each member of a set. Python has generators as well. Describe how generators differ from iterators, and find examples of code sequences using generators that would be awkward with iterators.&lt;br /&gt;
&lt;br /&gt;
== Iterator ==&lt;br /&gt;
The word &amp;quot;iterator&amp;quot; means different things in different contexts and programming languages, but it's always got something to do with visiting each one of a set of objects, where &amp;quot;object&amp;quot; doesn't necessarily mean &amp;quot;class instance&amp;quot;: Just take &amp;quot;object&amp;quot; to mean &amp;quot;some instance of some data type, somewhere&amp;quot;. Iterators may provide additional features and may behave in a different way depending on the languages.&lt;br /&gt;
&lt;br /&gt;
===Implementing Iterator===&lt;br /&gt;
Most of the ''[http://en.wikipedia.org/wiki/Object-oriented_programming OOP]'' languages provide ways to make iterations easy, for example some languages provide class for controlling iteration, etc. But Ruby allows the definition of control structures directly. In terms of Ruby, such user-defined control structures are called iterators.&lt;br /&gt;
&lt;br /&gt;
====Iterator in Ruby====&lt;br /&gt;
Iterator in Ruby is simply a method that invokes a block of code. The power is in the code block between the do and end keywords or {...}. Meaning, we can put as much, or little, code in there as needed. And each item being iterated over is passed into the block as a parameter between the pipes.  Examples of different iterators are given below.&lt;br /&gt;
&lt;br /&gt;
=====Using Each [http://www.math.hokudai.ac.jp/~gotoken/ruby/ruby-uguide/uguide09.html]=====&lt;br /&gt;
&lt;br /&gt;
 a = [ 1, 2, 3 ]&lt;br /&gt;
 a.each { |x| print x }&lt;br /&gt;
 ==&amp;gt;123&lt;br /&gt;
 #The internal implementation of the Array.each method could be defined internally like this:&lt;br /&gt;
 # def each&lt;br /&gt;
 # for i in 0...size&lt;br /&gt;
 #   yield(self[i])&lt;br /&gt;
 #  end&lt;br /&gt;
 #  end&lt;br /&gt;
   &lt;br /&gt;
x is the local variable in which each value of a is stored. And, each is probably the simplest iterator which yield successive elements of its collection.The above two line code is translated into C.&lt;br /&gt;
&lt;br /&gt;
 #include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 main()&lt;br /&gt;
 {&lt;br /&gt;
   int s[3]={1,2,3};&lt;br /&gt;
   int i=0;&lt;br /&gt;
   while(i&amp;lt;3)&lt;br /&gt;
   {&lt;br /&gt;
     printf(&amp;quot;%d&amp;quot;,s[i]);&lt;br /&gt;
     i++;&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 ==&amp;gt;123&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
The advantage of the block-passing style is that generators are a lot more built-in to the language. For example, the below two codes are equivalent and in neither of those cases is an array instantiated with all members of the range (X..Y):&lt;br /&gt;
  1.upto(100000).each {|x| puts x}&lt;br /&gt;
&lt;br /&gt;
  for i in 1..100000&lt;br /&gt;
  puts i&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
=====Using Find [http://www.nickpeters.net/2008/01/09/ruby-iterators/]=====&lt;br /&gt;
&lt;br /&gt;
 a = [ 10,20,30 ]&lt;br /&gt;
 a.find { |n| n % 5 == 0 }&lt;br /&gt;
 ==&amp;gt;10&lt;br /&gt;
The find iterator method in ruby will compare each element using some comparison operator (&amp;lt;, &amp;gt;, ==, etc.) and based on the boolean result (true or false), it will return the first matching value.&lt;br /&gt;
&lt;br /&gt;
=====Using Collect [http://www.nickpeters.net/2008/01/09/ruby-iterators/]=====&lt;br /&gt;
&lt;br /&gt;
 a = [ 1, 2, 3, 4, 5 ]&lt;br /&gt;
 b = a.collect { |n| n + 1 }&lt;br /&gt;
 ==&amp;gt;[2, 3, 4, 5, 6]&lt;br /&gt;
Another common iterator is the collect that returns an array of elements that is taken from the corresponding collections. &lt;br /&gt;
Iterator can return derived values and not only limited to accessing the data stored in arrays and hashes.&lt;br /&gt;
&lt;br /&gt;
====Iterator in Python====&lt;br /&gt;
Python also supports iteration over containers. It is implicitly used in the for statement, in ''[http://en.wikipedia.org/wiki/List_comprehension list comprehensions]'', and in ''[http://en.wikipedia.org/wiki/Python_syntax_and_semantics#Generator_expressions generator expressions]''. An iteration protocol is defined so that iteration is possible over different objects. Most of the container objects can be looped over using for statement. Example of a typical implicit iteration over a sequence is given below [http://docs.python.org/tut/node11.html#SECTION0011900000000000000000].&lt;br /&gt;
 for element in [1, 2, 3]:&lt;br /&gt;
    print element&lt;br /&gt;
 &lt;br /&gt;
The actual internal implementation is that the for statement calls iter() on the container object. The function returns an iterator object that defines the method next(). The method next() then returns the next item one at a time. When there are no more elements, next() raises a StopIteration exception which tells the for loop to terminate. &lt;br /&gt;
Iterators can also be defined explicitly. An example using explicit iterators is given below [http://en.wikipedia.org/wiki/Iterator#Python]&lt;br /&gt;
&lt;br /&gt;
 it = iter(sequence)&lt;br /&gt;
 while True:&lt;br /&gt;
    try:&lt;br /&gt;
        value = it.next()&lt;br /&gt;
    except StopIteration:&lt;br /&gt;
        break&lt;br /&gt;
    print value&lt;br /&gt;
&lt;br /&gt;
Python defines several iterator objects to support iteration over general and specific sequence types, dictionaries, and other more specialized forms. The iterator object just have to implement __iter()__ and next().  Ruby iterator has an advantage over Python as it supports code blocks as objects where as Python can use only the for loop for iteration.&lt;br /&gt;
&lt;br /&gt;
===Uses===&lt;br /&gt;
# The main use of iterator is it hides the internal details from the user when manipulating with the objects.&lt;br /&gt;
# Iterator is trivially more cleaner and elegant which makes it more easy to maintain compared to the accessing of elements based on ''[http://en.wikipedia.org/wiki/Index_%28information_technology%29 indexing]''.&lt;br /&gt;
# Iterators follow a consistent way of iterating through all kinds of data structures, as a result it becomes more readable and reusable.&lt;br /&gt;
# Using Iterators, inserting of a new element into the container object is easy even after the iterator has advanced beyond the first element. On the other hand, it is more difficult when using indexing as it requires changing of index numbers.&lt;br /&gt;
&lt;br /&gt;
== Generators ==&lt;br /&gt;
A generator looks like a function but behaves like an iterator. Both Ruby and Python support generators. As mentioned in the introduction, Ruby has a Generator library and Python has generator as a fundamental part of the language. As being a language feature it is more robust and syntactically more concise and cleaner. On the other hand, using a library class helps to learn a language more easily and more elegant with the less number of features.&lt;br /&gt;
&lt;br /&gt;
=== Generators in Python===&lt;br /&gt;
Generators are a simple and powerful tool for creating iterators. They are written like regular functions and called only once. It then returns an iterator which is the actual iterator with _iter()_ and next() methods. Generator doesn't have to worry about the iterator protocol (__iter()__,.next()..), it just works. Yield statement is used whenever they want to return data. Each time next() is called, the generator resumes where it left-off (it remembers all the data values and which statement was last executed). The generator function does NOT run to completion when it's first called - instead, it only runs until it has a value available to return, at which point it yields that value back and suspends operation until called again to resume.&lt;br /&gt;
This is described with an example below [http://www.builderau.com.au/program/python/soa/Lazy-list-builders-Generators-in-Python/0,2000064084,339279708,00.htm].&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; def generator1():&lt;br /&gt;
 ...     yield &amp;quot;first&amp;quot;&lt;br /&gt;
 ...     yield &amp;quot;second&amp;quot;&lt;br /&gt;
 ...     yield &amp;quot;third&amp;quot;&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; gen = generator1()&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; gen&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt;            #No output was produced. &lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; gen.next()&lt;br /&gt;
     'first'    #Function starts executing here.&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; gen.next()&lt;br /&gt;
     'second'&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; gen.next()&lt;br /&gt;
     'third'&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; gen.next()&lt;br /&gt;
    Traceback (most recent call last):&lt;br /&gt;
    File &amp;quot;&amp;quot;, line 1, in ?&lt;br /&gt;
    StopIteration&lt;br /&gt;
&lt;br /&gt;
First, a generator called generator1 is defined which will yield three values, the strings &amp;quot;first&amp;quot;, &amp;quot;second&amp;quot; and &amp;quot;third&amp;quot;. When we create a new generator object (gen) it begins the function. Each time you call the generator's next method, it continues the function until the next yield. When the generator reaches the end of the block, or reaches a return statement, it throws a StopIteration exception.&lt;br /&gt;
A generator is a one time operation. So, the generated data is iterated only once but one can call the generated function again if needed. In this way, ''[http://en.wikipedia.org/wiki/Lazy_evaluation Lazy evaluation]'' can be achieved which increases the performance by eliminating unnecessary calculation of values that are never used.&lt;br /&gt;
Generator can be more powerful as Python has now included the ability to return the data the generator. For example :&lt;br /&gt;
 x= yield y&lt;br /&gt;
From the perspective of the caller of the generator, this statement returns control back to the caller, just as before. From the perspective of the generator, when the execution comes back into the generator, a value will come with it. In this case, the generator saves it into the variable x. The value comes when the caller calls a function called send() to pass a value back into the generator. The function send() behaves just like the function next(), except that it passes a value. This is explained with an example below.&lt;br /&gt;
   &lt;br /&gt;
 class MyStuff:&lt;br /&gt;
   def __init__(self):&lt;br /&gt;
   self.a = [2,4,6,8,10,12]&lt;br /&gt;
   def iterate(self):&lt;br /&gt;
   i = 0&lt;br /&gt;
   while i &amp;lt; len(self.a):&lt;br /&gt;
   val = yield self.a[i]&lt;br /&gt;
   if val == None:&lt;br /&gt;
   i += 1&lt;br /&gt;
   else:&lt;br /&gt;
   if val &amp;lt; 0:&lt;br /&gt;
   val = 0&lt;br /&gt;
   if val &amp;gt;= len(self.a):&lt;br /&gt;
   val = len(self.a) -1&lt;br /&gt;
   i = val&lt;br /&gt;
Here, send() is used to let the caller of the generator reposition the index in the array. Value received is checked whether it is within the bounds of the array, else the closest boundary is set. The value generator received is tested and stored in 'val'.If val is None, that means the generator received no value (the calling code used next(), or perhaps send(None)).&lt;br /&gt;
&lt;br /&gt;
=== Generators in Ruby===&lt;br /&gt;
Some of the reason's why Generator library comes into play where external iterators are implemented are mentioned below.&lt;br /&gt;
*The internal iterator in Ruby would fail if the iterator is required to pass through a method that needs access on each of the values returned by that iterator.&lt;br /&gt;
*Iterators cannot iterate over more than one collection at a time, they cannot be paused or stopped in the middle.&lt;br /&gt;
*They can only implement a single traversal strategy. &lt;br /&gt;
Example with the library to iterate over a block is given below [http://www.ruby-doc.org/docs/ProgrammingRuby/].&lt;br /&gt;
&lt;br /&gt;
 require 'generator'&lt;br /&gt;
 gen = Generator.new do |result|&lt;br /&gt;
 result.yield &amp;quot; Start&amp;quot;&lt;br /&gt;
 3.times { |i| result.yield i}&lt;br /&gt;
 result.yield &amp;quot;done&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
 while gen.next?&lt;br /&gt;
 print gen.next,&amp;quot;--&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
 ==&amp;gt; Start--0--1--2--done--&lt;br /&gt;
&lt;br /&gt;
==An example to print the successive elements from 10 to 20 in ruby and python ==&lt;br /&gt;
===Using generator in Python===&lt;br /&gt;
&lt;br /&gt;
 def countfrom(n):&lt;br /&gt;
    while True:&lt;br /&gt;
        yield n&lt;br /&gt;
        n += 1&lt;br /&gt;
 for i in countfrom(10):&lt;br /&gt;
    if i &amp;lt;= 20:&lt;br /&gt;
        print i&lt;br /&gt;
    else:&lt;br /&gt;
        break&lt;br /&gt;
 ==&amp;gt;10,11,12,13,14,15,16,17,18,19,20&lt;br /&gt;
&lt;br /&gt;
===Using iterators in Ruby===&lt;br /&gt;
&lt;br /&gt;
 (10..20).each { |i| print i,&amp;quot;,&amp;quot;  }&lt;br /&gt;
 ==&amp;gt;10,11,12,13,14,15,16,17,18,19,20&lt;br /&gt;
This above example shows how iterators in Ruby are not very elegant.&lt;br /&gt;
&lt;br /&gt;
===Using generator in Ruby===&lt;br /&gt;
 require 'generator'&lt;br /&gt;
 gen = Generator.new(10..20)&lt;br /&gt;
 while gen.next?&lt;br /&gt;
   print gen.next, &amp;quot;, &amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
 ==&amp;gt;10,11,12,13,14,15,16,17,18,19,20&lt;br /&gt;
With Ruby generators the code flows similar to Python.&lt;br /&gt;
&lt;br /&gt;
==Comparisons of Ruby generators and Python generators ==&lt;br /&gt;
&lt;br /&gt;
Python was intended to be a highly readable language.Ruby can be a highly readable language with the use of external iterators. Ruby's internal iterators aren't always the best solution. Adding the generator or external iterators function helps get over the difficulty of  writing the code and helps with the readability. This sort of makes Ruby like a highly readable language like Python. Ruby's code however runs slower than many compiled languages and other major scripting languages such as Python.  &lt;br /&gt;
&lt;br /&gt;
===examples of code sequences that would be awkward ===&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* '''[http://www.ruby-lang.org/en/ Ruby]'''&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby The Pragmatic Programmer's Guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki1 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14913</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 1 PF</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_1_PF&amp;diff=14913"/>
		<updated>2008-07-23T01:42:03Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pure fabrication==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is a good idea to introduce into a&lt;br /&gt;
system an object that has no counterpart in the real world. This is&lt;br /&gt;
called the pure fabrication pattern. Find examples of pure&lt;br /&gt;
fabrication, and weave them into a narrative that can teach&lt;br /&gt;
programmers when it is helpful and when it is not helpful to fabricate&lt;br /&gt;
objects.&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_8_Inh-Del&amp;diff=14416</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 8 Inh-Del</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_8_Inh-Del&amp;diff=14416"/>
		<updated>2008-07-09T01:35:31Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Inheritance vs Delegation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Inheritance vs Delegation=&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Inheritance_(programming) Inheritance] and [http://en.wikipedia.org/wiki/Delegation_(programming) delegation] plays a very important role in object-oriented languages. Both of the techniques facilitates the reuse of code that exist in another class. This WIKI will cite examples that show cases where inheritance is better, and cases where delegation is better. I also characterize the situations in which you should employ one or the other.&lt;br /&gt;
&lt;br /&gt;
== Inheritance ==&lt;br /&gt;
In [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented programming OOP], [http://en.wikipedia.org/wiki/Inheritance_(computer_science) inheritance] is a way to form new classes (instances of which are called objects) using classes that have already been defined. The new classes, known as derived or classes, take over (or inherit) attributes and behavior of the pre-existing classes, which are referred to as base classes (or ancestor classes). It is intended to help reuse existing code with little or no modification.&lt;br /&gt;
&lt;br /&gt;
The top most class is called as the parent class, base class or a superclass.The classes derived from the parent class are known as child classes or [http://www.jguru.com/faq/view.jsp?EID=27916 subclasses].The lower classes of the hierarchy inherit from the upper class. Classes get more specialized as you move toward the bottom of the hierarchy.The subclasses have more functionality than superclass because of this feature and create their own new functionality.&lt;br /&gt;
&lt;br /&gt;
The most common reason of using inheritance is to reuse existing classes or objects. Inheritance represent the is-a relationship between classes. For example, A mallard IS-A duck and IS-A mammal and therefore can be extended with inheritance from the base class of duck.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example of Inheritance===&lt;br /&gt;
 public class Car{&lt;br /&gt;
    public int gear;&lt;br /&gt;
    public int speed;	&lt;br /&gt;
    public Car(int speed_of_car, int gear_of_car) {&lt;br /&gt;
        gear = speed_of_car;&lt;br /&gt;
        speed = gear_of_car;&lt;br /&gt;
    }&lt;br /&gt;
    public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 public class Bmw extends Car {&lt;br /&gt;
   public int seat_height;&lt;br /&gt;
   public Toyota(int speed_of_car, int new_gear , int new_seat_height) {&lt;br /&gt;
        super( speed_of_car, new_gear);&lt;br /&gt;
        seat_height = new_seat_height;&lt;br /&gt;
    }		   &lt;br /&gt;
    public void set_height(int height) {&lt;br /&gt;
        seat_height= height;&lt;br /&gt;
    }	&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In this example Car is a base class where as Bmw is a derived class. Bmw has all the properties of Car (gear, speed) but it has its own functionality adjusting the height of seat.&lt;br /&gt;
All the cars can be derived from the base class Car which has the common functionality gear and speed and each derived class can add their own fuctionality.So all the common code in the base class and specific code in the child class.&lt;br /&gt;
&lt;br /&gt;
== Delegation==&lt;br /&gt;
A technique, which provides the functionality of implementation of a particular interface to a field or expression is called delegation. Delegation passes a duty off to someone else.&lt;br /&gt;
It can be define in terms of objects ,where one object forwards  certain function calls to another object which is called its delegate. Some languages do not support direct delegation and some do not provide the feature of [http://en.wikipedia.org/wiki/Polymorphism_(computer_science)dynamic polymorphism]. &lt;br /&gt;
&lt;br /&gt;
Delegation is a very powerful reuse technique. The most important feature of delegation is its run time flexibility. The delegates can be changed at run time where other processes like inheritance is normally created at compile time.&lt;br /&gt;
&lt;br /&gt;
To be more specific [http://http://en.wikipedia.org/wiki/Delegation_pattern delegation pattern]&lt;br /&gt;
is where an object outwardly expresses certain behavior but in reality delegates responsibility for implementing that behavior to an associated object in an Inversion of Responsibility. The delegation pattern is the fundamental abstraction that underpins [http://en.wikipedia.org/wiki/Composition composition] (also referred to as aggregation), [http://en.wikipedia.org/wiki/Mixin mixins] and [http://en.wikipedia.org/wiki/Aspect aspects].&lt;br /&gt;
&lt;br /&gt;
===Example of Delegation===&lt;br /&gt;
 public interface Car{&lt;br /&gt;
    public int gear;&lt;br /&gt;
    public int speed;	    &lt;br /&gt;
    public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 public class Bmw implements Car {&lt;br /&gt;
     public int seat_height;&lt;br /&gt;
     public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }	   &lt;br /&gt;
    public void set_height(int height) {&lt;br /&gt;
        seat_height= height;&lt;br /&gt;
    }	&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the delegation, child class does not inherit all the properties of base class by default.All the methods that are defined in the base class should be necessarily defined in the child class and child class can add its own functionality.[http://java.sun.com/docs/books/tutorial/java/IandI/subclasses.html Inheritance Ex]&lt;br /&gt;
&lt;br /&gt;
==Where to use Delegation and Inheritance==&lt;br /&gt;
&lt;br /&gt;
Inheritance can not be used everywhere even if satisfies the reuse, is-a relationship and public interface.[http://oreilly.com/catalog/hfdesignpat/chapter/ch03.pdf DesignPatterns]&lt;br /&gt;
Ex[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 :-]&lt;br /&gt;
&lt;br /&gt;
 class Duck{&lt;br /&gt;
   swim();&lt;br /&gt;
   quack();&lt;br /&gt;
   color();&lt;br /&gt;
 }&lt;br /&gt;
 class MallradDuck extends Duck{&lt;br /&gt;
  display();&lt;br /&gt;
 } &lt;br /&gt;
 class RubberDuck extends Duck{&lt;br /&gt;
  display();&lt;br /&gt;
 }&lt;br /&gt;
 class RedHeadDuck extends Duck{&lt;br /&gt;
 display();&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
In the following example all three type of ducks inherit all the properties of a duck. But the rubber duck can neither swim nor quack. So at this point because of the inheritance property&lt;br /&gt;
rubber duck inherits the swim() and quack() method. It proves that inheritance should not be used and this is where a method like  delegation would be a better solution. RubberDuck has a color just like the mallardDuck and RedHeadDuck. so MallardDuck and RedHeadDuck are perfect to use inheritance on.&lt;br /&gt;
&lt;br /&gt;
Using delegation to satisfy the following case:-&lt;br /&gt;
 interface Swim{&lt;br /&gt;
  swim();&lt;br /&gt;
 {&lt;br /&gt;
 interface Quack{&lt;br /&gt;
  quack();&lt;br /&gt;
 {&lt;br /&gt;
 interface Color{&lt;br /&gt;
 color();&lt;br /&gt;
 {&lt;br /&gt;
 class MallardDuck implements Swim implements Quack ,Color{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
 class RedHeadDuck implements Swim implements Quack ,Color{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
 class RubberDuck implements Color{&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In this example there is somewhat more code  but it satisfies the functionality of the different types of ducks. The mallardDuck and the RedHeadDuck has the functionality of swim, quack and color whereas, rubberDuck has only color it can neither swim nor quack. Here through delegation some additional properties of a particular duck can also be added without affection the existing code. The functionality of fly in RedHeadDuck  can be added without touching the other type of ducks. &lt;br /&gt;
&lt;br /&gt;
 interface Fly{&lt;br /&gt;
  fly();&lt;br /&gt;
 {&lt;br /&gt;
 class RedHeadDuck implements Swim implements Quack implements Color implements Fly{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
  fly();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Listed differences between Inheritance and Delegation==&lt;br /&gt;
&lt;br /&gt;
* Delegation is [http://www.jguru.com/faq/view.jsp?EID=27916 dynamic] in nature whereas Inheritance is [http://en.wikipedia.org/wiki/Inheritance_(computer_science) static] in nature. Since the delegation is dynamic, the [http://en.wikipedia.org/wiki/Delegation_(programming) run] time code can be changed in delegation. Inheritance is defined at compile time.  &lt;br /&gt;
&lt;br /&gt;
* Inheritance is faster than delegation because it is created at compile time whereas, delegation is created at run time.&lt;br /&gt;
&lt;br /&gt;
*Inheritance is based on a [http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=40729 is-a] relationship among classes, delegation has the property of [http://en.wikipedia.org/wiki/Has-a has-a] relation.&lt;br /&gt;
*Delegation helps in finding bugs easily as compared to inheritance because delegation limit the scope of a possible logical error to a given subset of methods. In delegation code is more simple to explain, more easy to parse. In inheritance lots of functionality are associated with one object causes difficulty in finding bug. &lt;br /&gt;
&lt;br /&gt;
* Inheritance breaks [http://en.csharp-online.net/Classes,_Structs,_and_Objects%E2%80%94Delegation_and_Composition_vs._Inheritance  encapsulation], whereas Delegation preserves encapsulation, .&lt;br /&gt;
&lt;br /&gt;
* By implementing delegation, all the methods laid out in the [http://www.learn-programming.za.net/programming_java_learn08.html interface] will be implemented where as in inheritance [http://en.wikipedia.org/wiki/Inheritance_(computer_science) derived] class inherit all the behavior of the base classes by default.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Inheritance actually creates something from something else, where delegation is actually using something to create something else. So delegation is a situation where you’re not really building new code from old code your using other code to build new. You can use inheritance where what your building IS-A of something else but if what your building has something of something else and only that part it may be better to use delegation.&lt;br /&gt;
&lt;br /&gt;
Delegation is gaining some popularity in code were it can be implement as a better method. Although inheritance is probably the most widely used way in Object Orientated design to use existing code as tools or patterns to create new code with out reinventing the wheel.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* '''[http://en.wikipedia.org/wiki/Delegation_(programming) Delegation]'''&lt;br /&gt;
* '''[http://en.wikipedia.org/wiki/Inheritance_(programming) Inheritance]'''&lt;br /&gt;
&lt;br /&gt;
==External links and references==&lt;br /&gt;
*[http://www.jguru.com/faq/view.jsp?EID=27916 Introduction]&lt;br /&gt;
*[http://beautifulcode.oreillynet.com/2007/11/preferring_inheritance_to_dele.php Beautiful Code]&lt;br /&gt;
*[http://groovy.codehaus.org/Replace+Inheritance+with+Delegation Replace Inheritance with Delegation]&lt;br /&gt;
*[http://www.perlmonks.org/index.pl?node_id=278375 Inheritance vs Delegation: pros and cons]&lt;br /&gt;
*[http://articles.techrepublic.com.com/5100-10878_11-5031837.html Avoid Java Delegation]&lt;br /&gt;
*[http://en.csharp-online.net/Classes,_Structs,_and_Objects%E2%80%94Delegation_and_Composition_vs._Inheritance Delegation and Composition vs. Inheritance]&lt;br /&gt;
*[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 Sun Delegation vs. Inheritance quick question]&lt;br /&gt;
*[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 Inheritance vs delegation]&lt;br /&gt;
*[http://msdn.microsoft.com/en-us/library/ms973861.aspx inheritance and interfaces]&lt;br /&gt;
*[http://www.amazon.com/Object-Oriented-Design-Using-Java-Skrien/dp/0072974168 Object-Oriented Design Using Java, Dale Skrien, 2007]&lt;br /&gt;
[http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Summer_2008/wiki2_Assignment Back to assignment page]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_8_Inh-Del&amp;diff=14295</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 8 Inh-Del</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_8_Inh-Del&amp;diff=14295"/>
		<updated>2008-07-07T23:44:52Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* External links and references */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Inheritance vs Delegation=&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Inheritance_(programming) Inheritance] and [http://en.wikipedia.org/wiki/Delegation_(programming) delegation] plays a very important role in object-oriented languages.Both of the techniques facilitates the reuse of code that exist in another class. This WIKI will cite examples that show cases where inheritance is better, and cases where delegation is better. I also characterizes the situations in which you should employ one or the other.&lt;br /&gt;
&lt;br /&gt;
== Inheritance ==&lt;br /&gt;
In [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented programming OOP], [http://en.wikipedia.org/wiki/Inheritance_(computer_science) inheritance] is a way to form new classes (instances of which are called objects) using classes that have already been defined. The new classes, known as derived or classes, take over (or inherit) attributes and behavior of the pre-existing classes, which are referred to as base classes (or ancestor classes). It is intended to help reuse existing code with little or no modification.&lt;br /&gt;
&lt;br /&gt;
The top most class is called as the parent class, base class or a superclass.The classes derived from the parent class are known as child classes or [http://www.jguru.com/faq/view.jsp?EID=27916 subclasses].The lower classes of the hierarchy inherite from the upper class. Classes get more specialized as you move toward the bottom of the hierarchy.The subclasses have more functionality than superclass because of this feature and create their own new functionality.&lt;br /&gt;
&lt;br /&gt;
The most common reason of using inheritance is to reuse existing classes or objects. Inheritance represent the is-a relationship between classes. For example, A mallard IS-A duck and IS-A mammal and therefore can be extended with inheritance from the base class of duck.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example of Inheritance===&lt;br /&gt;
 public class Car{&lt;br /&gt;
    public int gear;&lt;br /&gt;
    public int speed;	&lt;br /&gt;
    public Car(int speed_of_car, int gear_of_car) {&lt;br /&gt;
        gear = speed_of_car;&lt;br /&gt;
        speed = gear_of_car;&lt;br /&gt;
    }&lt;br /&gt;
    public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 public class Bmw extends Car {&lt;br /&gt;
   public int seat_height;&lt;br /&gt;
   public Toyota(int speed_of_car, int new_gear , int new_seat_height) {&lt;br /&gt;
        super( speed_of_car, new_gear);&lt;br /&gt;
        seat_height = new_seat_height;&lt;br /&gt;
    }		   &lt;br /&gt;
    public void set_height(int height) {&lt;br /&gt;
        seat_height= height;&lt;br /&gt;
    }	&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In this example Car is a base class where as Bmw is a derived class. Bmw has all the properties of Car (gear, speed) but it has its own functionality adjusting the height of seat.&lt;br /&gt;
All the cars can be derived from the base class Car which has the common functionality gear and speed and each derived class can add their own fuctionality.So all the common code in the base class and specific code in the child class.&lt;br /&gt;
&lt;br /&gt;
== Delegation==&lt;br /&gt;
A technique, which provides the functionality of implementation of a particular interface to a field or expression is called delegation. Delegation passes a duty off to someone else.&lt;br /&gt;
It can be define in terms of objects ,where one object forwards  certain function calls to another object which is called its delegate. Some languages do not support direct delegation and some do not provide the feature of [http://en.wikipedia.org/wiki/Polymorphism_(computer_science)dynamic polymorphism]. &lt;br /&gt;
&lt;br /&gt;
Delegation is a very powerful reuse technique. The most important feature of delegation is its run time flexibility. The delegates can be changed at run time where other processes like inheritance is normally created at compile time.&lt;br /&gt;
&lt;br /&gt;
To be more specific [http://http://en.wikipedia.org/wiki/Delegation_pattern delegation pattern]&lt;br /&gt;
is where an object outwardly expresses certain behavior but in reality delegates responsibility for implementing that behavior to an associated object in an Inversion of Responsibility. The delegation pattern is the fundamental abstraction that underpins [http://en.wikipedia.org/wiki/Composition composition] (also referred to as aggregation), [http://en.wikipedia.org/wiki/Mixin mixins] and [http://en.wikipedia.org/wiki/Aspect aspects].&lt;br /&gt;
&lt;br /&gt;
===Example of Delegation===&lt;br /&gt;
 public interface Car{&lt;br /&gt;
    public int gear;&lt;br /&gt;
    public int speed;	    &lt;br /&gt;
    public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 public class Bmw implements Car {&lt;br /&gt;
     public int seat_height;&lt;br /&gt;
     public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }	   &lt;br /&gt;
    public void set_height(int height) {&lt;br /&gt;
        seat_height= height;&lt;br /&gt;
    }	&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the delegation, child class does not inherit all the properties of base class by default.All the methods that are defined in the base class should be necessarily defined in the child class and child class can add its own functionality.[http://java.sun.com/docs/books/tutorial/java/IandI/subclasses.html Inheritance Ex]&lt;br /&gt;
&lt;br /&gt;
==Where to use Delegation and Inheritance==&lt;br /&gt;
&lt;br /&gt;
Inheritance can not be used everywhere even if satisfies the reuse, is-a relationship and public interface.[http://oreilly.com/catalog/hfdesignpat/chapter/ch03.pdf DesignPatterns]&lt;br /&gt;
Ex[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 :-]&lt;br /&gt;
&lt;br /&gt;
 class Duck{&lt;br /&gt;
   swim();&lt;br /&gt;
   quack();&lt;br /&gt;
   color();&lt;br /&gt;
 }&lt;br /&gt;
 class MallradDuck extends Duck{&lt;br /&gt;
  display();&lt;br /&gt;
 } &lt;br /&gt;
 class RubberDuck extends Duck{&lt;br /&gt;
  display();&lt;br /&gt;
 }&lt;br /&gt;
 class RedHeadDuck extends Duck{&lt;br /&gt;
 display();&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
In the following example all three type of ducks inherit all the properties of a duck. But the rubber duck can neither swim nor quack. So at this point because of the inheritance property&lt;br /&gt;
rubber duck inherits the swim() and quack() method. It proves that inheritance should not be used and this is where a method like  delegation would be a better solution. RubberDuck has a color just like the mallardDuck and RedHeadDuck. so MallardDuck and RedHeadDuck are perfect to use inheritance on.&lt;br /&gt;
&lt;br /&gt;
Using delegation to satisfy the following case:-&lt;br /&gt;
 interface Swim{&lt;br /&gt;
  swim();&lt;br /&gt;
 {&lt;br /&gt;
 interface Quack{&lt;br /&gt;
  quack();&lt;br /&gt;
 {&lt;br /&gt;
 interface Color{&lt;br /&gt;
 color();&lt;br /&gt;
 {&lt;br /&gt;
 class MallardDuck implements Swim implements Quack ,Color{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
 class RedHeadDuck implements Swim implements Quack ,Color{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
 class RubberDuck implements Color{&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In this example there is somewhat more code  but it satisfies the functionality of the different types of ducks. The mallardDuck and the RedHeadDuck has the functionality of swim, quack and color whereas, rubberDuck has only color it can neither swim nor quack. Here through delegation some additional properties of a particular duck can also be added without affection the existing code. The functionality of fly in RedHeadDuck  can be added without touching the other type of ducks. &lt;br /&gt;
&lt;br /&gt;
 interface Fly{&lt;br /&gt;
  fly();&lt;br /&gt;
 {&lt;br /&gt;
 class RedHeadDuck implements Swim implements Quack implements Color implements Fly{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
  fly();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Listed differences between Inheritance and Delegation==&lt;br /&gt;
&lt;br /&gt;
* Delegation is [http://www.jguru.com/faq/view.jsp?EID=27916 dynamic] in nature whereas Inheritance is [http://en.wikipedia.org/wiki/Inheritance_(computer_science) static] in nature. Since the delegation is dynamic, the [http://en.wikipedia.org/wiki/Delegation_(programming) run] time code can be changed in delegation. Inheritance is defined at compile time.  &lt;br /&gt;
&lt;br /&gt;
* Inheritance is faster than delegation because it is created at compile time whereas, delegation is created at run time.&lt;br /&gt;
&lt;br /&gt;
*Inheritance is based on a [http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=40729 is-a] relationship among classes, delegation has the property of [http://en.wikipedia.org/wiki/Has-a has-a] relation.&lt;br /&gt;
*Delegation helps in finding bugs easily as compared to inheritance because delegation limit the scope of a possible logical error to a given subset of methods. In delegation code is more simple to explain, more easy to parse. In inheritance lots of functionality are associated with one object causes difficulty in finding bug. &lt;br /&gt;
&lt;br /&gt;
* Inheritance breaks [http://en.csharp-online.net/Classes,_Structs,_and_Objects%E2%80%94Delegation_and_Composition_vs._Inheritance  encapsulation], whereas Delegation preserves encapsulation, .&lt;br /&gt;
&lt;br /&gt;
* By implementing delegation, all the methods laid out in the [http://www.learn-programming.za.net/programming_java_learn08.html interface] will be implemented where as in inheritance [http://en.wikipedia.org/wiki/Inheritance_(computer_science) derived] class inherit all the behavior of the base classes by default.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Inheritance actually creates something from something else, where delegation is actually using something to create something else. So delegation is a situation where you’re not really building new code from old code your using other code to build new. You can use inheritance where what your building IS-A of something else but if what your building has something of something else and only that part it may be better to use delegation.&lt;br /&gt;
&lt;br /&gt;
Delegation is gaining some popularity in code were it can be implement as a better method. Although inheritance is probably the most widely used way in Object Orientated design to use existing code as tools or patterns to create new code with out reinventing the wheel.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* '''[http://en.wikipedia.org/wiki/Delegation_(programming) Delegation]'''&lt;br /&gt;
* '''[http://en.wikipedia.org/wiki/Inheritance_(programming) Inheritance]'''&lt;br /&gt;
&lt;br /&gt;
==External links and references==&lt;br /&gt;
*[http://www.jguru.com/faq/view.jsp?EID=27916 Introduction]&lt;br /&gt;
*[http://beautifulcode.oreillynet.com/2007/11/preferring_inheritance_to_dele.php Beautiful Code]&lt;br /&gt;
*[http://groovy.codehaus.org/Replace+Inheritance+with+Delegation Replace Inheritance with Delegation]&lt;br /&gt;
*[http://www.perlmonks.org/index.pl?node_id=278375 Inheritance vs Delegation: pros and cons]&lt;br /&gt;
*[http://articles.techrepublic.com.com/5100-10878_11-5031837.html Avoid Java Delegation]&lt;br /&gt;
*[http://en.csharp-online.net/Classes,_Structs,_and_Objects%E2%80%94Delegation_and_Composition_vs._Inheritance Delegation and Composition vs. Inheritance]&lt;br /&gt;
*[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 Sun Delegation vs. Inheritance quick question]&lt;br /&gt;
*[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 Inheritance vs delegation]&lt;br /&gt;
*[http://msdn.microsoft.com/en-us/library/ms973861.aspx inheritance and interfaces]&lt;br /&gt;
*[http://www.amazon.com/Object-Oriented-Design-Using-Java-Skrien/dp/0072974168 Object-Oriented Design Using Java, Dale Skrien, 2007]&lt;br /&gt;
[http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Summer_2008/wiki2_Assignment Back to assignment page]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_8_Inh-Del&amp;diff=14294</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 8 Inh-Del</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_8_Inh-Del&amp;diff=14294"/>
		<updated>2008-07-07T23:44:06Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Inheritance vs Delegation=&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Inheritance_(programming) Inheritance] and [http://en.wikipedia.org/wiki/Delegation_(programming) delegation] plays a very important role in object-oriented languages.Both of the techniques facilitates the reuse of code that exist in another class. This WIKI will cite examples that show cases where inheritance is better, and cases where delegation is better. I also characterizes the situations in which you should employ one or the other.&lt;br /&gt;
&lt;br /&gt;
== Inheritance ==&lt;br /&gt;
In [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented programming OOP], [http://en.wikipedia.org/wiki/Inheritance_(computer_science) inheritance] is a way to form new classes (instances of which are called objects) using classes that have already been defined. The new classes, known as derived or classes, take over (or inherit) attributes and behavior of the pre-existing classes, which are referred to as base classes (or ancestor classes). It is intended to help reuse existing code with little or no modification.&lt;br /&gt;
&lt;br /&gt;
The top most class is called as the parent class, base class or a superclass.The classes derived from the parent class are known as child classes or [http://www.jguru.com/faq/view.jsp?EID=27916 subclasses].The lower classes of the hierarchy inherite from the upper class. Classes get more specialized as you move toward the bottom of the hierarchy.The subclasses have more functionality than superclass because of this feature and create their own new functionality.&lt;br /&gt;
&lt;br /&gt;
The most common reason of using inheritance is to reuse existing classes or objects. Inheritance represent the is-a relationship between classes. For example, A mallard IS-A duck and IS-A mammal and therefore can be extended with inheritance from the base class of duck.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example of Inheritance===&lt;br /&gt;
 public class Car{&lt;br /&gt;
    public int gear;&lt;br /&gt;
    public int speed;	&lt;br /&gt;
    public Car(int speed_of_car, int gear_of_car) {&lt;br /&gt;
        gear = speed_of_car;&lt;br /&gt;
        speed = gear_of_car;&lt;br /&gt;
    }&lt;br /&gt;
    public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 public class Bmw extends Car {&lt;br /&gt;
   public int seat_height;&lt;br /&gt;
   public Toyota(int speed_of_car, int new_gear , int new_seat_height) {&lt;br /&gt;
        super( speed_of_car, new_gear);&lt;br /&gt;
        seat_height = new_seat_height;&lt;br /&gt;
    }		   &lt;br /&gt;
    public void set_height(int height) {&lt;br /&gt;
        seat_height= height;&lt;br /&gt;
    }	&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In this example Car is a base class where as Bmw is a derived class. Bmw has all the properties of Car (gear, speed) but it has its own functionality adjusting the height of seat.&lt;br /&gt;
All the cars can be derived from the base class Car which has the common functionality gear and speed and each derived class can add their own fuctionality.So all the common code in the base class and specific code in the child class.&lt;br /&gt;
&lt;br /&gt;
== Delegation==&lt;br /&gt;
A technique, which provides the functionality of implementation of a particular interface to a field or expression is called delegation. Delegation passes a duty off to someone else.&lt;br /&gt;
It can be define in terms of objects ,where one object forwards  certain function calls to another object which is called its delegate. Some languages do not support direct delegation and some do not provide the feature of [http://en.wikipedia.org/wiki/Polymorphism_(computer_science)dynamic polymorphism]. &lt;br /&gt;
&lt;br /&gt;
Delegation is a very powerful reuse technique. The most important feature of delegation is its run time flexibility. The delegates can be changed at run time where other processes like inheritance is normally created at compile time.&lt;br /&gt;
&lt;br /&gt;
To be more specific [http://http://en.wikipedia.org/wiki/Delegation_pattern delegation pattern]&lt;br /&gt;
is where an object outwardly expresses certain behavior but in reality delegates responsibility for implementing that behavior to an associated object in an Inversion of Responsibility. The delegation pattern is the fundamental abstraction that underpins [http://en.wikipedia.org/wiki/Composition composition] (also referred to as aggregation), [http://en.wikipedia.org/wiki/Mixin mixins] and [http://en.wikipedia.org/wiki/Aspect aspects].&lt;br /&gt;
&lt;br /&gt;
===Example of Delegation===&lt;br /&gt;
 public interface Car{&lt;br /&gt;
    public int gear;&lt;br /&gt;
    public int speed;	    &lt;br /&gt;
    public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 public class Bmw implements Car {&lt;br /&gt;
     public int seat_height;&lt;br /&gt;
     public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }	   &lt;br /&gt;
    public void set_height(int height) {&lt;br /&gt;
        seat_height= height;&lt;br /&gt;
    }	&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the delegation, child class does not inherit all the properties of base class by default.All the methods that are defined in the base class should be necessarily defined in the child class and child class can add its own functionality.[http://java.sun.com/docs/books/tutorial/java/IandI/subclasses.html Inheritance Ex]&lt;br /&gt;
&lt;br /&gt;
==Where to use Delegation and Inheritance==&lt;br /&gt;
&lt;br /&gt;
Inheritance can not be used everywhere even if satisfies the reuse, is-a relationship and public interface.[http://oreilly.com/catalog/hfdesignpat/chapter/ch03.pdf DesignPatterns]&lt;br /&gt;
Ex[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 :-]&lt;br /&gt;
&lt;br /&gt;
 class Duck{&lt;br /&gt;
   swim();&lt;br /&gt;
   quack();&lt;br /&gt;
   color();&lt;br /&gt;
 }&lt;br /&gt;
 class MallradDuck extends Duck{&lt;br /&gt;
  display();&lt;br /&gt;
 } &lt;br /&gt;
 class RubberDuck extends Duck{&lt;br /&gt;
  display();&lt;br /&gt;
 }&lt;br /&gt;
 class RedHeadDuck extends Duck{&lt;br /&gt;
 display();&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
In the following example all three type of ducks inherit all the properties of a duck. But the rubber duck can neither swim nor quack. So at this point because of the inheritance property&lt;br /&gt;
rubber duck inherits the swim() and quack() method. It proves that inheritance should not be used and this is where a method like  delegation would be a better solution. RubberDuck has a color just like the mallardDuck and RedHeadDuck. so MallardDuck and RedHeadDuck are perfect to use inheritance on.&lt;br /&gt;
&lt;br /&gt;
Using delegation to satisfy the following case:-&lt;br /&gt;
 interface Swim{&lt;br /&gt;
  swim();&lt;br /&gt;
 {&lt;br /&gt;
 interface Quack{&lt;br /&gt;
  quack();&lt;br /&gt;
 {&lt;br /&gt;
 interface Color{&lt;br /&gt;
 color();&lt;br /&gt;
 {&lt;br /&gt;
 class MallardDuck implements Swim implements Quack ,Color{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
 class RedHeadDuck implements Swim implements Quack ,Color{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
 class RubberDuck implements Color{&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In this example there is somewhat more code  but it satisfies the functionality of the different types of ducks. The mallardDuck and the RedHeadDuck has the functionality of swim, quack and color whereas, rubberDuck has only color it can neither swim nor quack. Here through delegation some additional properties of a particular duck can also be added without affection the existing code. The functionality of fly in RedHeadDuck  can be added without touching the other type of ducks. &lt;br /&gt;
&lt;br /&gt;
 interface Fly{&lt;br /&gt;
  fly();&lt;br /&gt;
 {&lt;br /&gt;
 class RedHeadDuck implements Swim implements Quack implements Color implements Fly{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
  fly();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Listed differences between Inheritance and Delegation==&lt;br /&gt;
&lt;br /&gt;
* Delegation is [http://www.jguru.com/faq/view.jsp?EID=27916 dynamic] in nature whereas Inheritance is [http://en.wikipedia.org/wiki/Inheritance_(computer_science) static] in nature. Since the delegation is dynamic, the [http://en.wikipedia.org/wiki/Delegation_(programming) run] time code can be changed in delegation. Inheritance is defined at compile time.  &lt;br /&gt;
&lt;br /&gt;
* Inheritance is faster than delegation because it is created at compile time whereas, delegation is created at run time.&lt;br /&gt;
&lt;br /&gt;
*Inheritance is based on a [http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=40729 is-a] relationship among classes, delegation has the property of [http://en.wikipedia.org/wiki/Has-a has-a] relation.&lt;br /&gt;
*Delegation helps in finding bugs easily as compared to inheritance because delegation limit the scope of a possible logical error to a given subset of methods. In delegation code is more simple to explain, more easy to parse. In inheritance lots of functionality are associated with one object causes difficulty in finding bug. &lt;br /&gt;
&lt;br /&gt;
* Inheritance breaks [http://en.csharp-online.net/Classes,_Structs,_and_Objects%E2%80%94Delegation_and_Composition_vs._Inheritance  encapsulation], whereas Delegation preserves encapsulation, .&lt;br /&gt;
&lt;br /&gt;
* By implementing delegation, all the methods laid out in the [http://www.learn-programming.za.net/programming_java_learn08.html interface] will be implemented where as in inheritance [http://en.wikipedia.org/wiki/Inheritance_(computer_science) derived] class inherit all the behavior of the base classes by default.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Inheritance actually creates something from something else, where delegation is actually using something to create something else. So delegation is a situation where you’re not really building new code from old code your using other code to build new. You can use inheritance where what your building IS-A of something else but if what your building has something of something else and only that part it may be better to use delegation.&lt;br /&gt;
&lt;br /&gt;
Delegation is gaining some popularity in code were it can be implement as a better method. Although inheritance is probably the most widely used way in Object Orientated design to use existing code as tools or patterns to create new code with out reinventing the wheel.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* '''[http://en.wikipedia.org/wiki/Delegation_(programming) Delegation]'''&lt;br /&gt;
* '''[http://en.wikipedia.org/wiki/Inheritance_(programming) Inheritance]'''&lt;br /&gt;
&lt;br /&gt;
==External links and references==&lt;br /&gt;
*[http://www.jguru.com/faq/view.jsp?EID=27916 Introduction]&lt;br /&gt;
*[http://beautifulcode.oreillynet.com/2007/11/preferring_inheritance_to_dele.php Beautiful Code]&lt;br /&gt;
*[http://groovy.codehaus.org/Replace+Inheritance+with+Delegation Replace Inheritance with Delegation]&lt;br /&gt;
*[http://www.perlmonks.org/index.pl?node_id=278375 Inheritance vs Delegation: pros and cons]&lt;br /&gt;
*[http://articles.techrepublic.com.com/5100-10878_11-5031837.html Avoid Java Delegation]&lt;br /&gt;
*[http://en.csharp-online.net/Classes,_Structs,_and_Objects%E2%80%94Delegation_and_Composition_vs._Inheritance Delegation and Composition vs. Inheritance]&lt;br /&gt;
*[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 Sun Delegation vs. Inheritance quick question]&lt;br /&gt;
*[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 Inheritance vs delegation]&lt;br /&gt;
*[http://msdn.microsoft.com/en-us/library/ms973861.aspx inheritance and interfaces]&lt;br /&gt;
*[http://www.amazon.com/Object-Oriented-Design-Using-Java-Skrien/dp/0072974168 Object-Oriented Design Using Java, Dale Skrien, 2007]&lt;br /&gt;
{http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Summer_2008/wiki2_Assignment Back to assignment page]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_8_Inh-Del&amp;diff=14225</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 8 Inh-Del</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_8_Inh-Del&amp;diff=14225"/>
		<updated>2008-07-01T12:46:48Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Example of Inheritance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Inheritance vs Delagation=&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Inheritance_(programming) Inheritance] and [http://en.wikipedia.org/wiki/Delegation_(programming) delegation] plays a very important role in object-oriented languages.Both of the techniques facilitates the reuse of code that exist in another class. This WIKI will cite examples that show cases where inheritance is better, and cases where delegation is better. I also characterizes the situations in which you should employ one or the other.&lt;br /&gt;
&lt;br /&gt;
== Inheritance ==&lt;br /&gt;
In [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented programming OOP], [http://en.wikipedia.org/wiki/Inheritance_(computer_science) inheritance] is a way to form new classes (instances of which are called objects) using classes that have already been defined. The new classes, known as derived or classes, take over (or inherit) attributes and behavior of the pre-existing classes, which are referred to as base classes (or ancestor classes). It is intended to help reuse existing code with little or no modification.&lt;br /&gt;
&lt;br /&gt;
The top most class is called as the parent class, base class or a superclass.The classes derived from the parent class are known as child classes or [http://www.jguru.com/faq/view.jsp?EID=27916 subclasses].The lower classes of the hierarchy inherite from the upper class. Classes get more specialized as you move toward the bottom of the hierarchy.The subclasses have more functionality than superclass because of this feature and create their own new functionality.&lt;br /&gt;
&lt;br /&gt;
The most common reason of using inheritance is to reuse existing classes or objects. Inheritance represent the is-a relationship between classes. For example, A mallard IS-A duck and IS-A mammal and therefore can be extended with inheritance from the base class of duck.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example of Inheritance===&lt;br /&gt;
 public class Car{&lt;br /&gt;
    public int gear;&lt;br /&gt;
    public int speed;	&lt;br /&gt;
    public Car(int speed_of_car, int gear_of_car) {&lt;br /&gt;
        gear = speed_of_car;&lt;br /&gt;
        speed = gear_of_car;&lt;br /&gt;
    }&lt;br /&gt;
    public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 public class Bmw extends Car {&lt;br /&gt;
   public int seat_height;&lt;br /&gt;
   public Toyota(int speed_of_car, int new_gear , int new_seat_height) {&lt;br /&gt;
        super( speed_of_car, new_gear);&lt;br /&gt;
        seat_height = new_seat_height;&lt;br /&gt;
    }		   &lt;br /&gt;
    public void set_height(int height) {&lt;br /&gt;
        seat_height= height;&lt;br /&gt;
    }	&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In this example Car is a base class where as Bmw is a derived class. Bmw has all the properties of Car (gear, speed) but it has its own functionality adjusting the height of seat.&lt;br /&gt;
All the cars can be derived from the base class Car which has the common functionality gear and speed and each derived class can add their own fuctionality.So all the common code in the base class and specific code in the child class.&lt;br /&gt;
&lt;br /&gt;
== Delegation==&lt;br /&gt;
A technique, which provides the functionality of implementation of a particular interface to a field or expression is called delegation. Delegation passes a duty off to someone else.&lt;br /&gt;
It can be define in terms of objects ,where one object forwards  certain function calls to another object which is called its delegate. Some languages do not support direct delegation and some do not provide the feature of [http://en.wikipedia.org/wiki/Polymorphism_(computer_science)dynamic polymorphism]. &lt;br /&gt;
&lt;br /&gt;
Delegation is a very powerful reuse technique. The most important feature of delegation is its run time flexibility. The delegates can be changed at run time where other processes like inheritance is normally created at compile time.&lt;br /&gt;
&lt;br /&gt;
To be more specifif [http://http://en.wikipedia.org/wiki/Delegation_pattern delegation pattern]&lt;br /&gt;
is where an object outwardly expresses certain behavior but in reality delegates responsibility for implementing that behavior to an associated object in an Inversion of Responsibility. The delegation pattern is the fundamental abstraction that underpins [http://en.wikipedia.org/wiki/Composition composition] (also referred to as aggregation), [http://en.wikipedia.org/wiki/Mixin mixins] and [http://en.wikipedia.org/wiki/Aspect aspects].&lt;br /&gt;
&lt;br /&gt;
===Example of Delegation===&lt;br /&gt;
 public interface Car{&lt;br /&gt;
    public int gear;&lt;br /&gt;
    public int speed;	    &lt;br /&gt;
    public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 public class Bmw implementation Car {&lt;br /&gt;
     public int seat_height;&lt;br /&gt;
     public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }	   &lt;br /&gt;
    public void set_height(int height) {&lt;br /&gt;
        seat_height= height;&lt;br /&gt;
    }	&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the delegation, child class does not inherit all the properties of base class by default.All the methods that are defined in the base class should be necessarily defined in the child class and child class can add its own functionality.[http://java.sun.com/docs/books/tutorial/java/IandI/subclasses.html Inheritance Ex]&lt;br /&gt;
&lt;br /&gt;
==Where to use Delegation and Inheritance==&lt;br /&gt;
&lt;br /&gt;
Inheritance can not be used everywhere even if satisfies the reuse, is-a relationship and public interface.[http://oreilly.com/catalog/hfdesignpat/chapter/ch03.pdf DesignPatterns]&lt;br /&gt;
Ex[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 :-]&lt;br /&gt;
&lt;br /&gt;
 class Duck{&lt;br /&gt;
   swim();&lt;br /&gt;
   quack();&lt;br /&gt;
   color();&lt;br /&gt;
 }&lt;br /&gt;
 class MallradDuck extends Duck{&lt;br /&gt;
  display();&lt;br /&gt;
 } &lt;br /&gt;
 class RubberDuck extends Duck{&lt;br /&gt;
  display();&lt;br /&gt;
 }&lt;br /&gt;
 class RedHeadDuck extends Duck{&lt;br /&gt;
 display();&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
In the following example all three type of ducks inherit all the properties of a duck. But the rubber duck can neither swim nor quack. So at this point because of the inheritance property&lt;br /&gt;
rubber duck inherits the swim() and quack() method. It proves that inheritance should not be used and this is where a method like  delegation would be a better solution. RubberDuck has a color just like the mallardDuck and RedHeadDuck. so MallardDuck and RedHeadDuck are perfect to use inheritance on.&lt;br /&gt;
&lt;br /&gt;
Using delegation to satisfy the following case:-&lt;br /&gt;
 interface Swim{&lt;br /&gt;
  swim();&lt;br /&gt;
 {&lt;br /&gt;
 interface Quack{&lt;br /&gt;
  quack();&lt;br /&gt;
 {&lt;br /&gt;
 interface Color{&lt;br /&gt;
 color();&lt;br /&gt;
 {&lt;br /&gt;
 class MallardDuck implements Swim implements Quack implements Color{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
 class RedHeadDuck implements Swim implements Quack implements Color{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
 class RubberDuck implements Color{&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In this example there is somewhat more code  but it satisfies the functionality of the different types of ducks. The mallardDuck and the RedHeadDuck has the functionality of swim, quack and color whereas, rubberDuck has only color it can neither swim nor quack. Here through delegation some additional properties of a particular duck can also be added without affection the existing code. The functionality of fly in RedHeadDuck  can be added without touching the other type of ducks. &lt;br /&gt;
&lt;br /&gt;
 interface Fly{&lt;br /&gt;
  fly();&lt;br /&gt;
 {&lt;br /&gt;
 class RedHeadDuck implements Swim implements Quack implements Color implements Fly{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
  fly();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Listed differences between Inheritance and Delegation==&lt;br /&gt;
&lt;br /&gt;
* Delegation is [http://www.jguru.com/faq/view.jsp?EID=27916 dynamic] in nature whereas Inheritance is [http://en.wikipedia.org/wiki/Inheritance_(computer_science) static] in nature. Since the delegation is dynamic, the [http://en.wikipedia.org/wiki/Delegation_(programming) run] time code can be changed in delegation. Inheritance is defined at compile time.  &lt;br /&gt;
&lt;br /&gt;
* Inheritance is faster than delegation because it is created at compile time whereas, delegation is created at run time.&lt;br /&gt;
&lt;br /&gt;
*Inheritance is based on a [http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=40729 is-a] relationship among classes, delegation has the property of [http://en.wikipedia.org/wiki/Has-a has-a] relation.&lt;br /&gt;
*Delegation helps in finding bugs easily as compared to inheritance because delegation limit the scope of a possible logical error to a given subset of methods. In delegation code is more simple to explain, more easy to parse. In inheritance lots of functionality are associated with one object causes difficulty in finding bug. &lt;br /&gt;
&lt;br /&gt;
* Inheritance breaks [http://en.csharp-online.net/Classes,_Structs,_and_Objects%E2%80%94Delegation_and_Composition_vs._Inheritance  encapsulation], whereas Delegation preserves encapsulation, .&lt;br /&gt;
&lt;br /&gt;
* By implementing delegation, all the methods laid out in the [http://www.learn-programming.za.net/programming_java_learn08.html interface] will be implemented where as in inheritance [http://en.wikipedia.org/wiki/Inheritance_(computer_science) derived] class inherit all the behavior of the base classes by default.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Inheritance actually creates something from something else, where delegation is actually using something to create something else. So delegation is a situation where you’re not really building new code from old code your using other code to build new. You can use inheritance where what your building IS-A of something else but if what your building has something of something else and only that part it may be better to use delegation.&lt;br /&gt;
&lt;br /&gt;
Delegation is gaining some popularity in code were it can be implement as a better method. Although inheritance is probably the most widely used way in Object Orientated design to use existing code as tools or patterns to create new code with out reinventing the wheel.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* '''[http://en.wikipedia.org/wiki/Delegation_(programming) Delegation]'''&lt;br /&gt;
* '''[http://en.wikipedia.org/wiki/Inheritance_(programming) Inheritance]'''&lt;br /&gt;
&lt;br /&gt;
==External links and references==&lt;br /&gt;
*[http://www.jguru.com/faq/view.jsp?EID=27916 Introduction]&lt;br /&gt;
*[http://beautifulcode.oreillynet.com/2007/11/preferring_inheritance_to_dele.php Beautiful Code]&lt;br /&gt;
*[http://groovy.codehaus.org/Replace+Inheritance+with+Delegation Replace Inheritance with Delegation]&lt;br /&gt;
*[http://www.perlmonks.org/index.pl?node_id=278375 Inheritance vs Delegation: pros and cons]&lt;br /&gt;
*[http://articles.techrepublic.com.com/5100-10878_11-5031837.html Avoid Java Delegation]&lt;br /&gt;
*[http://en.csharp-online.net/Classes,_Structs,_and_Objects%E2%80%94Delegation_and_Composition_vs._Inheritance Delegation and Composition vs. Inheritance]&lt;br /&gt;
*[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 Sun Delegation vs. Inheritance quick question]&lt;br /&gt;
*[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 Inheritance vs delegation]&lt;br /&gt;
*[http://msdn.microsoft.com/en-us/library/ms973861.aspx inheritance and interfaces]&lt;br /&gt;
*[http://www.amazon.com/Object-Oriented-Design-Using-Java-Skrien/dp/0072974168 Object-Oriented Design Using Java, Dale Skrien, 2007]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_8_Inh-Del&amp;diff=14224</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 8 Inh-Del</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_8_Inh-Del&amp;diff=14224"/>
		<updated>2008-07-01T12:42:46Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Where to use Delegation and Inheritance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Inheritance vs Delagation=&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Inheritance_(programming) Inheritance] and [http://en.wikipedia.org/wiki/Delegation_(programming) delegation] plays a very important role in object-oriented languages.Both of the techniques facilitates the reuse of code that exist in another class. This WIKI will cite examples that show cases where inheritance is better, and cases where delegation is better. I also characterizes the situations in which you should employ one or the other.&lt;br /&gt;
&lt;br /&gt;
== Inheritance ==&lt;br /&gt;
In [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented programming OOP], [http://en.wikipedia.org/wiki/Inheritance_(computer_science) inheritance] is a way to form new classes (instances of which are called objects) using classes that have already been defined. The new classes, known as derived or classes, take over (or inherit) attributes and behavior of the pre-existing classes, which are referred to as base classes (or ancestor classes). It is intended to help reuse existing code with little or no modification.&lt;br /&gt;
&lt;br /&gt;
The top most class is called as the parent class, base class or a superclass.The classes derived from the parent class are known as child classes or [http://www.jguru.com/faq/view.jsp?EID=27916 subclasses].The lower classes of the hierarchy inherite from the upper class. Classes get more specialized as you move toward the bottom of the hierarchy.The subclasses have more functionality than superclass because of this feature and create their own new functionality.&lt;br /&gt;
&lt;br /&gt;
The most common reason of using inheritance is to reuse existing classes or objects. Inheritance represent the is-a relationship between classes. For example, A mallard IS-A duck and IS-A mammal and therefore can be extended with inheritance from the base class of duck.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example of Inheritance===&lt;br /&gt;
 public class Car{&lt;br /&gt;
    public int gear;&lt;br /&gt;
    public int speed;	&lt;br /&gt;
    public Car(int speed_of_car, int gear_of_car) {&lt;br /&gt;
        gear = speed_of_car;&lt;br /&gt;
        speed = gear_of_car;&lt;br /&gt;
    }&lt;br /&gt;
    public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 public class Bmw extends Car {&lt;br /&gt;
   public int seat_height;&lt;br /&gt;
   public Toyota(int speed_of_car, int new_gear , int new_seat_height) {&lt;br /&gt;
        super( speed_of_car, new_gear);&lt;br /&gt;
        seat_height = new_seat_height;&lt;br /&gt;
    }		   &lt;br /&gt;
    public void set_height(int height) {&lt;br /&gt;
        seat_height= height;&lt;br /&gt;
    }	&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In this example Car is a base class where as Bmv is a derived class.Bmv has all the properties of Car (gear, speed) but it has its own functionality adjusting the height of seat.&lt;br /&gt;
All the cars can be derived from the base class Car which has the common functionality gear and speed and each derived class can add their own fuctionality.So all the common code in the base class and specific code in the child class.&lt;br /&gt;
&lt;br /&gt;
== Delegation==&lt;br /&gt;
A technique, which provides the functionality of implementation of a particular interface to a field or expression is called delegation. Delegation passes a duty off to someone else.&lt;br /&gt;
It can be define in terms of objects ,where one object forwards  certain function calls to another object which is called its delegate. Some languages do not support direct delegation and some do not provide the feature of [http://en.wikipedia.org/wiki/Polymorphism_(computer_science)dynamic polymorphism]. &lt;br /&gt;
&lt;br /&gt;
Delegation is a very powerful reuse technique. The most important feature of delegation is its run time flexibility. The delegates can be changed at run time where other processes like inheritance is normally created at compile time.&lt;br /&gt;
&lt;br /&gt;
To be more specifif [http://http://en.wikipedia.org/wiki/Delegation_pattern delegation pattern]&lt;br /&gt;
is where an object outwardly expresses certain behavior but in reality delegates responsibility for implementing that behavior to an associated object in an Inversion of Responsibility. The delegation pattern is the fundamental abstraction that underpins [http://en.wikipedia.org/wiki/Composition composition] (also referred to as aggregation), [http://en.wikipedia.org/wiki/Mixin mixins] and [http://en.wikipedia.org/wiki/Aspect aspects].&lt;br /&gt;
&lt;br /&gt;
===Example of Delegation===&lt;br /&gt;
 public interface Car{&lt;br /&gt;
    public int gear;&lt;br /&gt;
    public int speed;	    &lt;br /&gt;
    public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 public class Bmw implementation Car {&lt;br /&gt;
     public int seat_height;&lt;br /&gt;
     public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }	   &lt;br /&gt;
    public void set_height(int height) {&lt;br /&gt;
        seat_height= height;&lt;br /&gt;
    }	&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the delegation, child class does not inherit all the properties of base class by default.All the methods that are defined in the base class should be necessarily defined in the child class and child class can add its own functionality.[http://java.sun.com/docs/books/tutorial/java/IandI/subclasses.html Inheritance Ex]&lt;br /&gt;
&lt;br /&gt;
==Where to use Delegation and Inheritance==&lt;br /&gt;
&lt;br /&gt;
Inheritance can not be used everywhere even if satisfies the reuse, is-a relationship and public interface.[http://oreilly.com/catalog/hfdesignpat/chapter/ch03.pdf DesignPatterns]&lt;br /&gt;
Ex[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 :-]&lt;br /&gt;
&lt;br /&gt;
 class Duck{&lt;br /&gt;
   swim();&lt;br /&gt;
   quack();&lt;br /&gt;
   color();&lt;br /&gt;
 }&lt;br /&gt;
 class MallradDuck extends Duck{&lt;br /&gt;
  display();&lt;br /&gt;
 } &lt;br /&gt;
 class RubberDuck extends Duck{&lt;br /&gt;
  display();&lt;br /&gt;
 }&lt;br /&gt;
 class RedHeadDuck extends Duck{&lt;br /&gt;
 display();&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
In the following example all three type of ducks inherit all the properties of a duck. But the rubber duck can neither swim nor quack. So at this point because of the inheritance property&lt;br /&gt;
rubber duck inherits the swim() and quack() method. It proves that inheritance should not be used and this is where a method like  delegation would be a better solution. RubberDuck has a color just like the mallardDuck and RedHeadDuck. so MallardDuck and RedHeadDuck are perfect to use inheritance on.&lt;br /&gt;
&lt;br /&gt;
Using delegation to satisfy the following case:-&lt;br /&gt;
 interface Swim{&lt;br /&gt;
  swim();&lt;br /&gt;
 {&lt;br /&gt;
 interface Quack{&lt;br /&gt;
  quack();&lt;br /&gt;
 {&lt;br /&gt;
 interface Color{&lt;br /&gt;
 color();&lt;br /&gt;
 {&lt;br /&gt;
 class MallardDuck implements Swim implements Quack implements Color{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
 class RedHeadDuck implements Swim implements Quack implements Color{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
 class RubberDuck implements Color{&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In this example there is somewhat more code  but it satisfies the functionality of the different types of ducks. The mallardDuck and the RedHeadDuck has the functionality of swim, quack and color whereas, rubberDuck has only color it can neither swim nor quack. Here through delegation some additional properties of a particular duck can also be added without affection the existing code. The functionality of fly in RedHeadDuck  can be added without touching the other type of ducks. &lt;br /&gt;
&lt;br /&gt;
 interface Fly{&lt;br /&gt;
  fly();&lt;br /&gt;
 {&lt;br /&gt;
 class RedHeadDuck implements Swim implements Quack implements Color implements Fly{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
  fly();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Listed differences between Inheritance and Delegation==&lt;br /&gt;
&lt;br /&gt;
* Delegation is [http://www.jguru.com/faq/view.jsp?EID=27916 dynamic] in nature whereas Inheritance is [http://en.wikipedia.org/wiki/Inheritance_(computer_science) static] in nature. Since the delegation is dynamic, the [http://en.wikipedia.org/wiki/Delegation_(programming) run] time code can be changed in delegation. Inheritance is defined at compile time.  &lt;br /&gt;
&lt;br /&gt;
* Inheritance is faster than delegation because it is created at compile time whereas, delegation is created at run time.&lt;br /&gt;
&lt;br /&gt;
*Inheritance is based on a [http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=40729 is-a] relationship among classes, delegation has the property of [http://en.wikipedia.org/wiki/Has-a has-a] relation.&lt;br /&gt;
*Delegation helps in finding bugs easily as compared to inheritance because delegation limit the scope of a possible logical error to a given subset of methods. In delegation code is more simple to explain, more easy to parse. In inheritance lots of functionality are associated with one object causes difficulty in finding bug. &lt;br /&gt;
&lt;br /&gt;
* Inheritance breaks [http://en.csharp-online.net/Classes,_Structs,_and_Objects%E2%80%94Delegation_and_Composition_vs._Inheritance  encapsulation], whereas Delegation preserves encapsulation, .&lt;br /&gt;
&lt;br /&gt;
* By implementing delegation, all the methods laid out in the [http://www.learn-programming.za.net/programming_java_learn08.html interface] will be implemented where as in inheritance [http://en.wikipedia.org/wiki/Inheritance_(computer_science) derived] class inherit all the behavior of the base classes by default.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Inheritance actually creates something from something else, where delegation is actually using something to create something else. So delegation is a situation where you’re not really building new code from old code your using other code to build new. You can use inheritance where what your building IS-A of something else but if what your building has something of something else and only that part it may be better to use delegation.&lt;br /&gt;
&lt;br /&gt;
Delegation is gaining some popularity in code were it can be implement as a better method. Although inheritance is probably the most widely used way in Object Orientated design to use existing code as tools or patterns to create new code with out reinventing the wheel.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* '''[http://en.wikipedia.org/wiki/Delegation_(programming) Delegation]'''&lt;br /&gt;
* '''[http://en.wikipedia.org/wiki/Inheritance_(programming) Inheritance]'''&lt;br /&gt;
&lt;br /&gt;
==External links and references==&lt;br /&gt;
*[http://www.jguru.com/faq/view.jsp?EID=27916 Introduction]&lt;br /&gt;
*[http://beautifulcode.oreillynet.com/2007/11/preferring_inheritance_to_dele.php Beautiful Code]&lt;br /&gt;
*[http://groovy.codehaus.org/Replace+Inheritance+with+Delegation Replace Inheritance with Delegation]&lt;br /&gt;
*[http://www.perlmonks.org/index.pl?node_id=278375 Inheritance vs Delegation: pros and cons]&lt;br /&gt;
*[http://articles.techrepublic.com.com/5100-10878_11-5031837.html Avoid Java Delegation]&lt;br /&gt;
*[http://en.csharp-online.net/Classes,_Structs,_and_Objects%E2%80%94Delegation_and_Composition_vs._Inheritance Delegation and Composition vs. Inheritance]&lt;br /&gt;
*[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 Sun Delegation vs. Inheritance quick question]&lt;br /&gt;
*[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 Inheritance vs delegation]&lt;br /&gt;
*[http://msdn.microsoft.com/en-us/library/ms973861.aspx inheritance and interfaces]&lt;br /&gt;
*[http://www.amazon.com/Object-Oriented-Design-Using-Java-Skrien/dp/0072974168 Object-Oriented Design Using Java, Dale Skrien, 2007]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_8_Inh-Del&amp;diff=14223</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 8 Inh-Del</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_8_Inh-Del&amp;diff=14223"/>
		<updated>2008-07-01T12:40:56Z</updated>

		<summary type="html">&lt;p&gt;Jwpaul: /* Listed differences between Inheritance and Delegation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Inheritance vs Delagation=&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Inheritance_(programming) Inheritance] and [http://en.wikipedia.org/wiki/Delegation_(programming) delegation] plays a very important role in object-oriented languages.Both of the techniques facilitates the reuse of code that exist in another class. This WIKI will cite examples that show cases where inheritance is better, and cases where delegation is better. I also characterizes the situations in which you should employ one or the other.&lt;br /&gt;
&lt;br /&gt;
== Inheritance ==&lt;br /&gt;
In [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented programming OOP], [http://en.wikipedia.org/wiki/Inheritance_(computer_science) inheritance] is a way to form new classes (instances of which are called objects) using classes that have already been defined. The new classes, known as derived or classes, take over (or inherit) attributes and behavior of the pre-existing classes, which are referred to as base classes (or ancestor classes). It is intended to help reuse existing code with little or no modification.&lt;br /&gt;
&lt;br /&gt;
The top most class is called as the parent class, base class or a superclass.The classes derived from the parent class are known as child classes or [http://www.jguru.com/faq/view.jsp?EID=27916 subclasses].The lower classes of the hierarchy inherite from the upper class. Classes get more specialized as you move toward the bottom of the hierarchy.The subclasses have more functionality than superclass because of this feature and create their own new functionality.&lt;br /&gt;
&lt;br /&gt;
The most common reason of using inheritance is to reuse existing classes or objects. Inheritance represent the is-a relationship between classes. For example, A mallard IS-A duck and IS-A mammal and therefore can be extended with inheritance from the base class of duck.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example of Inheritance===&lt;br /&gt;
 public class Car{&lt;br /&gt;
    public int gear;&lt;br /&gt;
    public int speed;	&lt;br /&gt;
    public Car(int speed_of_car, int gear_of_car) {&lt;br /&gt;
        gear = speed_of_car;&lt;br /&gt;
        speed = gear_of_car;&lt;br /&gt;
    }&lt;br /&gt;
    public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 public class Bmw extends Car {&lt;br /&gt;
   public int seat_height;&lt;br /&gt;
   public Toyota(int speed_of_car, int new_gear , int new_seat_height) {&lt;br /&gt;
        super( speed_of_car, new_gear);&lt;br /&gt;
        seat_height = new_seat_height;&lt;br /&gt;
    }		   &lt;br /&gt;
    public void set_height(int height) {&lt;br /&gt;
        seat_height= height;&lt;br /&gt;
    }	&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In this example Car is a base class where as Bmv is a derived class.Bmv has all the properties of Car (gear, speed) but it has its own functionality adjusting the height of seat.&lt;br /&gt;
All the cars can be derived from the base class Car which has the common functionality gear and speed and each derived class can add their own fuctionality.So all the common code in the base class and specific code in the child class.&lt;br /&gt;
&lt;br /&gt;
== Delegation==&lt;br /&gt;
A technique, which provides the functionality of implementation of a particular interface to a field or expression is called delegation. Delegation passes a duty off to someone else.&lt;br /&gt;
It can be define in terms of objects ,where one object forwards  certain function calls to another object which is called its delegate. Some languages do not support direct delegation and some do not provide the feature of [http://en.wikipedia.org/wiki/Polymorphism_(computer_science)dynamic polymorphism]. &lt;br /&gt;
&lt;br /&gt;
Delegation is a very powerful reuse technique. The most important feature of delegation is its run time flexibility. The delegates can be changed at run time where other processes like inheritance is normally created at compile time.&lt;br /&gt;
&lt;br /&gt;
To be more specifif [http://http://en.wikipedia.org/wiki/Delegation_pattern delegation pattern]&lt;br /&gt;
is where an object outwardly expresses certain behavior but in reality delegates responsibility for implementing that behavior to an associated object in an Inversion of Responsibility. The delegation pattern is the fundamental abstraction that underpins [http://en.wikipedia.org/wiki/Composition composition] (also referred to as aggregation), [http://en.wikipedia.org/wiki/Mixin mixins] and [http://en.wikipedia.org/wiki/Aspect aspects].&lt;br /&gt;
&lt;br /&gt;
===Example of Delegation===&lt;br /&gt;
 public interface Car{&lt;br /&gt;
    public int gear;&lt;br /&gt;
    public int speed;	    &lt;br /&gt;
    public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 public class Bmw implementation Car {&lt;br /&gt;
     public int seat_height;&lt;br /&gt;
     public void setGear(int new_gear) {&lt;br /&gt;
        gear = new_gear;&lt;br /&gt;
    }	&lt;br /&gt;
    public void speedUp(int increment_of_speed) {&lt;br /&gt;
        speed += increment_of_speed;&lt;br /&gt;
    }	   &lt;br /&gt;
    public void set_height(int height) {&lt;br /&gt;
        seat_height= height;&lt;br /&gt;
    }	&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the delegation, child class does not inherit all the properties of base class by default.All the methods that are defined in the base class should be necessarily defined in the child class and child class can add its own functionality.[http://java.sun.com/docs/books/tutorial/java/IandI/subclasses.html Inheritance Ex]&lt;br /&gt;
&lt;br /&gt;
==Where to use Delegation and Inheritance==&lt;br /&gt;
&lt;br /&gt;
Inheritance can not be used everywhere even if satisfies the reuse, is-a relationship and public interface.[http://oreilly.com/catalog/hfdesignpat/chapter/ch03.pdf DesignPatterns]&lt;br /&gt;
Ex[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 :-]&lt;br /&gt;
&lt;br /&gt;
 class Duck{&lt;br /&gt;
   swim();&lt;br /&gt;
   quack();&lt;br /&gt;
   color();&lt;br /&gt;
 }&lt;br /&gt;
 class MallradDuck extends Duck{&lt;br /&gt;
  display();&lt;br /&gt;
 } &lt;br /&gt;
 class RubberDuck extends Duck{&lt;br /&gt;
  display();&lt;br /&gt;
 }&lt;br /&gt;
 class RedHeadDuck extends Duck{&lt;br /&gt;
 display();&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
In the following example all three type of ducks inherit all the properties of a duck. But the rubber duck can neither swim nor quack. So at this point because of the inheritance property&lt;br /&gt;
rubber duck inherits the swim() and quack() method. It proves that inheritance should not be used and this is were a method like  delegation would be a better solution. RubberDuck has a color just like the mallardDuck and RedHeadDuck. so MallardDuck and RedHeadDuck are perfect to use inheritance on.&lt;br /&gt;
&lt;br /&gt;
Using delegation to satisfy the following case:-&lt;br /&gt;
 interface Swim{&lt;br /&gt;
  swim();&lt;br /&gt;
 {&lt;br /&gt;
 interface Quack{&lt;br /&gt;
  quack();&lt;br /&gt;
 {&lt;br /&gt;
 interface Color{&lt;br /&gt;
 color();&lt;br /&gt;
 {&lt;br /&gt;
 class MallardDuck implements Swim implements Quack implements Color{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
 class RedHeadDuck implements Swim implements Quack implements Color{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
 class RubberDuck implements Color{&lt;br /&gt;
  color();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In this example there is somewhat more code  but it satisfies the functionality of the different types of ducks. The mallardDuck and the RedHeadDuck has the functionality of swim, quack and color whereas, rubberDuck has only color it can neither swim nor quack. Here through delegation some additional properties of a particular duck can also be added without affection the existing code. The functionality of fly in RedHeadDuck  can be added without touching the other type of ducks. &lt;br /&gt;
&lt;br /&gt;
 interface Fly{&lt;br /&gt;
  fly();&lt;br /&gt;
 {&lt;br /&gt;
 class RedHeadDuck implements Swim implements Quack implements Color implements Fly{&lt;br /&gt;
  swim();&lt;br /&gt;
  quack();&lt;br /&gt;
  color();&lt;br /&gt;
  fly();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Listed differences between Inheritance and Delegation==&lt;br /&gt;
&lt;br /&gt;
* Delegation is [http://www.jguru.com/faq/view.jsp?EID=27916 dynamic] in nature whereas Inheritance is [http://en.wikipedia.org/wiki/Inheritance_(computer_science) static] in nature. Since the delegation is dynamic, the [http://en.wikipedia.org/wiki/Delegation_(programming) run] time code can be changed in delegation. Inheritance is defined at compile time.  &lt;br /&gt;
&lt;br /&gt;
* Inheritance is faster than delegation because it is created at compile time whereas, delegation is created at run time.&lt;br /&gt;
&lt;br /&gt;
*Inheritance is based on a [http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=40729 is-a] relationship among classes, delegation has the property of [http://en.wikipedia.org/wiki/Has-a has-a] relation.&lt;br /&gt;
*Delegation helps in finding bugs easily as compared to inheritance because delegation limit the scope of a possible logical error to a given subset of methods. In delegation code is more simple to explain, more easy to parse. In inheritance lots of functionality are associated with one object causes difficulty in finding bug. &lt;br /&gt;
&lt;br /&gt;
* Inheritance breaks [http://en.csharp-online.net/Classes,_Structs,_and_Objects%E2%80%94Delegation_and_Composition_vs._Inheritance  encapsulation], whereas Delegation preserves encapsulation, .&lt;br /&gt;
&lt;br /&gt;
* By implementing delegation, all the methods laid out in the [http://www.learn-programming.za.net/programming_java_learn08.html interface] will be implemented where as in inheritance [http://en.wikipedia.org/wiki/Inheritance_(computer_science) derived] class inherit all the behavior of the base classes by default.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Inheritance actually creates something from something else, where delegation is actually using something to create something else. So delegation is a situation where you’re not really building new code from old code your using other code to build new. You can use inheritance where what your building IS-A of something else but if what your building has something of something else and only that part it may be better to use delegation.&lt;br /&gt;
&lt;br /&gt;
Delegation is gaining some popularity in code were it can be implement as a better method. Although inheritance is probably the most widely used way in Object Orientated design to use existing code as tools or patterns to create new code with out reinventing the wheel.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* '''[http://en.wikipedia.org/wiki/Delegation_(programming) Delegation]'''&lt;br /&gt;
* '''[http://en.wikipedia.org/wiki/Inheritance_(programming) Inheritance]'''&lt;br /&gt;
&lt;br /&gt;
==External links and references==&lt;br /&gt;
*[http://www.jguru.com/faq/view.jsp?EID=27916 Introduction]&lt;br /&gt;
*[http://beautifulcode.oreillynet.com/2007/11/preferring_inheritance_to_dele.php Beautiful Code]&lt;br /&gt;
*[http://groovy.codehaus.org/Replace+Inheritance+with+Delegation Replace Inheritance with Delegation]&lt;br /&gt;
*[http://www.perlmonks.org/index.pl?node_id=278375 Inheritance vs Delegation: pros and cons]&lt;br /&gt;
*[http://articles.techrepublic.com.com/5100-10878_11-5031837.html Avoid Java Delegation]&lt;br /&gt;
*[http://en.csharp-online.net/Classes,_Structs,_and_Objects%E2%80%94Delegation_and_Composition_vs._Inheritance Delegation and Composition vs. Inheritance]&lt;br /&gt;
*[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 Sun Delegation vs. Inheritance quick question]&lt;br /&gt;
*[http://forum.java.sun.com/thread.jspa?threadID=702260&amp;amp;messageID=4072925 Inheritance vs delegation]&lt;br /&gt;
*[http://msdn.microsoft.com/en-us/library/ms973861.aspx inheritance and interfaces]&lt;br /&gt;
*[http://www.amazon.com/Object-Oriented-Design-Using-Java-Skrien/dp/0072974168 Object-Oriented Design Using Java, Dale Skrien, 2007]&lt;/div&gt;</summary>
		<author><name>Jwpaul</name></author>
	</entry>
</feed>