<?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=Cadedam</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=Cadedam"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Cadedam"/>
	<updated>2026-08-11T07:25:17Z</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_3_cd&amp;diff=16521</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16521"/>
		<updated>2008-08-01T02:44:21Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Problem Statement =&lt;br /&gt;
We introduced the idea of low coupling in Lecture 20, and used the Observer pattern as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. Browse the Web and the ACM DL for other information, both theoretical and practical, and produce a guide to what there is to know about low coupling. Be sure to highlight those aspects that would be appropriate for inclusion in CSC/ECE 517. &lt;br /&gt;
&lt;br /&gt;
= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. Coupling between modules/components is their degree of mutual interdependence. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
Examples of low coupling include. &lt;br /&gt;
* size: low number of connections between routines &lt;br /&gt;
* intimacy: minimal number of connections between routines &lt;br /&gt;
* visibility: the prominence of the connection between routines &lt;br /&gt;
* flexibility: the ease of changing the connections between routines&lt;br /&gt;
&lt;br /&gt;
= Coupling in Theory =&lt;br /&gt;
&lt;br /&gt;
Coupling level names are presented in order from worse to better: (high coupling is bad) &lt;br /&gt;
&lt;br /&gt;
* Content/Pathological Coupling : (worst) When a module uses/alters data in another &lt;br /&gt;
* Control Coupling : 2 modules communicating with a control flag (first tells second what to do via flag) &lt;br /&gt;
* Common/Global-data Coupling : 2 modules communicating via global data &lt;br /&gt;
* Stamp/Data-structure Coupling : Communicating via a data structure passed as a parameter. The data structure holds more information than the recipient needs. &lt;br /&gt;
* Data Coupling : (best) Communicating via parameter passing. The parameters passed are only those that the recipient needs. &lt;br /&gt;
* No data coupling : independent modules.&lt;br /&gt;
&lt;br /&gt;
= Coupling in Practice =&lt;br /&gt;
http://www.leansoftwareengineering.com/wp-content/uploads/2007/08/abc.jpg&lt;br /&gt;
&lt;br /&gt;
Coupling is easy to measure and understand because it is mechanical in nature and requires less interpretation. Suppose there are three components A, B, and C. A's behavior depends upon B in some way (any way), A’s behavior depends upon C in some way, and the behavior of B and C do not appear to depend upon anything else. &lt;br /&gt;
&lt;br /&gt;
That is the coupling of the system and it is measureable.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
[http://leansoftwareengineering.com/2007/08/08/what-is-coupling-really/ What is Coupling Really?]&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Coupling_(computer_science) Coupling on Wikipedia]&lt;br /&gt;
&lt;br /&gt;
[http://c2.com/cgi/wiki?CouplingAndCohesion Coupling and Cohesion]&lt;br /&gt;
&lt;br /&gt;
[http://pages.cpsc.ucalgary.ca/~eberly/Courses/CPSC333/Lectures/Design/coupling.html Coupling Theory]&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16499</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16499"/>
		<updated>2008-08-01T02:10:19Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Problem Statement =&lt;br /&gt;
We introduced the idea of low coupling in Lecture 20, and used the Observer pattern as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. Browse the Web and the ACM DL for other information, both theoretical and practical, and produce a guide to what there is to know about low coupling. Be sure to highlight those aspects that would be appropriate for inclusion in CSC/ECE 517. &lt;br /&gt;
&lt;br /&gt;
= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. Coupling between modules/components is their degree of mutual interdependence. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
Examples of low coupling include. &lt;br /&gt;
* size: low number of connections between routines &lt;br /&gt;
* intimacy: minimal number of connections between routines &lt;br /&gt;
* visibility: the prominence of the connection between routines &lt;br /&gt;
* flexibility: the ease of changing the connections between routines&lt;br /&gt;
&lt;br /&gt;
= Coupling in Theory =&lt;br /&gt;
&lt;br /&gt;
Coupling level names are presented in order from worse to better: (high coupling is bad) &lt;br /&gt;
&lt;br /&gt;
* Content/Pathological Coupling : (worst) When a module uses/alters data in another &lt;br /&gt;
* Control Coupling : 2 modules communicating with a control flag (first tells second what to do via flag) &lt;br /&gt;
* Common/Global-data Coupling : 2 modules communicating via global data &lt;br /&gt;
* Stamp/Data-structure Coupling : Communicating via a data structure passed as a parameter. The data structure holds more information than the recipient needs. &lt;br /&gt;
* Data Coupling : (best) Communicating via parameter passing. The parameters passed are only those that the recipient needs. &lt;br /&gt;
* No data coupling : independent modules.&lt;br /&gt;
&lt;br /&gt;
= Coupling in Practice =&lt;br /&gt;
http://www.leansoftwareengineering.com/wp-content/uploads/2007/08/abc.jpg&lt;br /&gt;
&lt;br /&gt;
Coupling is easy to measure and understand because it is mechanical in nature and requires less interpretation. Suppose there are three components A, B, and C. A's behavior depends upon B in some way (any way), A’s behavior depends upon C in some way, and the behavior of B and C do not appear to depend upon anything else. &lt;br /&gt;
&lt;br /&gt;
That is the coupling of the system and it is measureable.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
[http://leansoftwareengineering.com/2007/08/08/what-is-coupling-really/ What is Coupling Really?]&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Coupling_(computer_science) Coupling on Wikipedia]&lt;br /&gt;
&lt;br /&gt;
[http://c2.com/cgi/wiki?CouplingAndCohesion Coupling and Cohesion]&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>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16498</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16498"/>
		<updated>2008-08-01T02:09:22Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Coupling in Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Problem Statement =&lt;br /&gt;
We introduced the idea of low coupling in Lecture 20, and used the Observer pattern as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. Browse the Web and the ACM DL for other information, both theoretical and practical, and produce a guide to what there is to know about low coupling. Be sure to highlight those aspects that would be appropriate for inclusion in CSC/ECE 517. &lt;br /&gt;
&lt;br /&gt;
= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. Coupling between modules/components is their degree of mutual interdependence. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
Examples of low coupling include. &lt;br /&gt;
* size: low number of connections between routines &lt;br /&gt;
* intimacy: minimal number of connections between routines &lt;br /&gt;
* visibility: the prominence of the connection between routines &lt;br /&gt;
* flexibility: the ease of changing the connections between routines&lt;br /&gt;
&lt;br /&gt;
= Coupling in Theory =&lt;br /&gt;
&lt;br /&gt;
Coupling level names are presented in order from worse to better:&lt;br /&gt;
&lt;br /&gt;
Coupling (interdependence between modules) level names: (from worse to better, high coupling is bad) &lt;br /&gt;
Content/Pathological Coupling : (worst) When a module uses/alters data in another &lt;br /&gt;
Control Coupling : 2 modules communicating with a control flag (first tells second what to do via flag) &lt;br /&gt;
Common/Global-data Coupling : 2 modules communicating via global data &lt;br /&gt;
Stamp/Data-structure Coupling : Communicating via a data structure passed as a parameter. The data structure holds more information than the recipient needs. &lt;br /&gt;
Data Coupling : (best) Communicating via parameter passing. The parameters passed are only those that the recipient needs. &lt;br /&gt;
No data coupling : independent modules.&lt;br /&gt;
&lt;br /&gt;
= Coupling in Practice =&lt;br /&gt;
http://www.leansoftwareengineering.com/wp-content/uploads/2007/08/abc.jpg&lt;br /&gt;
&lt;br /&gt;
Coupling is easy to measure and understand because it is mechanical in nature and requires less interpretation. Suppose there are three components A, B, and C. A's behavior depends upon B in some way (any way), A’s behavior depends upon C in some way, and the behavior of B and C do not appear to depend upon anything else. &lt;br /&gt;
&lt;br /&gt;
That is the coupling of the system and it is measureable.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
[http://leansoftwareengineering.com/2007/08/08/what-is-coupling-really/ What is Coupling Really?]&lt;br /&gt;
[http://en.wikipedia.org/wiki/Coupling_(computer_science) Coupling on Wikipedia]&lt;br /&gt;
[http://c2.com/cgi/wiki?CouplingAndCohesion Coupling and Cohesion]&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>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16497</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16497"/>
		<updated>2008-08-01T02:08:22Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Low coupling. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Problem Statement =&lt;br /&gt;
We introduced the idea of low coupling in Lecture 20, and used the Observer pattern as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. Browse the Web and the ACM DL for other information, both theoretical and practical, and produce a guide to what there is to know about low coupling. Be sure to highlight those aspects that would be appropriate for inclusion in CSC/ECE 517. &lt;br /&gt;
&lt;br /&gt;
= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. Coupling between modules/components is their degree of mutual interdependence. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
Examples of low coupling include. &lt;br /&gt;
* size: low number of connections between routines &lt;br /&gt;
* intimacy: minimal number of connections between routines &lt;br /&gt;
* visibility: the prominence of the connection between routines &lt;br /&gt;
* flexibility: the ease of changing the connections between routines&lt;br /&gt;
&lt;br /&gt;
= Coupling in Theory =&lt;br /&gt;
&lt;br /&gt;
= Coupling in Practice =&lt;br /&gt;
http://www.leansoftwareengineering.com/wp-content/uploads/2007/08/abc.jpg&lt;br /&gt;
&lt;br /&gt;
Coupling is easy to measure and understand because it is mechanical in nature and requires less interpretation. Suppose there are three components A, B, and C. A's behavior depends upon B in some way (any way), A’s behavior depends upon C in some way, and the behavior of B and C do not appear to depend upon anything else. &lt;br /&gt;
&lt;br /&gt;
That is the coupling of the system and it is measureable.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
[http://leansoftwareengineering.com/2007/08/08/what-is-coupling-really/ What is Coupling Really?]&lt;br /&gt;
[http://en.wikipedia.org/wiki/Coupling_(computer_science) Coupling on Wikipedia]&lt;br /&gt;
[http://c2.com/cgi/wiki?CouplingAndCohesion Coupling and Cohesion]&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>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16496</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16496"/>
		<updated>2008-08-01T02:06:29Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Problem Statement =&lt;br /&gt;
We introduced the idea of low coupling in Lecture 20, and used the Observer pattern as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. Browse the Web and the ACM DL for other information, both theoretical and practical, and produce a guide to what there is to know about low coupling. Be sure to highlight those aspects that would be appropriate for inclusion in CSC/ECE 517. &lt;br /&gt;
&lt;br /&gt;
= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= Coupling in Theory =&lt;br /&gt;
&lt;br /&gt;
= Coupling in Practice =&lt;br /&gt;
http://www.leansoftwareengineering.com/wp-content/uploads/2007/08/abc.jpg&lt;br /&gt;
&lt;br /&gt;
Coupling is easy to measure and understand because it is mechanical in nature and requires less interpretation. Suppose there are three components A, B, and C. A's behavior depends upon B in some way (any way), A’s behavior depends upon C in some way, and the behavior of B and C do not appear to depend upon anything else. &lt;br /&gt;
&lt;br /&gt;
That is the coupling of the system and it is measureable.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
[http://leansoftwareengineering.com/2007/08/08/what-is-coupling-really/ What is Coupling Really?]&lt;br /&gt;
[http://en.wikipedia.org/wiki/Coupling_(computer_science) Coupling on Wikipedia]&lt;br /&gt;
[http://c2.com/cgi/wiki?CouplingAndCohesion Coupling and Cohesion]&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>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16478</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16478"/>
		<updated>2008-08-01T01:44:38Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Problem Statement =&lt;br /&gt;
We introduced the idea of low coupling in Lecture 20, and used the Observer pattern as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. Browse the Web and the ACM DL for other information, both theoretical and practical, and produce a guide to what there is to know about low coupling. Be sure to highlight those aspects that would be appropriate for inclusion in CSC/ECE 517. &lt;br /&gt;
&lt;br /&gt;
= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= Coupling in Theory =&lt;br /&gt;
&lt;br /&gt;
= Coupling in Practice =&lt;br /&gt;
http://www.leansoftwareengineering.com/wp-content/uploads/2007/08/abc.jpg&lt;br /&gt;
&lt;br /&gt;
Coupling is easy to measure and understand because it is mechanical in nature and requires less interpretation. Suppose there are three components A, B, and C. A's behavior depends upon B in some way (any way), A’s behavior depends upon C in some way, and the behavior of B and C do not appear to depend upon anything else. &lt;br /&gt;
&lt;br /&gt;
That is the coupling of the system and it is measureable.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
[http://leansoftwareengineering.com/2007/08/08/what-is-coupling-really/ What is Coupling Really?]&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>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16477</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16477"/>
		<updated>2008-08-01T01:44:20Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Coupling in Practice */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Problem Statement =&lt;br /&gt;
We introduced the idea of low coupling in Lecture 20, and used the Observer pattern as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. Browse the Web and the ACM DL for other information, both theoretical and practical, and produce a guide to what there is to know about low coupling. Be sure to highlight those aspects that would be appropriate for inclusion in CSC/ECE 517. &lt;br /&gt;
&lt;br /&gt;
= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= Coupling in Theory =&lt;br /&gt;
&lt;br /&gt;
= Coupling in Practice =&lt;br /&gt;
Image:http://www.leansoftwareengineering.com/wp-content/uploads/2007/08/abc.jpg&lt;br /&gt;
Coupling is easy to measure and understand because it is mechanical in nature and requires less interpretation. Suppose there are three components A, B, and C. A's behavior depends upon B in some way (any way), A’s behavior depends upon C in some way, and the behavior of B and C do not appear to depend upon anything else. &lt;br /&gt;
&lt;br /&gt;
That is the coupling of the system and it is measureable.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
[http://leansoftwareengineering.com/2007/08/08/what-is-coupling-really/ What is Coupling Really?]&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>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16475</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16475"/>
		<updated>2008-08-01T01:44:06Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Problem Statement =&lt;br /&gt;
We introduced the idea of low coupling in Lecture 20, and used the Observer pattern as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. Browse the Web and the ACM DL for other information, both theoretical and practical, and produce a guide to what there is to know about low coupling. Be sure to highlight those aspects that would be appropriate for inclusion in CSC/ECE 517. &lt;br /&gt;
&lt;br /&gt;
= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= Coupling in Theory =&lt;br /&gt;
&lt;br /&gt;
= Coupling in Practice =&lt;br /&gt;
[Image:http://www.leansoftwareengineering.com/wp-content/uploads/2007/08/abc.jpg]&lt;br /&gt;
Coupling is easy to measure and understand because it is mechanical in nature and requires less interpretation. Suppose there are three components A, B, and C. A's behavior depends upon B in some way (any way), A’s behavior depends upon C in some way, and the behavior of B and C do not appear to depend upon anything else. &lt;br /&gt;
&lt;br /&gt;
That is the coupling of the system and it is measureable.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
[http://leansoftwareengineering.com/2007/08/08/what-is-coupling-really/ What is Coupling Really?]&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>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16474</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16474"/>
		<updated>2008-08-01T01:43:36Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Problem Statement =&lt;br /&gt;
We introduced the idea of low coupling in Lecture 20, and used the Observer pattern as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. Browse the Web and the ACM DL for other information, both theoretical and practical, and produce a guide to what there is to know about low coupling. Be sure to highlight those aspects that would be appropriate for inclusion in CSC/ECE 517. &lt;br /&gt;
&lt;br /&gt;
= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= Coupling in Theory =&lt;br /&gt;
&lt;br /&gt;
= Coupling in Practice =&lt;br /&gt;
[[Image:http://leansoftwareengineering.com/wp-content/uploads/2007/08/abc.jpg]]&lt;br /&gt;
Coupling is easy to measure and understand because it is mechanical in nature and requires less interpretation. Suppose there are three components A, B, and C. A's behavior depends upon B in some way (any way), A’s behavior depends upon C in some way, and the behavior of B and C do not appear to depend upon anything else. &lt;br /&gt;
&lt;br /&gt;
That is the coupling of the system and it is measureable.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
[http://leansoftwareengineering.com/2007/08/08/what-is-coupling-really/ What is Coupling Really?]&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>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16358</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16358"/>
		<updated>2008-07-31T21:21:23Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Low coupling. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Problem Statement =&lt;br /&gt;
We introduced the idea of low coupling in Lecture 20, and used the Observer pattern as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. Browse the Web and the ACM DL for other information, both theoretical and practical, and produce a guide to what there is to know about low coupling. Be sure to highlight those aspects that would be appropriate for inclusion in CSC/ECE 517. &lt;br /&gt;
&lt;br /&gt;
= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&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>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16357</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16357"/>
		<updated>2008-07-31T21:18:59Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&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>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16043</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16043"/>
		<updated>2008-07-27T02:55:30Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= The Observer pattern =&lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
= Observer Pattern Example =&lt;br /&gt;
&lt;br /&gt;
Here is an example that takes keyboard input and treats each input line as an event. The example is built upon the library classes &amp;lt;tt&amp;gt;java.util.Observer&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;java.util.Observable&amp;lt;/tt&amp;gt;. When a string is supplied from System.in, the method &amp;lt;tt&amp;gt;notifyObserver&amp;lt;/tt&amp;gt; is then called, in order to notify all observers of the event's occurrence, in the form of an invocation of their 'update' methods - in our example, &amp;lt;tt&amp;gt;ResponseHandler.update(...)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The file myapp.java contains a main() method that might be used in order to run the code.&lt;br /&gt;
&lt;br /&gt;
 /* File Name : EventSource.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 import java.util.Observable;          //Observable is here&lt;br /&gt;
 import java.io.BufferedReader;&lt;br /&gt;
 import java.io.IOException;&lt;br /&gt;
 import java.io.InputStreamReader;&lt;br /&gt;
 &lt;br /&gt;
 public class EventSource extends Observable implements Runnable &lt;br /&gt;
 {&lt;br /&gt;
    public void run()&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {   &lt;br /&gt;
            final InputStreamReader isr = new InputStreamReader( System.in );&lt;br /&gt;
            final BufferedReader br = new BufferedReader( isr );&lt;br /&gt;
            while( true )&lt;br /&gt;
            {&lt;br /&gt;
                final String response = br.readLine();&lt;br /&gt;
                setChanged();&lt;br /&gt;
                notifyObservers( response );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch (IOException e)&lt;br /&gt;
        {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /* File Name: ResponseHandler.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 &lt;br /&gt;
 import java.util.Observable;&lt;br /&gt;
 import java.util.Observer;  /* this is Event Handler */&lt;br /&gt;
 &lt;br /&gt;
 public class ResponseHandler implements Observer&lt;br /&gt;
 {&lt;br /&gt;
    private String resp;&lt;br /&gt;
    public void update (Observable obj, Object arg)&lt;br /&gt;
    {&lt;br /&gt;
        if (arg instanceof String)&lt;br /&gt;
        {&lt;br /&gt;
            resp = (String) arg;&lt;br /&gt;
            System.out.println(&amp;quot;\nReceived Response: &amp;quot;+ resp );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }  &lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /* Filename : myapp.java */&lt;br /&gt;
 /* This is main program */&lt;br /&gt;
  &lt;br /&gt;
 package OBS;&lt;br /&gt;
  &lt;br /&gt;
 public class myapp&lt;br /&gt;
 {&lt;br /&gt;
    public static void main(String args[])&lt;br /&gt;
    {            &lt;br /&gt;
        System.out.println(&amp;quot;Enter Text &amp;gt;&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
        // create an event source - reads from stdin&lt;br /&gt;
        final EventSource evSrc = new EventSource();&lt;br /&gt;
  &lt;br /&gt;
        // create an observer&lt;br /&gt;
        final ResponseHandler respHandler = new ResponseHandler();&lt;br /&gt;
 &lt;br /&gt;
        // subscribe the observer to the event source&lt;br /&gt;
        evSrc.addObserver( respHandler );&lt;br /&gt;
 &lt;br /&gt;
        // starts the event thread&lt;br /&gt;
        Thread thread = new Thread(evSrc);&lt;br /&gt;
        thread.start();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also refer to an article in JavaWorld&lt;br /&gt;
http://www.javaworld.com/javaworld/javaqa/2001-05/04-qa-0525-observer.html&lt;br /&gt;
&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>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16042</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16042"/>
		<updated>2008-07-27T02:54:22Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* highlights */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= The Observer pattern =&lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
= Observer Pattern Example =&lt;br /&gt;
&lt;br /&gt;
Here is an example that takes keyboard input and treats each input line as an event. The example is built upon the library classes &amp;lt;tt&amp;gt;java.util.Observer&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;java.util.Observable&amp;lt;/tt&amp;gt;. When a string is supplied from System.in, the method &amp;lt;tt&amp;gt;notifyObserver&amp;lt;/tt&amp;gt; is then called, in order to notify all observers of the event's occurrence, in the form of an invocation of their 'update' methods - in our example, &amp;lt;tt&amp;gt;ResponseHandler.update(...)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The file myapp.java contains a main() method that might be used in order to run the code.&lt;br /&gt;
&lt;br /&gt;
 /* File Name : EventSource.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 import java.util.Observable;          //Observable is here&lt;br /&gt;
 import java.io.BufferedReader;&lt;br /&gt;
 import java.io.IOException;&lt;br /&gt;
 import java.io.InputStreamReader;&lt;br /&gt;
 &lt;br /&gt;
 public class EventSource extends Observable implements Runnable &lt;br /&gt;
 {&lt;br /&gt;
    public void run()&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {   &lt;br /&gt;
            final InputStreamReader isr = new InputStreamReader( System.in );&lt;br /&gt;
            final BufferedReader br = new BufferedReader( isr );&lt;br /&gt;
            while( true )&lt;br /&gt;
            {&lt;br /&gt;
                final String response = br.readLine();&lt;br /&gt;
                setChanged();&lt;br /&gt;
                notifyObservers( response );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch (IOException e)&lt;br /&gt;
        {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /* File Name: ResponseHandler.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 &lt;br /&gt;
 import java.util.Observable;&lt;br /&gt;
 import java.util.Observer;  /* this is Event Handler */&lt;br /&gt;
 &lt;br /&gt;
 public class ResponseHandler implements Observer&lt;br /&gt;
 {&lt;br /&gt;
    private String resp;&lt;br /&gt;
    public void update (Observable obj, Object arg)&lt;br /&gt;
    {&lt;br /&gt;
        if (arg instanceof String)&lt;br /&gt;
        {&lt;br /&gt;
            resp = (String) arg;&lt;br /&gt;
            System.out.println(&amp;quot;\nReceived Response: &amp;quot;+ resp );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }  &lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /* Filename : myapp.java */&lt;br /&gt;
 /* This is main program */&lt;br /&gt;
  &lt;br /&gt;
 package OBS;&lt;br /&gt;
  &lt;br /&gt;
 public class myapp&lt;br /&gt;
 {&lt;br /&gt;
    public static void main(String args[])&lt;br /&gt;
    {            &lt;br /&gt;
        System.out.println(&amp;quot;Enter Text &amp;gt;&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
        // create an event source - reads from stdin&lt;br /&gt;
        final EventSource evSrc = new EventSource();&lt;br /&gt;
  &lt;br /&gt;
        // create an observer&lt;br /&gt;
        final ResponseHandler respHandler = new ResponseHandler();&lt;br /&gt;
 &lt;br /&gt;
        // subscribe the observer to the event source&lt;br /&gt;
        evSrc.addObserver( respHandler );&lt;br /&gt;
 &lt;br /&gt;
        // starts the event thread&lt;br /&gt;
        Thread thread = new Thread(evSrc);&lt;br /&gt;
        thread.start();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also refer to an article in JavaWorld&lt;br /&gt;
http://www.javaworld.com/javaworld/javaqa/2001-05/04-qa-0525-observer.html&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16038</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16038"/>
		<updated>2008-07-27T02:41:40Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= The Observer pattern =&lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
= Observer Pattern Example =&lt;br /&gt;
&lt;br /&gt;
Here is an example that takes keyboard input and treats each input line as an event. The example is built upon the library classes &amp;lt;tt&amp;gt;java.util.Observer&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;java.util.Observable&amp;lt;/tt&amp;gt;. When a string is supplied from System.in, the method &amp;lt;tt&amp;gt;notifyObserver&amp;lt;/tt&amp;gt; is then called, in order to notify all observers of the event's occurrence, in the form of an invocation of their 'update' methods - in our example, &amp;lt;tt&amp;gt;ResponseHandler.update(...)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The file myapp.java contains a main() method that might be used in order to run the code.&lt;br /&gt;
&lt;br /&gt;
 /* File Name : EventSource.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 import java.util.Observable;          //Observable is here&lt;br /&gt;
 import java.io.BufferedReader;&lt;br /&gt;
 import java.io.IOException;&lt;br /&gt;
 import java.io.InputStreamReader;&lt;br /&gt;
 &lt;br /&gt;
 public class EventSource extends Observable implements Runnable &lt;br /&gt;
 {&lt;br /&gt;
    public void run()&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {   &lt;br /&gt;
            final InputStreamReader isr = new InputStreamReader( System.in );&lt;br /&gt;
            final BufferedReader br = new BufferedReader( isr );&lt;br /&gt;
            while( true )&lt;br /&gt;
            {&lt;br /&gt;
                final String response = br.readLine();&lt;br /&gt;
                setChanged();&lt;br /&gt;
                notifyObservers( response );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch (IOException e)&lt;br /&gt;
        {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /* File Name: ResponseHandler.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 &lt;br /&gt;
 import java.util.Observable;&lt;br /&gt;
 import java.util.Observer;  /* this is Event Handler */&lt;br /&gt;
 &lt;br /&gt;
 public class ResponseHandler implements Observer&lt;br /&gt;
 {&lt;br /&gt;
    private String resp;&lt;br /&gt;
    public void update (Observable obj, Object arg)&lt;br /&gt;
    {&lt;br /&gt;
        if (arg instanceof String)&lt;br /&gt;
        {&lt;br /&gt;
            resp = (String) arg;&lt;br /&gt;
            System.out.println(&amp;quot;\nReceived Response: &amp;quot;+ resp );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }  &lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /* Filename : myapp.java */&lt;br /&gt;
 /* This is main program */&lt;br /&gt;
  &lt;br /&gt;
 package OBS;&lt;br /&gt;
  &lt;br /&gt;
 public class myapp&lt;br /&gt;
 {&lt;br /&gt;
    public static void main(String args[])&lt;br /&gt;
    {            &lt;br /&gt;
        System.out.println(&amp;quot;Enter Text &amp;gt;&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
        // create an event source - reads from stdin&lt;br /&gt;
        final EventSource evSrc = new EventSource();&lt;br /&gt;
  &lt;br /&gt;
        // create an observer&lt;br /&gt;
        final ResponseHandler respHandler = new ResponseHandler();&lt;br /&gt;
 &lt;br /&gt;
        // subscribe the observer to the event source&lt;br /&gt;
        evSrc.addObserver( respHandler );&lt;br /&gt;
 &lt;br /&gt;
        // starts the event thread&lt;br /&gt;
        Thread thread = new Thread(evSrc);&lt;br /&gt;
        thread.start();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also refer to an article in JavaWorld&lt;br /&gt;
http://www.javaworld.com/javaworld/javaqa/2001-05/04-qa-0525-observer.html&lt;br /&gt;
&lt;br /&gt;
= highlights =&lt;br /&gt;
those aspects that would be appropriate for inclusion in CSC/ECE 517.&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16013</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16013"/>
		<updated>2008-07-27T02:19:32Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Java */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= The Observer pattern =&lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
= Observer Pattern Example =&lt;br /&gt;
&lt;br /&gt;
Here is an example that takes keyboard input and treats each input line as an event. The example is built upon the library classes &amp;lt;tt&amp;gt;java.util.Observer&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;java.util.Observable&amp;lt;/tt&amp;gt;. When a string is supplied from System.in, the method &amp;lt;tt&amp;gt;notifyObserver&amp;lt;/tt&amp;gt; is then called, in order to notify all observers of the event's occurrence, in the form of an invocation of their 'update' methods - in our example, &amp;lt;tt&amp;gt;ResponseHandler.update(...)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The file myapp.java contains a main() method that might be used in order to run the code.&lt;br /&gt;
&lt;br /&gt;
 /* File Name : EventSource.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 import java.util.Observable;          //Observable is here&lt;br /&gt;
 import java.io.BufferedReader;&lt;br /&gt;
 import java.io.IOException;&lt;br /&gt;
 import java.io.InputStreamReader;&lt;br /&gt;
 &lt;br /&gt;
 public class EventSource extends Observable implements Runnable &lt;br /&gt;
 {&lt;br /&gt;
    public void run()&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {   &lt;br /&gt;
            final InputStreamReader isr = new InputStreamReader( System.in );&lt;br /&gt;
            final BufferedReader br = new BufferedReader( isr );&lt;br /&gt;
            while( true )&lt;br /&gt;
            {&lt;br /&gt;
                final String response = br.readLine();&lt;br /&gt;
                setChanged();&lt;br /&gt;
                notifyObservers( response );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch (IOException e)&lt;br /&gt;
        {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /* File Name: ResponseHandler.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 &lt;br /&gt;
 import java.util.Observable;&lt;br /&gt;
 import java.util.Observer;  /* this is Event Handler */&lt;br /&gt;
 &lt;br /&gt;
 public class ResponseHandler implements Observer&lt;br /&gt;
 {&lt;br /&gt;
    private String resp;&lt;br /&gt;
    public void update (Observable obj, Object arg)&lt;br /&gt;
    {&lt;br /&gt;
        if (arg instanceof String)&lt;br /&gt;
        {&lt;br /&gt;
            resp = (String) arg;&lt;br /&gt;
            System.out.println(&amp;quot;\nReceived Response: &amp;quot;+ resp );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }  &lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /* Filename : myapp.java */&lt;br /&gt;
 /* This is main program */&lt;br /&gt;
  &lt;br /&gt;
 package OBS;&lt;br /&gt;
  &lt;br /&gt;
 public class myapp&lt;br /&gt;
 {&lt;br /&gt;
    public static void main(String args[])&lt;br /&gt;
    {            &lt;br /&gt;
        System.out.println(&amp;quot;Enter Text &amp;gt;&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
        // create an event source - reads from stdin&lt;br /&gt;
        final EventSource evSrc = new EventSource();&lt;br /&gt;
  &lt;br /&gt;
        // create an observer&lt;br /&gt;
        final ResponseHandler respHandler = new ResponseHandler();&lt;br /&gt;
 &lt;br /&gt;
        // subscribe the observer to the event source&lt;br /&gt;
        evSrc.addObserver( respHandler );&lt;br /&gt;
 &lt;br /&gt;
        // starts the event thread&lt;br /&gt;
        Thread thread = new Thread(evSrc);&lt;br /&gt;
        thread.start();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also refer to an article in JavaWorld&lt;br /&gt;
http://www.javaworld.com/javaworld/javaqa/2001-05/04-qa-0525-observer.html&lt;br /&gt;
&lt;br /&gt;
= theoretical =&lt;br /&gt;
&lt;br /&gt;
= practical =&lt;br /&gt;
&lt;br /&gt;
and produce a guide to what there is to know about low coupling. Be sure to &lt;br /&gt;
&lt;br /&gt;
= highlights =&lt;br /&gt;
those aspects that would be appropriate for inclusion in CSC/ECE 517.&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16012</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16012"/>
		<updated>2008-07-27T02:18:50Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Java */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= The Observer pattern =&lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
= Observer Pattern Example =&lt;br /&gt;
&lt;br /&gt;
= Java =&lt;br /&gt;
Here is an example that takes keyboard input and treats each input line as an event. The example is built upon the library classes &amp;lt;tt&amp;gt;java.util.Observer&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;java.util.Observable&amp;lt;/tt&amp;gt;. When a string is supplied from System.in, the method &amp;lt;tt&amp;gt;notifyObserver&amp;lt;/tt&amp;gt; is then called, in order to notify all observers of the event's occurrence, in the form of an invocation of their 'update' methods - in our example, &amp;lt;tt&amp;gt;ResponseHandler.update(...)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The file myapp.java contains a main() method that might be used in order to run the code.&lt;br /&gt;
&lt;br /&gt;
 /* File Name : EventSource.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 import java.util.Observable;          //Observable is here&lt;br /&gt;
 import java.io.BufferedReader;&lt;br /&gt;
 import java.io.IOException;&lt;br /&gt;
 import java.io.InputStreamReader;&lt;br /&gt;
 &lt;br /&gt;
 public class EventSource extends Observable implements Runnable &lt;br /&gt;
 {&lt;br /&gt;
    public void run()&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {   &lt;br /&gt;
            final InputStreamReader isr = new InputStreamReader( System.in );&lt;br /&gt;
            final BufferedReader br = new BufferedReader( isr );&lt;br /&gt;
            while( true )&lt;br /&gt;
            {&lt;br /&gt;
                final String response = br.readLine();&lt;br /&gt;
                setChanged();&lt;br /&gt;
                notifyObservers( response );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch (IOException e)&lt;br /&gt;
        {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /* File Name: ResponseHandler.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 &lt;br /&gt;
 import java.util.Observable;&lt;br /&gt;
 import java.util.Observer;  /* this is Event Handler */&lt;br /&gt;
 &lt;br /&gt;
 public class ResponseHandler implements Observer&lt;br /&gt;
 {&lt;br /&gt;
    private String resp;&lt;br /&gt;
    public void update (Observable obj, Object arg)&lt;br /&gt;
    {&lt;br /&gt;
        if (arg instanceof String)&lt;br /&gt;
        {&lt;br /&gt;
            resp = (String) arg;&lt;br /&gt;
            System.out.println(&amp;quot;\nReceived Response: &amp;quot;+ resp );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }  &lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /* Filename : myapp.java */&lt;br /&gt;
 /* This is main program */&lt;br /&gt;
  &lt;br /&gt;
 package OBS;&lt;br /&gt;
  &lt;br /&gt;
 public class myapp&lt;br /&gt;
 {&lt;br /&gt;
    public static void main(String args[])&lt;br /&gt;
    {            &lt;br /&gt;
        System.out.println(&amp;quot;Enter Text &amp;gt;&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
        // create an event source - reads from stdin&lt;br /&gt;
        final EventSource evSrc = new EventSource();&lt;br /&gt;
  &lt;br /&gt;
        // create an observer&lt;br /&gt;
        final ResponseHandler respHandler = new ResponseHandler();&lt;br /&gt;
 &lt;br /&gt;
        // subscribe the observer to the event source&lt;br /&gt;
        evSrc.addObserver( respHandler );&lt;br /&gt;
 &lt;br /&gt;
        // starts the event thread&lt;br /&gt;
        Thread thread = new Thread(evSrc);&lt;br /&gt;
        thread.start();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also refer to an article in JavaWorld&lt;br /&gt;
http://www.javaworld.com/javaworld/javaqa/2001-05/04-qa-0525-observer.html&lt;br /&gt;
&lt;br /&gt;
= theoretical =&lt;br /&gt;
&lt;br /&gt;
= practical =&lt;br /&gt;
&lt;br /&gt;
and produce a guide to what there is to know about low coupling. Be sure to &lt;br /&gt;
&lt;br /&gt;
= highlights =&lt;br /&gt;
those aspects that would be appropriate for inclusion in CSC/ECE 517.&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16011</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16011"/>
		<updated>2008-07-27T02:18:24Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Java */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= The Observer pattern =&lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
= Observer Pattern Example =&lt;br /&gt;
&lt;br /&gt;
= Java =&lt;br /&gt;
Here is an example that takes keyboard input and treats each input line as an event. The example is built upon the library classes &amp;lt;tt&amp;gt;java.util.Observer&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;java.util.Observable&amp;lt;/tt&amp;gt;. When a string is supplied from System.in, the method &amp;lt;tt&amp;gt;notifyObserver&amp;lt;/tt&amp;gt; is then called, in order to notify all observers of the event's occurrence, in the form of an invocation of their 'update' methods - in our example, &amp;lt;tt&amp;gt;ResponseHandler.update(...)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The file myapp.java contains a main() method that might be used in order to run the code.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /* File Name : EventSource.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 import java.util.Observable;          //Observable is here&lt;br /&gt;
 import java.io.BufferedReader;&lt;br /&gt;
 import java.io.IOException;&lt;br /&gt;
 import java.io.InputStreamReader;&lt;br /&gt;
 &lt;br /&gt;
 public class EventSource extends Observable implements Runnable &lt;br /&gt;
 {&lt;br /&gt;
    public void run()&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {   &lt;br /&gt;
            final InputStreamReader isr = new InputStreamReader( System.in );&lt;br /&gt;
            final BufferedReader br = new BufferedReader( isr );&lt;br /&gt;
            while( true )&lt;br /&gt;
            {&lt;br /&gt;
                final String response = br.readLine();&lt;br /&gt;
                setChanged();&lt;br /&gt;
                notifyObservers( response );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch (IOException e)&lt;br /&gt;
        {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /* File Name: ResponseHandler.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 &lt;br /&gt;
 import java.util.Observable;&lt;br /&gt;
 import java.util.Observer;  /* this is Event Handler */&lt;br /&gt;
 &lt;br /&gt;
 public class ResponseHandler implements Observer&lt;br /&gt;
 {&lt;br /&gt;
    private String resp;&lt;br /&gt;
    public void update (Observable obj, Object arg)&lt;br /&gt;
    {&lt;br /&gt;
        if (arg instanceof String)&lt;br /&gt;
        {&lt;br /&gt;
            resp = (String) arg;&lt;br /&gt;
            System.out.println(&amp;quot;\nReceived Response: &amp;quot;+ resp );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }  &lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /* Filename : myapp.java */&lt;br /&gt;
 /* This is main program */&lt;br /&gt;
  &lt;br /&gt;
 package OBS;&lt;br /&gt;
  &lt;br /&gt;
 public class myapp&lt;br /&gt;
 {&lt;br /&gt;
    public static void main(String args[])&lt;br /&gt;
    {            &lt;br /&gt;
        System.out.println(&amp;quot;Enter Text &amp;gt;&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
        // create an event source - reads from stdin&lt;br /&gt;
        final EventSource evSrc = new EventSource();&lt;br /&gt;
  &lt;br /&gt;
        // create an observer&lt;br /&gt;
        final ResponseHandler respHandler = new ResponseHandler();&lt;br /&gt;
 &lt;br /&gt;
        // subscribe the observer to the event source&lt;br /&gt;
        evSrc.addObserver( respHandler );&lt;br /&gt;
 &lt;br /&gt;
        // starts the event thread&lt;br /&gt;
        Thread thread = new Thread(evSrc);&lt;br /&gt;
        thread.start();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also refer to an article in JavaWorld&lt;br /&gt;
http://www.javaworld.com/javaworld/javaqa/2001-05/04-qa-0525-observer.html&lt;br /&gt;
&lt;br /&gt;
= theoretical =&lt;br /&gt;
&lt;br /&gt;
= practical =&lt;br /&gt;
&lt;br /&gt;
and produce a guide to what there is to know about low coupling. Be sure to &lt;br /&gt;
&lt;br /&gt;
= highlights =&lt;br /&gt;
those aspects that would be appropriate for inclusion in CSC/ECE 517.&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16009</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16009"/>
		<updated>2008-07-27T02:18:02Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Java */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= The Observer pattern =&lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
= Observer Pattern Example =&lt;br /&gt;
&lt;br /&gt;
= Java =&lt;br /&gt;
Here is an example that takes keyboard input and treats each input line as an event. The example is built upon the library classes &amp;lt;tt&amp;gt;java.util.Observer&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;java.util.Observable&amp;lt;/tt&amp;gt;. When a string is supplied from System.in, the method &amp;lt;tt&amp;gt;notifyObserver&amp;lt;/tt&amp;gt; is then called, in order to notify all observers of the event's occurrence, in the form of an invocation of their 'update' methods - in our example, &amp;lt;tt&amp;gt;ResponseHandler.update(...)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The file myapp.java contains a main() method that might be used in order to run the code.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /* File Name : EventSource.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 import java.util.Observable;          //Observable is here&lt;br /&gt;
 import java.io.BufferedReader;&lt;br /&gt;
 import java.io.IOException;&lt;br /&gt;
 import java.io.InputStreamReader;&lt;br /&gt;
 &lt;br /&gt;
 public class EventSource extends Observable implements Runnable &lt;br /&gt;
 {&lt;br /&gt;
    public void run()&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {   &lt;br /&gt;
            final InputStreamReader isr = new InputStreamReader( System.in );&lt;br /&gt;
            final BufferedReader br = new BufferedReader( isr );&lt;br /&gt;
            while( true )&lt;br /&gt;
            {&lt;br /&gt;
                final String response = br.readLine();&lt;br /&gt;
                setChanged();&lt;br /&gt;
                notifyObservers( response );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch (IOException e)&lt;br /&gt;
        {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /* File Name: ResponseHandler.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 &lt;br /&gt;
 import java.util.Observable;&lt;br /&gt;
 import java.util.Observer;  /* this is Event Handler */&lt;br /&gt;
 &lt;br /&gt;
 public class ResponseHandler implements Observer&lt;br /&gt;
 {&lt;br /&gt;
    private String resp;&lt;br /&gt;
    public void update (Observable obj, Object arg)&lt;br /&gt;
    {&lt;br /&gt;
        if (arg instanceof String)&lt;br /&gt;
        {&lt;br /&gt;
            resp = (String) arg;&lt;br /&gt;
            System.out.println(&amp;quot;\nReceived Response: &amp;quot;+ resp );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }  &lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /* Filename : myapp.java */&lt;br /&gt;
 /* This is main program */&lt;br /&gt;
  &lt;br /&gt;
 package OBS;&lt;br /&gt;
  &lt;br /&gt;
 public class myapp&lt;br /&gt;
 {&lt;br /&gt;
    public static void main(String args[])&lt;br /&gt;
    {            &lt;br /&gt;
        System.out.println(&amp;quot;Enter Text &amp;gt;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // create an event source - reads from stdin&lt;br /&gt;
        final EventSource evSrc = new EventSource();&lt;br /&gt;
 &lt;br /&gt;
        // create an observer&lt;br /&gt;
        final ResponseHandler respHandler = new ResponseHandler();&lt;br /&gt;
 &lt;br /&gt;
        // subscribe the observer to the event source&lt;br /&gt;
        evSrc.addObserver( respHandler );&lt;br /&gt;
 &lt;br /&gt;
        // starts the event thread&lt;br /&gt;
        Thread thread = new Thread(evSrc);&lt;br /&gt;
        thread.start();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also refer to an article in JavaWorld&lt;br /&gt;
http://www.javaworld.com/javaworld/javaqa/2001-05/04-qa-0525-observer.html&lt;br /&gt;
&lt;br /&gt;
= theoretical =&lt;br /&gt;
&lt;br /&gt;
= practical =&lt;br /&gt;
&lt;br /&gt;
and produce a guide to what there is to know about low coupling. Be sure to &lt;br /&gt;
&lt;br /&gt;
= highlights =&lt;br /&gt;
those aspects that would be appropriate for inclusion in CSC/ECE 517.&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16008</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16008"/>
		<updated>2008-07-27T02:17:46Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Java */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= The Observer pattern =&lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
= Observer Pattern Example =&lt;br /&gt;
&lt;br /&gt;
= Java =&lt;br /&gt;
Here is an example that takes keyboard input and treats each input line as an event. The example is built upon the library classes &amp;lt;tt&amp;gt;java.util.Observer&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;java.util.Observable&amp;lt;/tt&amp;gt;. When a string is supplied from System.in, the method &amp;lt;tt&amp;gt;notifyObserver&amp;lt;/tt&amp;gt; is then called, in order to notify all observers of the event's occurrence, in the form of an invocation of their 'update' methods - in our example, &amp;lt;tt&amp;gt;ResponseHandler.update(...)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The file myapp.java contains a main() method that might be used in order to run the code.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /* File Name : EventSource.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 import java.util.Observable;          //Observable is here&lt;br /&gt;
 import java.io.BufferedReader;&lt;br /&gt;
 import java.io.IOException;&lt;br /&gt;
 import java.io.InputStreamReader;&lt;br /&gt;
 &lt;br /&gt;
 public class EventSource extends Observable implements Runnable &lt;br /&gt;
 {&lt;br /&gt;
    public void run()&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {   &lt;br /&gt;
            final InputStreamReader isr = new InputStreamReader( System.in );&lt;br /&gt;
            final BufferedReader br = new BufferedReader( isr );&lt;br /&gt;
            while( true )&lt;br /&gt;
            {&lt;br /&gt;
                final String response = br.readLine();&lt;br /&gt;
                setChanged();&lt;br /&gt;
                notifyObservers( response );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch (IOException e)&lt;br /&gt;
        {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /* File Name: ResponseHandler.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 &lt;br /&gt;
 import java.util.Observable;&lt;br /&gt;
 import java.util.Observer;  /* this is Event Handler */&lt;br /&gt;
 &lt;br /&gt;
 public class ResponseHandler implements Observer&lt;br /&gt;
 {&lt;br /&gt;
    private String resp;&lt;br /&gt;
    public void update (Observable obj, Object arg)&lt;br /&gt;
    {&lt;br /&gt;
        if (arg instanceof String)&lt;br /&gt;
        {&lt;br /&gt;
            resp = (String) arg;&lt;br /&gt;
            System.out.println(&amp;quot;\nReceived Response: &amp;quot;+ resp );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }  &lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /* Filename : myapp.java */&lt;br /&gt;
 /* This is main program */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 &lt;br /&gt;
 public class myapp&lt;br /&gt;
 {&lt;br /&gt;
    public static void main(String args[])&lt;br /&gt;
    {            &lt;br /&gt;
        System.out.println(&amp;quot;Enter Text &amp;gt;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // create an event source - reads from stdin&lt;br /&gt;
        final EventSource evSrc = new EventSource();&lt;br /&gt;
 &lt;br /&gt;
        // create an observer&lt;br /&gt;
        final ResponseHandler respHandler = new ResponseHandler();&lt;br /&gt;
 &lt;br /&gt;
        // subscribe the observer to the event source&lt;br /&gt;
        evSrc.addObserver( respHandler );&lt;br /&gt;
 &lt;br /&gt;
        // starts the event thread&lt;br /&gt;
        Thread thread = new Thread(evSrc);&lt;br /&gt;
        thread.start();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also refer to an article in JavaWorld&lt;br /&gt;
http://www.javaworld.com/javaworld/javaqa/2001-05/04-qa-0525-observer.html&lt;br /&gt;
&lt;br /&gt;
= theoretical =&lt;br /&gt;
&lt;br /&gt;
= practical =&lt;br /&gt;
&lt;br /&gt;
and produce a guide to what there is to know about low coupling. Be sure to &lt;br /&gt;
&lt;br /&gt;
= highlights =&lt;br /&gt;
those aspects that would be appropriate for inclusion in CSC/ECE 517.&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16007</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16007"/>
		<updated>2008-07-27T02:17:26Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Java */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= The Observer pattern =&lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
= Observer Pattern Example =&lt;br /&gt;
&lt;br /&gt;
= Java =&lt;br /&gt;
Here is an example that takes keyboard input and treats each input line as an event. The example is built upon the library classes &amp;lt;tt&amp;gt;java.util.Observer&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;java.util.Observable&amp;lt;/tt&amp;gt;. When a string is supplied from System.in, the method &amp;lt;tt&amp;gt;notifyObserver&amp;lt;/tt&amp;gt; is then called, in order to notify all observers of the event's occurrence, in the form of an invocation of their 'update' methods - in our example, &amp;lt;tt&amp;gt;ResponseHandler.update(...)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The file myapp.java contains a main() method that might be used in order to run the code.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /* File Name : EventSource.java */&lt;br /&gt;
&lt;br /&gt;
 package OBS;&lt;br /&gt;
 import java.util.Observable;          //Observable is here&lt;br /&gt;
 import java.io.BufferedReader;&lt;br /&gt;
 import java.io.IOException;&lt;br /&gt;
 import java.io.InputStreamReader;&lt;br /&gt;
&lt;br /&gt;
 public class EventSource extends Observable implements Runnable &lt;br /&gt;
 {&lt;br /&gt;
    public void run()&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {   &lt;br /&gt;
            final InputStreamReader isr = new InputStreamReader( System.in );&lt;br /&gt;
            final BufferedReader br = new BufferedReader( isr );&lt;br /&gt;
            while( true )&lt;br /&gt;
            {&lt;br /&gt;
                final String response = br.readLine();&lt;br /&gt;
                setChanged();&lt;br /&gt;
                notifyObservers( response );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch (IOException e)&lt;br /&gt;
        {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /* File Name: ResponseHandler.java */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 &lt;br /&gt;
 import java.util.Observable;&lt;br /&gt;
 import java.util.Observer;  /* this is Event Handler */&lt;br /&gt;
 &lt;br /&gt;
 public class ResponseHandler implements Observer&lt;br /&gt;
 {&lt;br /&gt;
    private String resp;&lt;br /&gt;
    public void update (Observable obj, Object arg)&lt;br /&gt;
    {&lt;br /&gt;
        if (arg instanceof String)&lt;br /&gt;
        {&lt;br /&gt;
            resp = (String) arg;&lt;br /&gt;
            System.out.println(&amp;quot;\nReceived Response: &amp;quot;+ resp );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }  &lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /* Filename : myapp.java */&lt;br /&gt;
 /* This is main program */&lt;br /&gt;
 &lt;br /&gt;
 package OBS;&lt;br /&gt;
 &lt;br /&gt;
 public class myapp&lt;br /&gt;
 {&lt;br /&gt;
    public static void main(String args[])&lt;br /&gt;
    {            &lt;br /&gt;
        System.out.println(&amp;quot;Enter Text &amp;gt;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // create an event source - reads from stdin&lt;br /&gt;
        final EventSource evSrc = new EventSource();&lt;br /&gt;
 &lt;br /&gt;
        // create an observer&lt;br /&gt;
        final ResponseHandler respHandler = new ResponseHandler();&lt;br /&gt;
 &lt;br /&gt;
        // subscribe the observer to the event source&lt;br /&gt;
        evSrc.addObserver( respHandler );&lt;br /&gt;
 &lt;br /&gt;
        // starts the event thread&lt;br /&gt;
        Thread thread = new Thread(evSrc);&lt;br /&gt;
        thread.start();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also refer to an article in JavaWorld&lt;br /&gt;
http://www.javaworld.com/javaworld/javaqa/2001-05/04-qa-0525-observer.html&lt;br /&gt;
&lt;br /&gt;
= theoretical =&lt;br /&gt;
&lt;br /&gt;
= practical =&lt;br /&gt;
&lt;br /&gt;
and produce a guide to what there is to know about low coupling. Be sure to &lt;br /&gt;
&lt;br /&gt;
= highlights =&lt;br /&gt;
those aspects that would be appropriate for inclusion in CSC/ECE 517.&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16006</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16006"/>
		<updated>2008-07-27T02:16:40Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Java */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= The Observer pattern =&lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
= Observer Pattern Example =&lt;br /&gt;
&lt;br /&gt;
= Java =&lt;br /&gt;
Here is an example that takes keyboard input and treats each input line as an event. The example is built upon the library classes &amp;lt;tt&amp;gt;java.util.Observer&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;java.util.Observable&amp;lt;/tt&amp;gt;. When a string is supplied from System.in, the method &amp;lt;tt&amp;gt;notifyObserver&amp;lt;/tt&amp;gt; is then called, in order to notify all observers of the event's occurrence, in the form of an invocation of their 'update' methods - in our example, &amp;lt;tt&amp;gt;ResponseHandler.update(...)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The file myapp.java contains a main() method that might be used in order to run the code.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /* File Name : EventSource.java */&lt;br /&gt;
&lt;br /&gt;
 package OBS;&lt;br /&gt;
 import java.util.Observable;          //Observable is here&lt;br /&gt;
 import java.io.BufferedReader;&lt;br /&gt;
 import java.io.IOException;&lt;br /&gt;
 import java.io.InputStreamReader;&lt;br /&gt;
&lt;br /&gt;
 public class EventSource extends Observable implements Runnable &lt;br /&gt;
 {&lt;br /&gt;
    public void run()&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {   &lt;br /&gt;
            final InputStreamReader isr = new InputStreamReader( System.in );&lt;br /&gt;
            final BufferedReader br = new BufferedReader( isr );&lt;br /&gt;
            while( true )&lt;br /&gt;
            {&lt;br /&gt;
                final String response = br.readLine();&lt;br /&gt;
                setChanged();&lt;br /&gt;
                notifyObservers( response );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch (IOException e)&lt;br /&gt;
        {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /* File Name: ResponseHandler.java */&lt;br /&gt;
&lt;br /&gt;
 package OBS;&lt;br /&gt;
&lt;br /&gt;
 import java.util.Observable;&lt;br /&gt;
 import java.util.Observer;  /* this is Event Handler */&lt;br /&gt;
&lt;br /&gt;
 public class ResponseHandler implements Observer&lt;br /&gt;
 {&lt;br /&gt;
    private String resp;&lt;br /&gt;
    public void update (Observable obj, Object arg)&lt;br /&gt;
    {&lt;br /&gt;
        if (arg instanceof String)&lt;br /&gt;
        {&lt;br /&gt;
            resp = (String) arg;&lt;br /&gt;
            System.out.println(&amp;quot;\nReceived Response: &amp;quot;+ resp );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }  &lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /* Filename : myapp.java */&lt;br /&gt;
 /* This is main program */&lt;br /&gt;
&lt;br /&gt;
 package OBS;&lt;br /&gt;
&lt;br /&gt;
 public class myapp&lt;br /&gt;
 {&lt;br /&gt;
    public static void main(String args[])&lt;br /&gt;
    {            &lt;br /&gt;
        System.out.println(&amp;quot;Enter Text &amp;gt;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // create an event source - reads from stdin&lt;br /&gt;
        final EventSource evSrc = new EventSource();&lt;br /&gt;
&lt;br /&gt;
        // create an observer&lt;br /&gt;
        final ResponseHandler respHandler = new ResponseHandler();&lt;br /&gt;
&lt;br /&gt;
        // subscribe the observer to the event source&lt;br /&gt;
        evSrc.addObserver( respHandler );&lt;br /&gt;
&lt;br /&gt;
        // starts the event thread&lt;br /&gt;
        Thread thread = new Thread(evSrc);&lt;br /&gt;
        thread.start();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also refer to an article in JavaWorld&lt;br /&gt;
http://www.javaworld.com/javaworld/javaqa/2001-05/04-qa-0525-observer.html&lt;br /&gt;
&lt;br /&gt;
= theoretical =&lt;br /&gt;
&lt;br /&gt;
= practical =&lt;br /&gt;
&lt;br /&gt;
and produce a guide to what there is to know about low coupling. Be sure to &lt;br /&gt;
&lt;br /&gt;
= highlights =&lt;br /&gt;
those aspects that would be appropriate for inclusion in CSC/ECE 517.&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16003</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16003"/>
		<updated>2008-07-27T02:15:48Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Java */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= The Observer pattern =&lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
= Observer Pattern Example =&lt;br /&gt;
&lt;br /&gt;
= Java =&lt;br /&gt;
Here is an example that takes keyboard input and treats each input line as an event. The example is built upon the library classes &amp;lt;tt&amp;gt;java.util.Observer&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;java.util.Observable&amp;lt;/tt&amp;gt;. When a string is supplied from System.in, the method &amp;lt;tt&amp;gt;notifyObserver&amp;lt;/tt&amp;gt; is then called, in order to notify all observers of the event's occurrence, in the form of an invocation of their 'update' methods - in our example, &amp;lt;tt&amp;gt;ResponseHandler.update(...)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The file myapp.java contains a main() method that might be used in order to run the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/* File Name : EventSource.java */&lt;br /&gt;
&lt;br /&gt;
package OBS;&lt;br /&gt;
import java.util.Observable;          //Observable is here&lt;br /&gt;
import java.io.BufferedReader;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.io.InputStreamReader;&lt;br /&gt;
&lt;br /&gt;
public class EventSource extends Observable implements Runnable &lt;br /&gt;
{&lt;br /&gt;
    public void run()&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {   &lt;br /&gt;
            final InputStreamReader isr = new InputStreamReader( System.in );&lt;br /&gt;
            final BufferedReader br = new BufferedReader( isr );&lt;br /&gt;
            while( true )&lt;br /&gt;
            {&lt;br /&gt;
                final String response = br.readLine();&lt;br /&gt;
                setChanged();&lt;br /&gt;
                notifyObservers( response );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch (IOException e)&lt;br /&gt;
        {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/* File Name: ResponseHandler.java */&lt;br /&gt;
&lt;br /&gt;
package OBS;&lt;br /&gt;
&lt;br /&gt;
import java.util.Observable;&lt;br /&gt;
import java.util.Observer;  /* this is Event Handler */&lt;br /&gt;
&lt;br /&gt;
public class ResponseHandler implements Observer&lt;br /&gt;
{&lt;br /&gt;
    private String resp;&lt;br /&gt;
    public void update (Observable obj, Object arg)&lt;br /&gt;
    {&lt;br /&gt;
        if (arg instanceof String)&lt;br /&gt;
        {&lt;br /&gt;
            resp = (String) arg;&lt;br /&gt;
            System.out.println(&amp;quot;\nReceived Response: &amp;quot;+ resp );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}  &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/* Filename : myapp.java */&lt;br /&gt;
/* This is main program */&lt;br /&gt;
&lt;br /&gt;
package OBS;&lt;br /&gt;
&lt;br /&gt;
public class myapp&lt;br /&gt;
{&lt;br /&gt;
    public static void main(String args[])&lt;br /&gt;
    {            &lt;br /&gt;
        System.out.println(&amp;quot;Enter Text &amp;gt;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // create an event source - reads from stdin&lt;br /&gt;
        final EventSource evSrc = new EventSource();&lt;br /&gt;
&lt;br /&gt;
        // create an observer&lt;br /&gt;
        final ResponseHandler respHandler = new ResponseHandler();&lt;br /&gt;
&lt;br /&gt;
        // subscribe the observer to the event source&lt;br /&gt;
        evSrc.addObserver( respHandler );&lt;br /&gt;
&lt;br /&gt;
        // starts the event thread&lt;br /&gt;
        Thread thread = new Thread(evSrc);&lt;br /&gt;
        thread.start();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also refer to an article in JavaWorld&lt;br /&gt;
http://www.javaworld.com/javaworld/javaqa/2001-05/04-qa-0525-observer.html&lt;br /&gt;
&lt;br /&gt;
= theoretical =&lt;br /&gt;
&lt;br /&gt;
= practical =&lt;br /&gt;
&lt;br /&gt;
and produce a guide to what there is to know about low coupling. Be sure to &lt;br /&gt;
&lt;br /&gt;
= highlights =&lt;br /&gt;
those aspects that would be appropriate for inclusion in CSC/ECE 517.&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16001</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=16001"/>
		<updated>2008-07-27T02:15:11Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= The Observer pattern =&lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
= Observer Pattern Example =&lt;br /&gt;
&lt;br /&gt;
===Java===&lt;br /&gt;
Here is an example that takes keyboard input and treats each input line as an event. The example is built upon the library classes &amp;lt;tt&amp;gt;java.util.Observer&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;java.util.Observable&amp;lt;/tt&amp;gt;. When a string is supplied from System.in, the method &amp;lt;tt&amp;gt;notifyObserver&amp;lt;/tt&amp;gt; is then called, in order to notify all observers of the event's occurrence, in the form of an invocation of their 'update' methods - in our example, &amp;lt;tt&amp;gt;ResponseHandler.update(...)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The file myapp.java contains a main() method that might be used in order to run the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/* File Name : EventSource.java */&lt;br /&gt;
&lt;br /&gt;
package OBS;&lt;br /&gt;
import java.util.Observable;          //Observable is here&lt;br /&gt;
import java.io.BufferedReader;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.io.InputStreamReader;&lt;br /&gt;
&lt;br /&gt;
public class EventSource extends Observable implements Runnable &lt;br /&gt;
{&lt;br /&gt;
    public void run()&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {   &lt;br /&gt;
            final InputStreamReader isr = new InputStreamReader( System.in );&lt;br /&gt;
            final BufferedReader br = new BufferedReader( isr );&lt;br /&gt;
            while( true )&lt;br /&gt;
            {&lt;br /&gt;
                final String response = br.readLine();&lt;br /&gt;
                setChanged();&lt;br /&gt;
                notifyObservers( response );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch (IOException e)&lt;br /&gt;
        {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/* File Name: ResponseHandler.java */&lt;br /&gt;
&lt;br /&gt;
package OBS;&lt;br /&gt;
&lt;br /&gt;
import java.util.Observable;&lt;br /&gt;
import java.util.Observer;  /* this is Event Handler */&lt;br /&gt;
&lt;br /&gt;
public class ResponseHandler implements Observer&lt;br /&gt;
{&lt;br /&gt;
    private String resp;&lt;br /&gt;
    public void update (Observable obj, Object arg)&lt;br /&gt;
    {&lt;br /&gt;
        if (arg instanceof String)&lt;br /&gt;
        {&lt;br /&gt;
            resp = (String) arg;&lt;br /&gt;
            System.out.println(&amp;quot;\nReceived Response: &amp;quot;+ resp );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}  &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/* Filename : myapp.java */&lt;br /&gt;
/* This is main program */&lt;br /&gt;
&lt;br /&gt;
package OBS;&lt;br /&gt;
&lt;br /&gt;
public class myapp&lt;br /&gt;
{&lt;br /&gt;
    public static void main(String args[])&lt;br /&gt;
    {            &lt;br /&gt;
        System.out.println(&amp;quot;Enter Text &amp;gt;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // create an event source - reads from stdin&lt;br /&gt;
        final EventSource evSrc = new EventSource();&lt;br /&gt;
&lt;br /&gt;
        // create an observer&lt;br /&gt;
        final ResponseHandler respHandler = new ResponseHandler();&lt;br /&gt;
&lt;br /&gt;
        // subscribe the observer to the event source&lt;br /&gt;
        evSrc.addObserver( respHandler );&lt;br /&gt;
&lt;br /&gt;
        // starts the event thread&lt;br /&gt;
        Thread thread = new Thread(evSrc);&lt;br /&gt;
        thread.start();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also refer to an article in JavaWorld&lt;br /&gt;
http://www.javaworld.com/javaworld/javaqa/2001-05/04-qa-0525-observer.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= theoretical =&lt;br /&gt;
&lt;br /&gt;
= practical =&lt;br /&gt;
&lt;br /&gt;
and produce a guide to what there is to know about low coupling. Be sure to &lt;br /&gt;
&lt;br /&gt;
= highlights =&lt;br /&gt;
those aspects that would be appropriate for inclusion in CSC/ECE 517.&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=15988</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=15988"/>
		<updated>2008-07-27T01:59:40Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Low coupling. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. For example a system that has high coupling might experience the following issues:&lt;br /&gt;
&lt;br /&gt;
* Change in one module forces a ripple of changes in other modules. &lt;br /&gt;
* Modules are difficult to understand in isolation. &lt;br /&gt;
* Modules are difficult to reuse or test because dependent modules must be included.&lt;br /&gt;
&lt;br /&gt;
= The Observer pattern =&lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
= theoretical =&lt;br /&gt;
&lt;br /&gt;
= practical =&lt;br /&gt;
&lt;br /&gt;
and produce a guide to what there is to know about low coupling. Be sure to &lt;br /&gt;
&lt;br /&gt;
= highlights =&lt;br /&gt;
those aspects that would be appropriate for inclusion in CSC/ECE 517.&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=15971</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=15971"/>
		<updated>2008-07-27T01:29:41Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling. = &lt;br /&gt;
&lt;br /&gt;
We introduced the idea of low coupling in Lecture 20, &lt;br /&gt;
&lt;br /&gt;
= The Observer pattern =&lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
= theoretical =&lt;br /&gt;
&lt;br /&gt;
= practical =&lt;br /&gt;
&lt;br /&gt;
and produce a guide to what there is to know about low coupling. Be sure to &lt;br /&gt;
&lt;br /&gt;
= highlights =&lt;br /&gt;
those aspects that would be appropriate for inclusion in CSC/ECE 517.&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=15970</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=15970"/>
		<updated>2008-07-27T01:28:48Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low coupling.= &lt;br /&gt;
&lt;br /&gt;
We introduced the idea of low coupling in Lecture 20, &lt;br /&gt;
&lt;br /&gt;
The Observer pattern &lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
theoretical &lt;br /&gt;
&lt;br /&gt;
practical, &lt;br /&gt;
&lt;br /&gt;
and produce a guide to what there is to know about low coupling. Be sure to &lt;br /&gt;
&lt;br /&gt;
highlights&lt;br /&gt;
those aspects that would be appropriate for inclusion in CSC/ECE 517.&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_Assignment&amp;diff=15964</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=15964"/>
		<updated>2008-07-27T01:13:47Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: &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;
#[[CSC/ECE_517_Summer_2008/wiki3_3_cd | Low Coupling]]&lt;br /&gt;
#[[CSC/ECE_517_Summer_2008/wiki3_5_rp | Pure Fabrication]]&lt;br /&gt;
#[[CSC/ECE_517_Summer_2008/wiki3_7_SHOP_PAT | Shopper Pattern]]&lt;br /&gt;
#[[CSC/ECE_517_Summer_2008/wiki3_6_esb | Protected Variation]]&lt;br /&gt;
----&lt;br /&gt;
[[CSC/ECE 517 Summer 2008]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_Assignment&amp;diff=15963</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=15963"/>
		<updated>2008-07-27T01:13:24Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: &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;
#[[ECE_517_Summer_2008/wiki3_3_cd | Low Coupling]]&lt;br /&gt;
#[[CSC/ECE_517_Summer_2008/wiki3_5_rp | Pure Fabrication]]&lt;br /&gt;
#[[CSC/ECE_517_Summer_2008/wiki3_7_SHOP_PAT | Shopper Pattern]]&lt;br /&gt;
#[[CSC/ECE_517_Summer_2008/wiki3_6_esb | Protected Variation]]&lt;br /&gt;
----&lt;br /&gt;
[[CSC/ECE 517 Summer 2008]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=15962</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=15962"/>
		<updated>2008-07-27T01:12:16Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Low coupling. &lt;br /&gt;
&lt;br /&gt;
We introduced the idea of low coupling in Lecture 20, &lt;br /&gt;
&lt;br /&gt;
The Observer pattern &lt;br /&gt;
as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. &lt;br /&gt;
&lt;br /&gt;
Browse the Web and the ACM DL for other information, both &lt;br /&gt;
&lt;br /&gt;
theoretical &lt;br /&gt;
&lt;br /&gt;
practical, &lt;br /&gt;
&lt;br /&gt;
and produce a guide to what there is to know about low coupling. Be sure to &lt;br /&gt;
&lt;br /&gt;
highlights&lt;br /&gt;
those aspects that would be appropriate for inclusion in CSC/ECE 517.&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=15957</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 3 cd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_3_cd&amp;diff=15957"/>
		<updated>2008-07-27T01:06:25Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Low coupling. We introduced the idea of low coupling in Lecture 20, and used the Observer pattern as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. Browse the Web and the ACM DL for other information, both theoretical and practical, and produce a guide to what there is to know about low coupling. Be sure to highlight those aspects that would be appropriate for inclusion in CSC/ECE 517.&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14168</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14168"/>
		<updated>2008-06-26T12:49:48Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* DRY Principle - Always Good? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples will be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance.&lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. The DRY coding philosophy requires that information not be duplicated.  Duplication of data makes code less explicit and requires additional steps to fully implement any change in the code.  With a single authority for a given piece of knowledge within a code structure, the programmer need only change the core authority to effect change throughout the structure.  The results of changes to coding are predictable as all the logical connections to the altered data remain in agreement.  Likewise, unrelated knowledge is left intact.&lt;br /&gt;
&lt;br /&gt;
Ultimately, the goal of the DRY principal is to make code maintenance easier.  At first glance, some projects may seem like maintenance will not be much of an issue.  The project may be very small or the parameters seem defined well enough that, once completed, the project will not need further adjustment.  In reality, it is rare that code is ever complete.  In fact it has been shown that requirements change at a rate of two percent per month[1].  Even if one were to ignore the possibility of change requirements after code is complete, one must consider the following question:  How often is a complete section of code written, never to be altered, on the first try?  The truth is that maintenance begins immediately after anyone alters anything in the existing code.  In other words, it is virtually impossible not to do maintenance.  If data or code is repeated and maintenance needs to be done it will require the programmer to make changes and substitutions everywhere in the code where the repeated data or code exists.  Programmers are people and people will make errors.  Eventually a replacement will be missed somewhere in the code.  Having a single point of truth or authority for a particular piece of data will require the programmer to correctly alter the code in only one location and he or she can be assured the changes will populate correctly throughout the rest of the related code.&lt;br /&gt;
&lt;br /&gt;
Code written following the DRY principle, given its nature, will allow for easier changes and will allow many changes to be made with decreased likelihood of error.  Errors introduced late in the development process are typically the most time-consuming and therefore the most expensive to fix.  The advantages of having followed the DRY principal increases as the development process progresses.  Late in the development process the code will be voluminous (relative to early in development) and more complex.  Adherence to the DRY principle will allieviate a significant number of coding errors that would result from the implementation of change to repeated code or data.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Another example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 One of the most common ways to implement the DRY principal is with the use of code &lt;br /&gt;
 generators. Although it is technically not generating usable code, [http://www.codegeneration.net/tiki-index.php?page=JavaDoc JavaDoc] &lt;br /&gt;
 uses the existing Java code to generate documentation for its code. If the documentation &lt;br /&gt;
 was written independently of the code then changes to the code would very likely require &lt;br /&gt;
 changes in the documentation. With JavaDoc, since the documentation is generated from the &lt;br /&gt;
 source code, the documentation will still be relevant after maintenance is performed on the &lt;br /&gt;
 code. Using code generators like JavaDoc helps to allow a single authority on a piece of &lt;br /&gt;
 knowledge within in the code to be maintained. The programmer changes the code and the &lt;br /&gt;
 change is properly documented as a result.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Let's say we are storing purchase information in a database and have a&lt;br /&gt;
 field for quantity and item and total. So, we create a database table as follows:&lt;br /&gt;
 &lt;br /&gt;
 PK Purchase_ID&lt;br /&gt;
    ItemPrice&lt;br /&gt;
    ItemQuantity    &lt;br /&gt;
    TotalPrice&lt;br /&gt;
 &lt;br /&gt;
 Since TotalPrice is actually calculated by multiplying ItemPrice by the ItemQuantity &lt;br /&gt;
 we should instead have a table that looks like the following:&lt;br /&gt;
 &lt;br /&gt;
 PK Purchase_ID&lt;br /&gt;
    ItemPrice&lt;br /&gt;
    ItemQuantity    &lt;br /&gt;
  &lt;br /&gt;
 The total price can be calculated once the data is retrieved. This allows us not &lt;br /&gt;
 to duplicate values in the database table.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
  •If you have duplicated data in your code because it has to have different&lt;br /&gt;
 representations in different places, can you write a function, tool or code&lt;br /&gt;
 generator to make one representation from the other, or all from a common source?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your documentation duplicates knowledge in your code, can you generate parts&lt;br /&gt;
 of the documentation from parts of the code, or vice-versa, or both from a common&lt;br /&gt;
 higher-level representation?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your header files and interface declarations duplicate knowledge in your&lt;br /&gt;
 implementation code, is there a way you can generate the header files and &lt;br /&gt;
 interface declarations from the code?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have metadata, tables, or constants they should be declared once an imported&lt;br /&gt;
 elsewhere. &amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have reused a section of code, a change will require finding all the sections&lt;br /&gt;
 that involved reuse.  Missing some of the changes will often cause very subtle errors.&lt;br /&gt;
&lt;br /&gt;
= DRY Principle - Always Good? =&lt;br /&gt;
Considering the increasing reuse, re-adaptation, and maintenance of code it appears as though it is rarely adventageous to ignore the DRY principle.  The only instances where it may be beneficial to ignore the DRY principals is when the cost of following the principal is greater than effort of maintaining separate copies of data.  An example would be something very small-scale that will not require any meaningful maintenance.  As mentioned earlier, code often starts in this diminutive form and then morphs into something much greater, so, again the DRY principle should be ignored with caution.&lt;br /&gt;
&lt;br /&gt;
Another example of where it might be beneficial to ignore the DRY principal is in a forum where [http://www.artima.com/intv/dry3.html &amp;quot;imposing standards aimed at strict adherence to DRY could stifle community involvement in contexts where it is highly valued, such as a Wiki.&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
As stated throughout the article, the benefits to following the DRY principle almost always outweighs the benefits of ignoring them.  It is almost impossible to create and use any significant amount of code and not have to perform maintenance on that code.  Maintenance and clarity are the main benefits derived from this principle as it helps to remove some of the human errors that can occur in updating code - especially code that is redundant.  In many cases it may take a little longer to generate initial code using the DRY principle, but the time will likely be recouped as soon as any maintenance is required.  It is enormously time consuming to find every occurrance of a piece of knowledge within a sizeable code structure if the DRY principle has not been followed.  With the principle employed, the programmer needs only to find the one relevant section and make the necessary changes.   All logical connections will automatically change predictably to accomodate and unrelated knowledge will be left intact.&lt;br /&gt;
&lt;br /&gt;
= External Links/References =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[1]Hunt, Andy and Thomas, Dave&lt;br /&gt;
Keep It DRY, SHY, and Tell the Other Guy,&lt;br /&gt;
IEEE Software, vol. 21, no. 3, pp. 101-103, May/Jun 2004&lt;br /&gt;
PMID: 9917440; UI: 99117608. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14053</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14053"/>
		<updated>2008-06-26T02:15:10Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Examples of the DRY Principle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples will be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance.&lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. The DRY coding philosophy requires that information not be duplicated.  Duplication of data makes code less explicit and requires additional steps to fully implement any change in the code.  With a single authority for a given piece of knowledge within a code structure, the programmer need only change the core authority to effect change throughout the structure.  The results of changes to coding are predictable as all the logical connections to the altered data remain in agreement.  Likewise, unrelated knowledge is left intact.&lt;br /&gt;
&lt;br /&gt;
Ultimately, the goal of the DRY principal is to make code maintenance easier.  At first glance, some projects may seem like maintenance will not be much of an issue.  The project may be very small or the parameters seem defined well enough that, once completed, the project will not need further adjustment.  In reality, it is rare that code is ever complete.  In fact it has been shown that requirements change at a rate of two percent per month[1].  Even if one were to ignore the possibility of change requirements after code is complete, one must consider the following question:  How often is a complete section of code written, never to be altered, on the first try?  The truth is that maintenance begins immediately after anyone alters anything in the existing code.  In other words, it is virtually impossible not to do maintenance.  If data or code is repeated and maintenance needs to be done it will require the programmer to make changes and substitutions everywhere in the code where the repeated data or code exists.  Programmers are people and people will make errors.  Eventually a replacement will be missed somewhere in the code.  Having a single point of truth or authority for a particular piece of data will require the programmer to correctly alter the code in only one location and he or she can be assured the changes will populate correctly throughout the rest of the related code.&lt;br /&gt;
&lt;br /&gt;
Code written following the DRY principle, given its nature, will allow for easier changes and will allow many changes to be made with decreased likelihood of error.  Errors introduced late in the development process are typically the most time-consuming and therefore the most expensive to fix.  The advantages of having followed the DRY principal increases as the development process progresses.  Late in the development process the code will be voluminous (relative to early in development) and more complex.  Adherence to the DRY principle will allieviate a significant number of coding errors that would result from the implementation of change to repeated code or data.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Another example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 One of the most common ways to implement the DRY principal is with the use of code &lt;br /&gt;
 generators. Although it is technically not generating usable code, [http://www.codegeneration.net/tiki-index.php?page=JavaDoc JavaDoc] &lt;br /&gt;
 uses the existing Java code to generate documentation for its code. If the documentation &lt;br /&gt;
 was written independently of the code then changes to the code would very likely require &lt;br /&gt;
 changes in the documentation. With JavaDoc, since the documentation is generated from the &lt;br /&gt;
 source code, the documentation will still be relevant after maintenance is performed on the &lt;br /&gt;
 code. Using code generators like JavaDoc helps to allow a single authority on a piece of &lt;br /&gt;
 knowledge within in the code to be maintained. The programmer changes the code and the &lt;br /&gt;
 change is properly documented as a result.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Let's say we are storing purchase information in a database and have a&lt;br /&gt;
 field for quatity and item and total. So, we create a database table as follows:&lt;br /&gt;
 &lt;br /&gt;
 PK Purchase_ID&lt;br /&gt;
    ItemPrice&lt;br /&gt;
    ItemQuantity    &lt;br /&gt;
    TotalPrice&lt;br /&gt;
 &lt;br /&gt;
 Since TotalPrice is actually calculated by multiplying ItemPrice by the ItemQuantity &lt;br /&gt;
 we should instead have a table that looks like the following:&lt;br /&gt;
 &lt;br /&gt;
 PK Purchase_ID&lt;br /&gt;
    ItemPrice&lt;br /&gt;
    ItemQuantity    &lt;br /&gt;
  &lt;br /&gt;
 The total price can be calculated once the data is retrieved. This allows us not &lt;br /&gt;
 to duplicate values in the database table.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
  •If you have duplicated data in your code because it has to have different&lt;br /&gt;
 representations in different places, can you write a function, tool or code&lt;br /&gt;
 generator to make one representation from the other, or all from a common source?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your documentation duplicates knowledge in your code, can you generate parts&lt;br /&gt;
 of the documentation from parts of the code, or vice-versa, or both from a common&lt;br /&gt;
 higher-level representation?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your header files and interface declarations duplicate knowledge in your&lt;br /&gt;
 implementation code, is there a way you can generate the header files and &lt;br /&gt;
 interface declarations from the code?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have metadata, tables, or constants they should be declared once an imported&lt;br /&gt;
 elsewhere. &amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have reused a section of code, a change will require finding all the sections&lt;br /&gt;
 that involved reuse.  Missing some of the changes will often cause very subtle errors.&lt;br /&gt;
&lt;br /&gt;
= DRY Principle - Always Good? =&lt;br /&gt;
Considering the increasing reuse, re-adaptation, and maintenance of code it appears as though it is rarely adventageous to ignore the DRY principle.  The only instances where it may be beneficial to ignore the DRY principals is when the cost of following the principal is greater than effort of maintaining separate copies of data.  An example would be something very small-scale that will not require any meaningful maintenance.  As mentioned earlier, code often starts in this diminutive form and then morphs into something much greater, so, again the DRY principle should be ignored with caution.&lt;br /&gt;
&lt;br /&gt;
Another example of where it might be beneficial to ignore the DRY principal is in a forum where [http://www.artima.com/intv/dry3.html &amp;quot;imposing standards aimed at strict adherence to DRY could stifle community involvement in contexts where it is highly valued, such as a Wiki.&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
As stated throughout the article, the benefits to following the DRY principle almost always outweighs the benefits of ignoring them.  It is almost impossible to create and use any significant amount of code and not have to perform maintenance on that code.  Maintenance and clarity are the main benefits derived from this principle as it helps to remove some of the human errors that can occur in updating code - especially code that is redundant.  In many cases it may take a little longer to generate initial code using the DRY principle, but the time will likely be recouped as soon as any maintenance is required.  It is enormously time consuming to find every occurrance of a piece of knowledge within a sizeable code structure if the DRY principle has not been followed.  With the principle employed, the programmer needs only to find the one relevant section and make the necessary changes.   All logical connections will automatically change predictably to accomodate and unrelated knowledge will be left intact.&lt;br /&gt;
&lt;br /&gt;
= External Links/References =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[1]Hunt, Andy and Thomas, Dave&lt;br /&gt;
Keep It DRY, SHY, and Tell the Other Guy,&lt;br /&gt;
IEEE Software, vol. 21, no. 3, pp. 101-103, May/Jun 2004&lt;br /&gt;
PMID: 9917440; UI: 99117608. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14051</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14051"/>
		<updated>2008-06-26T02:14:50Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Examples of the DRY Principle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples will be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance.&lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. The DRY coding philosophy requires that information not be duplicated.  Duplication of data makes code less explicit and requires additional steps to fully implement any change in the code.  With a single authority for a given piece of knowledge within a code structure, the programmer need only change the core authority to effect change throughout the structure.  The results of changes to coding are predictable as all the logical connections to the altered data remain in agreement.  Likewise, unrelated knowledge is left intact.&lt;br /&gt;
&lt;br /&gt;
Ultimately, the goal of the DRY principal is to make code maintenance easier.  At first glance, some projects may seem like maintenance will not be much of an issue.  The project may be very small or the parameters seem defined well enough that, once completed, the project will not need further adjustment.  In reality, it is rare that code is ever complete.  In fact it has been shown that requirements change at a rate of two percent per month[1].  Even if one were to ignore the possibility of change requirements after code is complete, one must consider the following question:  How often is a complete section of code written, never to be altered, on the first try?  The truth is that maintenance begins immediately after anyone alters anything in the existing code.  In other words, it is virtually impossible not to do maintenance.  If data or code is repeated and maintenance needs to be done it will require the programmer to make changes and substitutions everywhere in the code where the repeated data or code exists.  Programmers are people and people will make errors.  Eventually a replacement will be missed somewhere in the code.  Having a single point of truth or authority for a particular piece of data will require the programmer to correctly alter the code in only one location and he or she can be assured the changes will populate correctly throughout the rest of the related code.&lt;br /&gt;
&lt;br /&gt;
Code written following the DRY principle, given its nature, will allow for easier changes and will allow many changes to be made with decreased likelihood of error.  Errors introduced late in the development process are typically the most time-consuming and therefore the most expensive to fix.  The advantages of having followed the DRY principal increases as the development process progresses.  Late in the development process the code will be voluminous (relative to early in development) and more complex.  Adherence to the DRY principle will allieviate a significant number of coding errors that would result from the implementation of change to repeated code or data.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Another example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 One of the most common ways to implement the DRY principal is with the use of code &lt;br /&gt;
 generators. Although it is technically not generating usable code, [http://www.codegeneration.net/tiki-index.php?page=JavaDoc JavaDoc] &lt;br /&gt;
 uses the existing Java code to generate documentation for its code. If the documentation &lt;br /&gt;
 was written independently of the code then changes to the code would very likely require &lt;br /&gt;
 changes in the documentation. With JavaDoc, since the documentation is generated from the &lt;br /&gt;
 source code, the documentation will still be relevant after maintenance is performed on the &lt;br /&gt;
 code. Using code generators like JavaDoc helps to allow a single authority on a piece of &lt;br /&gt;
 knowledge within in the code to be maintained. The programmer changes the code and the &lt;br /&gt;
 change is properly documented as a result.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Let's say we are storing purchase information in a database and have a&lt;br /&gt;
 field for quatity and item and total. So, we create a database table as follows:&lt;br /&gt;
 &lt;br /&gt;
 PK Purchase_ID&lt;br /&gt;
    ItemPrice&lt;br /&gt;
    ItemQuantity    &lt;br /&gt;
    TotalPrice&lt;br /&gt;
 &lt;br /&gt;
 Since TotalPrice is actually calculated by multiplying ItemPrice by the ItemQuantity &lt;br /&gt;
 we should instead have a table that looks like the following:&lt;br /&gt;
 &lt;br /&gt;
 PK Purchase_ID&lt;br /&gt;
    ItemPrice&lt;br /&gt;
    ItemQuantity    &lt;br /&gt;
    TotalPrice&lt;br /&gt;
  &lt;br /&gt;
 The total price can be calculated once the data is retrieved. This allows us not &lt;br /&gt;
 to duplicate values in the database table.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
  •If you have duplicated data in your code because it has to have different&lt;br /&gt;
 representations in different places, can you write a function, tool or code&lt;br /&gt;
 generator to make one representation from the other, or all from a common source?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your documentation duplicates knowledge in your code, can you generate parts&lt;br /&gt;
 of the documentation from parts of the code, or vice-versa, or both from a common&lt;br /&gt;
 higher-level representation?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your header files and interface declarations duplicate knowledge in your&lt;br /&gt;
 implementation code, is there a way you can generate the header files and &lt;br /&gt;
 interface declarations from the code?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have metadata, tables, or constants they should be declared once an imported&lt;br /&gt;
 elsewhere. &amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have reused a section of code, a change will require finding all the sections&lt;br /&gt;
 that involved reuse.  Missing some of the changes will often cause very subtle errors.&lt;br /&gt;
&lt;br /&gt;
= DRY Principle - Always Good? =&lt;br /&gt;
Considering the increasing reuse, re-adaptation, and maintenance of code it appears as though it is rarely adventageous to ignore the DRY principle.  The only instances where it may be beneficial to ignore the DRY principals is when the cost of following the principal is greater than effort of maintaining separate copies of data.  An example would be something very small-scale that will not require any meaningful maintenance.  As mentioned earlier, code often starts in this diminutive form and then morphs into something much greater, so, again the DRY principle should be ignored with caution.&lt;br /&gt;
&lt;br /&gt;
Another example of where it might be beneficial to ignore the DRY principal is in a forum where [http://www.artima.com/intv/dry3.html &amp;quot;imposing standards aimed at strict adherence to DRY could stifle community involvement in contexts where it is highly valued, such as a Wiki.&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
As stated throughout the article, the benefits to following the DRY principle almost always outweighs the benefits of ignoring them.  It is almost impossible to create and use any significant amount of code and not have to perform maintenance on that code.  Maintenance and clarity are the main benefits derived from this principle as it helps to remove some of the human errors that can occur in updating code - especially code that is redundant.  In many cases it may take a little longer to generate initial code using the DRY principle, but the time will likely be recouped as soon as any maintenance is required.  It is enormously time consuming to find every occurrance of a piece of knowledge within a sizeable code structure if the DRY principle has not been followed.  With the principle employed, the programmer needs only to find the one relevant section and make the necessary changes.   All logical connections will automatically change predictably to accomodate and unrelated knowledge will be left intact.&lt;br /&gt;
&lt;br /&gt;
= External Links/References =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[1]Hunt, Andy and Thomas, Dave&lt;br /&gt;
Keep It DRY, SHY, and Tell the Other Guy,&lt;br /&gt;
IEEE Software, vol. 21, no. 3, pp. 101-103, May/Jun 2004&lt;br /&gt;
PMID: 9917440; UI: 99117608. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14049</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14049"/>
		<updated>2008-06-26T02:13:49Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Examples of the DRY Principle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples will be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance.&lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. The DRY coding philosophy requires that information not be duplicated.  Duplication of data makes code less explicit and requires additional steps to fully implement any change in the code.  With a single authority for a given piece of knowledge within a code structure, the programmer need only change the core authority to effect change throughout the structure.  The results of changes to coding are predictable as all the logical connections to the altered data remain in agreement.  Likewise, unrelated knowledge is left intact.&lt;br /&gt;
&lt;br /&gt;
Ultimately, the goal of the DRY principal is to make code maintenance easier.  At first glance, some projects may seem like maintenance will not be much of an issue.  The project may be very small or the parameters seem defined well enough that, once completed, the project will not need further adjustment.  In reality, it is rare that code is ever complete.  In fact it has been shown that requirements change at a rate of two percent per month[1].  Even if one were to ignore the possibility of change requirements after code is complete, one must consider the following question:  How often is a complete section of code written, never to be altered, on the first try?  The truth is that maintenance begins immediately after anyone alters anything in the existing code.  In other words, it is virtually impossible not to do maintenance.  If data or code is repeated and maintenance needs to be done it will require the programmer to make changes and substitutions everywhere in the code where the repeated data or code exists.  Programmers are people and people will make errors.  Eventually a replacement will be missed somewhere in the code.  Having a single point of truth or authority for a particular piece of data will require the programmer to correctly alter the code in only one location and he or she can be assured the changes will populate correctly throughout the rest of the related code.&lt;br /&gt;
&lt;br /&gt;
Code written following the DRY principle, given its nature, will allow for easier changes and will allow many changes to be made with decreased likelihood of error.  Errors introduced late in the development process are typically the most time-consuming and therefore the most expensive to fix.  The advantages of having followed the DRY principal increases as the development process progresses.  Late in the development process the code will be voluminous (relative to early in development) and more complex.  Adherence to the DRY principle will allieviate a significant number of coding errors that would result from the implementation of change to repeated code or data.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Another example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 One of the most common ways to implement the DRY principal is with the use of code generators. Although it is&amp;lt;br&amp;gt;technically not generating usable code, [http://www.codegeneration.net/tiki-index.php?page=JavaDoc JavaDoc] uses the existing Java code to generate documentation for its code. &amp;lt;br&amp;gt;If the documentation was written independently of the code then changes to the code would very likely require changes &amp;lt;br&amp;gt;in the documentation. With JavaDoc, since the documentation is generated from the source code, the documentation &amp;lt;br&amp;gt;will still be relevant after maintenance is performed on the code. Using code generators like JavaDoc helps to &amp;lt;br&amp;gt;allow a single authority on a piece of knowledge within in the code to be maintained. The programmer changes the code &amp;lt;br&amp;gt;and the change is properly documented as a result.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Let's say we are storing purchase information in a database and have a&lt;br /&gt;
 field for quatity and item and total. So, we create a database table as follows:&lt;br /&gt;
 &lt;br /&gt;
 PK Purchase_ID&lt;br /&gt;
    ItemPrice&lt;br /&gt;
    ItemQuantity    &lt;br /&gt;
    TotalPrice&lt;br /&gt;
 &lt;br /&gt;
 Since TotalPrice is actually calculated by multiplying ItemPrice by the ItemQuantity &lt;br /&gt;
 we should instead have a table that looks like the following:&lt;br /&gt;
 &lt;br /&gt;
 PK Purchase_ID&lt;br /&gt;
    ItemPrice&lt;br /&gt;
    ItemQuantity    &lt;br /&gt;
    TotalPrice&lt;br /&gt;
  &lt;br /&gt;
 The total price can be calculated once the data is retrieved. This allows us not &lt;br /&gt;
 to duplicate values in the database table.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
  •If you have duplicated data in your code because it has to have different&lt;br /&gt;
 representations in different places, can you write a function, tool or code&lt;br /&gt;
 generator to make one representation from the other, or all from a common source?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your documentation duplicates knowledge in your code, can you generate parts&lt;br /&gt;
 of the documentation from parts of the code, or vice-versa, or both from a common&lt;br /&gt;
 higher-level representation?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your header files and interface declarations duplicate knowledge in your&lt;br /&gt;
 implementation code, is there a way you can generate the header files and &lt;br /&gt;
 interface declarations from the code?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have metadata, tables, or constants they should be declared once an imported&lt;br /&gt;
 elsewhere. &amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have reused a section of code, a change will require finding all the sections&lt;br /&gt;
 that involved reuse.  Missing some of the changes will often cause very subtle errors.&lt;br /&gt;
&lt;br /&gt;
= DRY Principle - Always Good? =&lt;br /&gt;
Considering the increasing reuse, re-adaptation, and maintenance of code it appears as though it is rarely adventageous to ignore the DRY principle.  The only instances where it may be beneficial to ignore the DRY principals is when the cost of following the principal is greater than effort of maintaining separate copies of data.  An example would be something very small-scale that will not require any meaningful maintenance.  As mentioned earlier, code often starts in this diminutive form and then morphs into something much greater, so, again the DRY principle should be ignored with caution.&lt;br /&gt;
&lt;br /&gt;
Another example of where it might be beneficial to ignore the DRY principal is in a forum where [http://www.artima.com/intv/dry3.html &amp;quot;imposing standards aimed at strict adherence to DRY could stifle community involvement in contexts where it is highly valued, such as a Wiki.&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
As stated throughout the article, the benefits to following the DRY principle almost always outweighs the benefits of ignoring them.  It is almost impossible to create and use any significant amount of code and not have to perform maintenance on that code.  Maintenance and clarity are the main benefits derived from this principle as it helps to remove some of the human errors that can occur in updating code - especially code that is redundant.  In many cases it may take a little longer to generate initial code using the DRY principle, but the time will likely be recouped as soon as any maintenance is required.  It is enormously time consuming to find every occurrance of a piece of knowledge within a sizeable code structure if the DRY principle has not been followed.  With the principle employed, the programmer needs only to find the one relevant section and make the necessary changes.   All logical connections will automatically change predictably to accomodate and unrelated knowledge will be left intact.&lt;br /&gt;
&lt;br /&gt;
= External Links/References =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[1]Hunt, Andy and Thomas, Dave&lt;br /&gt;
Keep It DRY, SHY, and Tell the Other Guy,&lt;br /&gt;
IEEE Software, vol. 21, no. 3, pp. 101-103, May/Jun 2004&lt;br /&gt;
PMID: 9917440; UI: 99117608. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14048</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14048"/>
		<updated>2008-06-26T02:13:33Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Examples of the DRY Principle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples will be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance.&lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. The DRY coding philosophy requires that information not be duplicated.  Duplication of data makes code less explicit and requires additional steps to fully implement any change in the code.  With a single authority for a given piece of knowledge within a code structure, the programmer need only change the core authority to effect change throughout the structure.  The results of changes to coding are predictable as all the logical connections to the altered data remain in agreement.  Likewise, unrelated knowledge is left intact.&lt;br /&gt;
&lt;br /&gt;
Ultimately, the goal of the DRY principal is to make code maintenance easier.  At first glance, some projects may seem like maintenance will not be much of an issue.  The project may be very small or the parameters seem defined well enough that, once completed, the project will not need further adjustment.  In reality, it is rare that code is ever complete.  In fact it has been shown that requirements change at a rate of two percent per month[1].  Even if one were to ignore the possibility of change requirements after code is complete, one must consider the following question:  How often is a complete section of code written, never to be altered, on the first try?  The truth is that maintenance begins immediately after anyone alters anything in the existing code.  In other words, it is virtually impossible not to do maintenance.  If data or code is repeated and maintenance needs to be done it will require the programmer to make changes and substitutions everywhere in the code where the repeated data or code exists.  Programmers are people and people will make errors.  Eventually a replacement will be missed somewhere in the code.  Having a single point of truth or authority for a particular piece of data will require the programmer to correctly alter the code in only one location and he or she can be assured the changes will populate correctly throughout the rest of the related code.&lt;br /&gt;
&lt;br /&gt;
Code written following the DRY principle, given its nature, will allow for easier changes and will allow many changes to be made with decreased likelihood of error.  Errors introduced late in the development process are typically the most time-consuming and therefore the most expensive to fix.  The advantages of having followed the DRY principal increases as the development process progresses.  Late in the development process the code will be voluminous (relative to early in development) and more complex.  Adherence to the DRY principle will allieviate a significant number of coding errors that would result from the implementation of change to repeated code or data.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Another example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 One of the most common ways to implement the DRY principal is with the use of code generators. Although it is&amp;lt;br&amp;gt;technically not generating usable code, [http://www.codegeneration.net/tiki-index.php?page=JavaDoc JavaDoc] uses the existing Java code to generate documentation for its code. &amp;lt;br&amp;gt;If the documentation was written independently of the code then changes to the code would very likely require changes &amp;lt;br&amp;gt;in the documentation. With JavaDoc, since the documentation is generated from the source code, the documentation &amp;lt;br&amp;gt;will still be relevant after maintenance is performed on the code. Using code generators like JavaDoc helps to &amp;lt;br&amp;gt;allow a single authority on a piece of knowledge within in the code to be maintained. The programmer changes the code &amp;lt;br&amp;gt;and the change is properly documented as a result.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Let's say we are storing purchase information in a database and have a&lt;br /&gt;
 field for quatity and item and total. So, we create a database table as follows:&lt;br /&gt;
 &lt;br /&gt;
 PK Purchase_ID&lt;br /&gt;
    ItemPrice&lt;br /&gt;
    ItemQuantity    &lt;br /&gt;
    TotalPrice&lt;br /&gt;
&lt;br /&gt;
 Since TotalPrice is actually calculated by multiplying ItemPrice by the ItemQuantity &lt;br /&gt;
 we should instead have a table that looks like the following:&lt;br /&gt;
&lt;br /&gt;
 PK Purchase_ID&lt;br /&gt;
    ItemPrice&lt;br /&gt;
    ItemQuantity    &lt;br /&gt;
    TotalPrice&lt;br /&gt;
 &lt;br /&gt;
 The total price can be calculated once the data is retrieved. This allows us not &lt;br /&gt;
 to duplicate values in the database table.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
  •If you have duplicated data in your code because it has to have different&lt;br /&gt;
 representations in different places, can you write a function, tool or code&lt;br /&gt;
 generator to make one representation from the other, or all from a common source?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your documentation duplicates knowledge in your code, can you generate parts&lt;br /&gt;
 of the documentation from parts of the code, or vice-versa, or both from a common&lt;br /&gt;
 higher-level representation?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your header files and interface declarations duplicate knowledge in your&lt;br /&gt;
 implementation code, is there a way you can generate the header files and &lt;br /&gt;
 interface declarations from the code?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have metadata, tables, or constants they should be declared once an imported&lt;br /&gt;
 elsewhere. &amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have reused a section of code, a change will require finding all the sections&lt;br /&gt;
 that involved reuse.  Missing some of the changes will often cause very subtle errors.&lt;br /&gt;
&lt;br /&gt;
= DRY Principle - Always Good? =&lt;br /&gt;
Considering the increasing reuse, re-adaptation, and maintenance of code it appears as though it is rarely adventageous to ignore the DRY principle.  The only instances where it may be beneficial to ignore the DRY principals is when the cost of following the principal is greater than effort of maintaining separate copies of data.  An example would be something very small-scale that will not require any meaningful maintenance.  As mentioned earlier, code often starts in this diminutive form and then morphs into something much greater, so, again the DRY principle should be ignored with caution.&lt;br /&gt;
&lt;br /&gt;
Another example of where it might be beneficial to ignore the DRY principal is in a forum where [http://www.artima.com/intv/dry3.html &amp;quot;imposing standards aimed at strict adherence to DRY could stifle community involvement in contexts where it is highly valued, such as a Wiki.&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
As stated throughout the article, the benefits to following the DRY principle almost always outweighs the benefits of ignoring them.  It is almost impossible to create and use any significant amount of code and not have to perform maintenance on that code.  Maintenance and clarity are the main benefits derived from this principle as it helps to remove some of the human errors that can occur in updating code - especially code that is redundant.  In many cases it may take a little longer to generate initial code using the DRY principle, but the time will likely be recouped as soon as any maintenance is required.  It is enormously time consuming to find every occurrance of a piece of knowledge within a sizeable code structure if the DRY principle has not been followed.  With the principle employed, the programmer needs only to find the one relevant section and make the necessary changes.   All logical connections will automatically change predictably to accomodate and unrelated knowledge will be left intact.&lt;br /&gt;
&lt;br /&gt;
= External Links/References =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[1]Hunt, Andy and Thomas, Dave&lt;br /&gt;
Keep It DRY, SHY, and Tell the Other Guy,&lt;br /&gt;
IEEE Software, vol. 21, no. 3, pp. 101-103, May/Jun 2004&lt;br /&gt;
PMID: 9917440; UI: 99117608. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14045</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14045"/>
		<updated>2008-06-26T02:10:51Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Examples of the DRY Principle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples will be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance.&lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. The DRY coding philosophy requires that information not be duplicated.  Duplication of data makes code less explicit and requires additional steps to fully implement any change in the code.  With a single authority for a given piece of knowledge within a code structure, the programmer need only change the core authority to effect change throughout the structure.  The results of changes to coding are predictable as all the logical connections to the altered data remain in agreement.  Likewise, unrelated knowledge is left intact.&lt;br /&gt;
&lt;br /&gt;
Ultimately, the goal of the DRY principal is to make code maintenance easier.  At first glance, some projects may seem like maintenance will not be much of an issue.  The project may be very small or the parameters seem defined well enough that, once completed, the project will not need further adjustment.  In reality, it is rare that code is ever complete.  In fact it has been shown that requirements change at a rate of two percent per month[1].  Even if one were to ignore the possibility of change requirements after code is complete, one must consider the following question:  How often is a complete section of code written, never to be altered, on the first try?  The truth is that maintenance begins immediately after anyone alters anything in the existing code.  In other words, it is virtually impossible not to do maintenance.  If data or code is repeated and maintenance needs to be done it will require the programmer to make changes and substitutions everywhere in the code where the repeated data or code exists.  Programmers are people and people will make errors.  Eventually a replacement will be missed somewhere in the code.  Having a single point of truth or authority for a particular piece of data will require the programmer to correctly alter the code in only one location and he or she can be assured the changes will populate correctly throughout the rest of the related code.&lt;br /&gt;
&lt;br /&gt;
Code written following the DRY principle, given its nature, will allow for easier changes and will allow many changes to be made with decreased likelihood of error.  Errors introduced late in the development process are typically the most time-consuming and therefore the most expensive to fix.  The advantages of having followed the DRY principal increases as the development process progresses.  Late in the development process the code will be voluminous (relative to early in development) and more complex.  Adherence to the DRY principle will allieviate a significant number of coding errors that would result from the implementation of change to repeated code or data.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Another example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 One of the most common ways to implement the DRY principal is with the use of code generators. Although it is&amp;lt;br&amp;gt;technically not generating usable code, [http://www.codegeneration.net/tiki-index.php?page=JavaDoc JavaDoc] uses the existing Java code to generate documentation for its code. &amp;lt;br&amp;gt;If the documentation was written independently of the code then changes to the code would very likely require changes &amp;lt;br&amp;gt;in the documentation. With JavaDoc, since the documentation is generated from the source code, the documentation &amp;lt;br&amp;gt;will still be relevant after maintenance is performed on the code. Using code generators like JavaDoc helps to &amp;lt;br&amp;gt;allow a single authority on a piece of knowledge within in the code to be maintained. The programmer changes the code &amp;lt;br&amp;gt;and the change is properly documented as a result.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Let's say we are storing purchase information in a database and have a&lt;br /&gt;
 field for quatity and item and total. So, we create a database table as follows:&lt;br /&gt;
 &lt;br /&gt;
 PK Purchase_ID&lt;br /&gt;
    Item_ID&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
  •If you have duplicated data in your code because it has to have different&lt;br /&gt;
 representations in different places, can you write a function, tool or code&lt;br /&gt;
 generator to make one representation from the other, or all from a common source?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your documentation duplicates knowledge in your code, can you generate parts&lt;br /&gt;
 of the documentation from parts of the code, or vice-versa, or both from a common&lt;br /&gt;
 higher-level representation?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your header files and interface declarations duplicate knowledge in your&lt;br /&gt;
 implementation code, is there a way you can generate the header files and &lt;br /&gt;
 interface declarations from the code?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have metadata, tables, or constants they should be declared once an imported&lt;br /&gt;
 elsewhere. &amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have reused a section of code, a change will require finding all the sections&lt;br /&gt;
 that involved reuse.  Missing some of the changes will often cause very subtle errors.&lt;br /&gt;
&lt;br /&gt;
= DRY Principle - Always Good? =&lt;br /&gt;
Considering the increasing reuse, re-adaptation, and maintenance of code it appears as though it is rarely adventageous to ignore the DRY principle.  The only instances where it may be beneficial to ignore the DRY principals is when the cost of following the principal is greater than effort of maintaining separate copies of data.  An example would be something very small-scale that will not require any meaningful maintenance.  As mentioned earlier, code often starts in this diminutive form and then morphs into something much greater, so, again the DRY principle should be ignored with caution.&lt;br /&gt;
&lt;br /&gt;
Another example of where it might be beneficial to ignore the DRY principal is in a forum where [http://www.artima.com/intv/dry3.html &amp;quot;imposing standards aimed at strict adherence to DRY could stifle community involvement in contexts where it is highly valued, such as a Wiki.&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
As stated throughout the article, the benefits to following the DRY principle almost always outweighs the benefits of ignoring them.  It is almost impossible to create and use any significant amount of code and not have to perform maintenance on that code.  Maintenance and clarity are the main benefits derived from this principle as it helps to remove some of the human errors that can occur in updating code - especially code that is redundant.  In many cases it may take a little longer to generate initial code using the DRY principle, but the time will likely be recouped as soon as any maintenance is required.  It is enormously time consuming to find every occurrance of a piece of knowledge within a sizeable code structure if the DRY principle has not been followed.  With the principle employed, the programmer needs only to find the one relevant section and make the necessary changes.   All logical connections will automatically change predictably to accomodate and unrelated knowledge will be left intact.&lt;br /&gt;
&lt;br /&gt;
= External Links/References =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[1]Hunt, Andy and Thomas, Dave&lt;br /&gt;
Keep It DRY, SHY, and Tell the Other Guy,&lt;br /&gt;
IEEE Software, vol. 21, no. 3, pp. 101-103, May/Jun 2004&lt;br /&gt;
PMID: 9917440; UI: 99117608. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14044</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14044"/>
		<updated>2008-06-26T02:10:35Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Examples of the DRY Principle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples will be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance.&lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. The DRY coding philosophy requires that information not be duplicated.  Duplication of data makes code less explicit and requires additional steps to fully implement any change in the code.  With a single authority for a given piece of knowledge within a code structure, the programmer need only change the core authority to effect change throughout the structure.  The results of changes to coding are predictable as all the logical connections to the altered data remain in agreement.  Likewise, unrelated knowledge is left intact.&lt;br /&gt;
&lt;br /&gt;
Ultimately, the goal of the DRY principal is to make code maintenance easier.  At first glance, some projects may seem like maintenance will not be much of an issue.  The project may be very small or the parameters seem defined well enough that, once completed, the project will not need further adjustment.  In reality, it is rare that code is ever complete.  In fact it has been shown that requirements change at a rate of two percent per month[1].  Even if one were to ignore the possibility of change requirements after code is complete, one must consider the following question:  How often is a complete section of code written, never to be altered, on the first try?  The truth is that maintenance begins immediately after anyone alters anything in the existing code.  In other words, it is virtually impossible not to do maintenance.  If data or code is repeated and maintenance needs to be done it will require the programmer to make changes and substitutions everywhere in the code where the repeated data or code exists.  Programmers are people and people will make errors.  Eventually a replacement will be missed somewhere in the code.  Having a single point of truth or authority for a particular piece of data will require the programmer to correctly alter the code in only one location and he or she can be assured the changes will populate correctly throughout the rest of the related code.&lt;br /&gt;
&lt;br /&gt;
Code written following the DRY principle, given its nature, will allow for easier changes and will allow many changes to be made with decreased likelihood of error.  Errors introduced late in the development process are typically the most time-consuming and therefore the most expensive to fix.  The advantages of having followed the DRY principal increases as the development process progresses.  Late in the development process the code will be voluminous (relative to early in development) and more complex.  Adherence to the DRY principle will allieviate a significant number of coding errors that would result from the implementation of change to repeated code or data.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Another example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 One of the most common ways to implement the DRY principal is with the use of code generators. Although it is&amp;lt;br&amp;gt;technically not generating usable code, [http://www.codegeneration.net/tiki-index.php?page=JavaDoc JavaDoc] uses the existing Java code to generate documentation for its code. &amp;lt;br&amp;gt;If the documentation was written independently of the code then changes to the code would very likely require changes &amp;lt;br&amp;gt;in the documentation. With JavaDoc, since the documentation is generated from the source code, the documentation &amp;lt;br&amp;gt;will still be relevant after maintenance is performed on the code. Using code generators like JavaDoc helps to &amp;lt;br&amp;gt;allow a single authority on a piece of knowledge within in the code to be maintained. The programmer changes the code &amp;lt;br&amp;gt;and the change is properly documented as a result.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Let's say we are storing purchase information in a database and have a&lt;br /&gt;
 field for quatity and item and total. So, we create a database table as follows:&lt;br /&gt;
&lt;br /&gt;
 PK Purchase_ID&lt;br /&gt;
    Item_ID&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
  •If you have duplicated data in your code because it has to have different&lt;br /&gt;
 representations in different places, can you write a function, tool or code&lt;br /&gt;
 generator to make one representation from the other, or all from a common source?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your documentation duplicates knowledge in your code, can you generate parts&lt;br /&gt;
 of the documentation from parts of the code, or vice-versa, or both from a common&lt;br /&gt;
 higher-level representation?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your header files and interface declarations duplicate knowledge in your&lt;br /&gt;
 implementation code, is there a way you can generate the header files and &lt;br /&gt;
 interface declarations from the code?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have metadata, tables, or constants they should be declared once an imported&lt;br /&gt;
 elsewhere. &amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have reused a section of code, a change will require finding all the sections&lt;br /&gt;
 that involved reuse.  Missing some of the changes will often cause very subtle errors.&lt;br /&gt;
&lt;br /&gt;
= DRY Principle - Always Good? =&lt;br /&gt;
Considering the increasing reuse, re-adaptation, and maintenance of code it appears as though it is rarely adventageous to ignore the DRY principle.  The only instances where it may be beneficial to ignore the DRY principals is when the cost of following the principal is greater than effort of maintaining separate copies of data.  An example would be something very small-scale that will not require any meaningful maintenance.  As mentioned earlier, code often starts in this diminutive form and then morphs into something much greater, so, again the DRY principle should be ignored with caution.&lt;br /&gt;
&lt;br /&gt;
Another example of where it might be beneficial to ignore the DRY principal is in a forum where [http://www.artima.com/intv/dry3.html &amp;quot;imposing standards aimed at strict adherence to DRY could stifle community involvement in contexts where it is highly valued, such as a Wiki.&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
As stated throughout the article, the benefits to following the DRY principle almost always outweighs the benefits of ignoring them.  It is almost impossible to create and use any significant amount of code and not have to perform maintenance on that code.  Maintenance and clarity are the main benefits derived from this principle as it helps to remove some of the human errors that can occur in updating code - especially code that is redundant.  In many cases it may take a little longer to generate initial code using the DRY principle, but the time will likely be recouped as soon as any maintenance is required.  It is enormously time consuming to find every occurrance of a piece of knowledge within a sizeable code structure if the DRY principle has not been followed.  With the principle employed, the programmer needs only to find the one relevant section and make the necessary changes.   All logical connections will automatically change predictably to accomodate and unrelated knowledge will be left intact.&lt;br /&gt;
&lt;br /&gt;
= External Links/References =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[1]Hunt, Andy and Thomas, Dave&lt;br /&gt;
Keep It DRY, SHY, and Tell the Other Guy,&lt;br /&gt;
IEEE Software, vol. 21, no. 3, pp. 101-103, May/Jun 2004&lt;br /&gt;
PMID: 9917440; UI: 99117608. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14043</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14043"/>
		<updated>2008-06-26T02:10:16Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Examples of the DRY Principle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples will be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance.&lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. The DRY coding philosophy requires that information not be duplicated.  Duplication of data makes code less explicit and requires additional steps to fully implement any change in the code.  With a single authority for a given piece of knowledge within a code structure, the programmer need only change the core authority to effect change throughout the structure.  The results of changes to coding are predictable as all the logical connections to the altered data remain in agreement.  Likewise, unrelated knowledge is left intact.&lt;br /&gt;
&lt;br /&gt;
Ultimately, the goal of the DRY principal is to make code maintenance easier.  At first glance, some projects may seem like maintenance will not be much of an issue.  The project may be very small or the parameters seem defined well enough that, once completed, the project will not need further adjustment.  In reality, it is rare that code is ever complete.  In fact it has been shown that requirements change at a rate of two percent per month[1].  Even if one were to ignore the possibility of change requirements after code is complete, one must consider the following question:  How often is a complete section of code written, never to be altered, on the first try?  The truth is that maintenance begins immediately after anyone alters anything in the existing code.  In other words, it is virtually impossible not to do maintenance.  If data or code is repeated and maintenance needs to be done it will require the programmer to make changes and substitutions everywhere in the code where the repeated data or code exists.  Programmers are people and people will make errors.  Eventually a replacement will be missed somewhere in the code.  Having a single point of truth or authority for a particular piece of data will require the programmer to correctly alter the code in only one location and he or she can be assured the changes will populate correctly throughout the rest of the related code.&lt;br /&gt;
&lt;br /&gt;
Code written following the DRY principle, given its nature, will allow for easier changes and will allow many changes to be made with decreased likelihood of error.  Errors introduced late in the development process are typically the most time-consuming and therefore the most expensive to fix.  The advantages of having followed the DRY principal increases as the development process progresses.  Late in the development process the code will be voluminous (relative to early in development) and more complex.  Adherence to the DRY principle will allieviate a significant number of coding errors that would result from the implementation of change to repeated code or data.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Another example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 One of the most common ways to implement the DRY principal is with the use of code generators. Although it is&amp;lt;br&amp;gt;technically not generating usable code, [http://www.codegeneration.net/tiki-index.php?page=JavaDoc JavaDoc] uses the existing Java code to generate documentation for its code. &amp;lt;br&amp;gt;If the documentation was written independently of the code then changes to the code would very likely require changes &amp;lt;br&amp;gt;in the documentation. With JavaDoc, since the documentation is generated from the source code, the documentation &amp;lt;br&amp;gt;will still be relevant after maintenance is performed on the code. Using code generators like JavaDoc helps to &amp;lt;br&amp;gt;allow a single authority on a piece of knowledge within in the code to be maintained. The programmer changes the code &amp;lt;br&amp;gt;and the change is properly documented as a result.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let's say we are storing purchase information in a database and have a&lt;br /&gt;
field for quatity and item and total. So, we create a database table as follows:&lt;br /&gt;
&lt;br /&gt;
 PK Purchase_ID&lt;br /&gt;
    Item_ID&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
  •If you have duplicated data in your code because it has to have different&lt;br /&gt;
 representations in different places, can you write a function, tool or code&lt;br /&gt;
 generator to make one representation from the other, or all from a common source?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your documentation duplicates knowledge in your code, can you generate parts&lt;br /&gt;
 of the documentation from parts of the code, or vice-versa, or both from a common&lt;br /&gt;
 higher-level representation?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your header files and interface declarations duplicate knowledge in your&lt;br /&gt;
 implementation code, is there a way you can generate the header files and &lt;br /&gt;
 interface declarations from the code?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have metadata, tables, or constants they should be declared once an imported&lt;br /&gt;
 elsewhere. &amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have reused a section of code, a change will require finding all the sections&lt;br /&gt;
 that involved reuse.  Missing some of the changes will often cause very subtle errors.&lt;br /&gt;
&lt;br /&gt;
= DRY Principle - Always Good? =&lt;br /&gt;
Considering the increasing reuse, re-adaptation, and maintenance of code it appears as though it is rarely adventageous to ignore the DRY principle.  The only instances where it may be beneficial to ignore the DRY principals is when the cost of following the principal is greater than effort of maintaining separate copies of data.  An example would be something very small-scale that will not require any meaningful maintenance.  As mentioned earlier, code often starts in this diminutive form and then morphs into something much greater, so, again the DRY principle should be ignored with caution.&lt;br /&gt;
&lt;br /&gt;
Another example of where it might be beneficial to ignore the DRY principal is in a forum where [http://www.artima.com/intv/dry3.html &amp;quot;imposing standards aimed at strict adherence to DRY could stifle community involvement in contexts where it is highly valued, such as a Wiki.&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
As stated throughout the article, the benefits to following the DRY principle almost always outweighs the benefits of ignoring them.  It is almost impossible to create and use any significant amount of code and not have to perform maintenance on that code.  Maintenance and clarity are the main benefits derived from this principle as it helps to remove some of the human errors that can occur in updating code - especially code that is redundant.  In many cases it may take a little longer to generate initial code using the DRY principle, but the time will likely be recouped as soon as any maintenance is required.  It is enormously time consuming to find every occurrance of a piece of knowledge within a sizeable code structure if the DRY principle has not been followed.  With the principle employed, the programmer needs only to find the one relevant section and make the necessary changes.   All logical connections will automatically change predictably to accomodate and unrelated knowledge will be left intact.&lt;br /&gt;
&lt;br /&gt;
= External Links/References =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[1]Hunt, Andy and Thomas, Dave&lt;br /&gt;
Keep It DRY, SHY, and Tell the Other Guy,&lt;br /&gt;
IEEE Software, vol. 21, no. 3, pp. 101-103, May/Jun 2004&lt;br /&gt;
PMID: 9917440; UI: 99117608. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14041</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=14041"/>
		<updated>2008-06-26T02:09:03Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Examples of the DRY Principle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples will be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance.&lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. The DRY coding philosophy requires that information not be duplicated.  Duplication of data makes code less explicit and requires additional steps to fully implement any change in the code.  With a single authority for a given piece of knowledge within a code structure, the programmer need only change the core authority to effect change throughout the structure.  The results of changes to coding are predictable as all the logical connections to the altered data remain in agreement.  Likewise, unrelated knowledge is left intact.&lt;br /&gt;
&lt;br /&gt;
Ultimately, the goal of the DRY principal is to make code maintenance easier.  At first glance, some projects may seem like maintenance will not be much of an issue.  The project may be very small or the parameters seem defined well enough that, once completed, the project will not need further adjustment.  In reality, it is rare that code is ever complete.  In fact it has been shown that requirements change at a rate of two percent per month[1].  Even if one were to ignore the possibility of change requirements after code is complete, one must consider the following question:  How often is a complete section of code written, never to be altered, on the first try?  The truth is that maintenance begins immediately after anyone alters anything in the existing code.  In other words, it is virtually impossible not to do maintenance.  If data or code is repeated and maintenance needs to be done it will require the programmer to make changes and substitutions everywhere in the code where the repeated data or code exists.  Programmers are people and people will make errors.  Eventually a replacement will be missed somewhere in the code.  Having a single point of truth or authority for a particular piece of data will require the programmer to correctly alter the code in only one location and he or she can be assured the changes will populate correctly throughout the rest of the related code.&lt;br /&gt;
&lt;br /&gt;
Code written following the DRY principle, given its nature, will allow for easier changes and will allow many changes to be made with decreased likelihood of error.  Errors introduced late in the development process are typically the most time-consuming and therefore the most expensive to fix.  The advantages of having followed the DRY principal increases as the development process progresses.  Late in the development process the code will be voluminous (relative to early in development) and more complex.  Adherence to the DRY principle will allieviate a significant number of coding errors that would result from the implementation of change to repeated code or data.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Another example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 One of the most common ways to implement the DRY principal is with the use of code generators. Although it is&amp;lt;br&amp;gt;technically not generating usable code, [http://www.codegeneration.net/tiki-index.php?page=JavaDoc JavaDoc] uses the existing Java code to generate documentation for its code. &amp;lt;br&amp;gt;If the documentation was written independently of the code then changes to the code would very likely require changes &amp;lt;br&amp;gt;in the documentation. With JavaDoc, since the documentation is generated from the source code, the documentation &amp;lt;br&amp;gt;will still be relevant after maintenance is performed on the code. Using code generators like JavaDoc helps to &amp;lt;br&amp;gt;allow a single authority on a piece of knowledge within in the code to be maintained. The programmer changes the code &amp;lt;br&amp;gt;and the change is properly documented as a result.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Let's say we are storing purchase information in a database and have a &amp;lt;br&amp;gt;&lt;br /&gt;
 field for quatity and item and total.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
  •If you have duplicated data in your code because it has to have different&lt;br /&gt;
 representations in different places, can you write a function, tool or code&lt;br /&gt;
 generator to make one representation from the other, or all from a common source?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your documentation duplicates knowledge in your code, can you generate parts&lt;br /&gt;
 of the documentation from parts of the code, or vice-versa, or both from a common&lt;br /&gt;
 higher-level representation?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your header files and interface declarations duplicate knowledge in your&lt;br /&gt;
 implementation code, is there a way you can generate the header files and &lt;br /&gt;
 interface declarations from the code?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have metadata, tables, or constants they should be declared once an imported&lt;br /&gt;
 elsewhere. &amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have reused a section of code, a change will require finding all the sections&lt;br /&gt;
 that involved reuse.  Missing some of the changes will often cause very subtle errors.&lt;br /&gt;
&lt;br /&gt;
= DRY Principle - Always Good? =&lt;br /&gt;
Considering the increasing reuse, re-adaptation, and maintenance of code it appears as though it is rarely adventageous to ignore the DRY principle.  The only instances where it may be beneficial to ignore the DRY principals is when the cost of following the principal is greater than effort of maintaining separate copies of data.  An example would be something very small-scale that will not require any meaningful maintenance.  As mentioned earlier, code often starts in this diminutive form and then morphs into something much greater, so, again the DRY principle should be ignored with caution.&lt;br /&gt;
&lt;br /&gt;
Another example of where it might be beneficial to ignore the DRY principal is in a forum where [http://www.artima.com/intv/dry3.html &amp;quot;imposing standards aimed at strict adherence to DRY could stifle community involvement in contexts where it is highly valued, such as a Wiki.&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
As stated throughout the article, the benefits to following the DRY principle almost always outweighs the benefits of ignoring them.  It is almost impossible to create and use any significant amount of code and not have to perform maintenance on that code.  Maintenance and clarity are the main benefits derived from this principle as it helps to remove some of the human errors that can occur in updating code - especially code that is redundant.  In many cases it may take a little longer to generate initial code using the DRY principle, but the time will likely be recouped as soon as any maintenance is required.  It is enormously time consuming to find every occurrance of a piece of knowledge within a sizeable code structure if the DRY principle has not been followed.  With the principle employed, the programmer needs only to find the one relevant section and make the necessary changes.   All logical connections will automatically change predictably to accomodate and unrelated knowledge will be left intact.&lt;br /&gt;
&lt;br /&gt;
= External Links/References =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[1]Hunt, Andy and Thomas, Dave&lt;br /&gt;
Keep It DRY, SHY, and Tell the Other Guy,&lt;br /&gt;
IEEE Software, vol. 21, no. 3, pp. 101-103, May/Jun 2004&lt;br /&gt;
PMID: 9917440; UI: 99117608. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13984</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13984"/>
		<updated>2008-06-26T01:25:44Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Examples of the DRY Principle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples will be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance.&lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. The DRY coding philosophy requires that information not be duplicated.  Duplication of data makes code less explicit and requires additional steps to fully implement any change in the code.  With a single authority for a given piece of knowledge within a code structure, the programmer need only change the core authority to effect change throughout the structure.  The results of changes to coding are predictable as all the logical connections to the altered data remain in agreement.  Likewise, unrelated knowledge is left intact.&lt;br /&gt;
&lt;br /&gt;
Ultimately, the goal of the DRY principal is to make code maintenance easier.  At first glance, some projects may seem like maintenance will not be much of an issue.  The project may be very small or the parameters seem defined well enough that, once completed, the project will not need further adjustment.  In reality, it is rare that code is ever complete.  In fact it has been shown that requirements change at a rate of two percent per month[1].  Even if one were to ignore the possibility of change requirements after code is complete, one must consider the following question:  How often is a complete section of code written, never to be altered, on the first try?  The truth is that maintenance begins immediately after anyone alters anything in the existing code.  In other words, it is virtually impossible not to do maintenance.  If data or code is repeated and maintenance needs to be done it will require the programmer to make changes and substitutions everywhere in the code where the repeated data or code exists.  Programmers are people and people will make errors.  Eventually a replacement will be missed somewhere in the code.  Having a single point of truth or authority for a particular piece of data will require the programmer to correctly alter the code in only one location and he or she can be assured the changes will populate correctly throughout the rest of the related code.&lt;br /&gt;
&lt;br /&gt;
Code written following the DRY principle, given its nature, will allow for easier changes and will allow many changes to be made with decreased likelihood of error.  Errors introduced late in the development process are typically the most time-consuming and therefore the most expensive to fix.  The advantages of having followed the DRY principal increases as the development process progresses.  Late in the development process the code will be voluminous (relative to early in development) and more complex.  Adherence to the DRY principle will allieviate a significant number of coding errors that would result from the implementation of change to repeated code or data.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Another example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 One of the most common ways to implement the DRY principal is with the use of code generators. Although it is&amp;lt;br&amp;gt;technically not generating usable code, [http://www.codegeneration.net/tiki-index.php?page=JavaDoc JavaDoc] uses the existing Java code to generate documentation for its code. &amp;lt;br&amp;gt;If the documentation was written independently of the code then changes to the code would very likely require changes &amp;lt;br&amp;gt;in the documentation. With JavaDoc, since the documentation is generated from the source code, the documentation &amp;lt;br&amp;gt;will still be relevant after maintenance is performed on the code. Using code generators like JavaDoc helps to &amp;lt;br&amp;gt;allow a single authority on a piece of knowledge within in the code to be maintained. The programmer changes the code &amp;lt;br&amp;gt;and the change is properly documented as a result.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
  •If you have duplicated data in your code because it has to have different&lt;br /&gt;
 representations in different places, can you write a function, tool or code&lt;br /&gt;
 generator to make one representation from the other, or all from a common source?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your documentation duplicates knowledge in your code, can you generate parts&lt;br /&gt;
 of the documentation from parts of the code, or vice-versa, or both from a common&lt;br /&gt;
 higher-level representation?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your header files and interface declarations duplicate knowledge in your&lt;br /&gt;
 implementation code, is there a way you can generate the header files and &lt;br /&gt;
 interface declarations from the code?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have metadata, tables, or constants they should be declared once an imported&lt;br /&gt;
 elsewhere. &amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have reused a section of code, a change will require finding all the sections&lt;br /&gt;
 that involved reuse.  Missing some of the changes will often cause very subtle errors.&lt;br /&gt;
&lt;br /&gt;
= DRY Principle - Always Good? =&lt;br /&gt;
Considering the increasing reuse, re-adaptation, and maintenance of code it appears as though it is rarely adventageous to ignore the DRY principle.  The only instances where it may be beneficial to ignore the DRY principals is when the cost of following the principal is greater than effort of maintaining separate copies of data.  An example would be something very small-scale that will not require any meaningful maintenance.  As mentioned earlier, code often starts in this diminutive form and then morphs into something much greater, so, again the DRY principle should be ignored with caution.&lt;br /&gt;
&lt;br /&gt;
Another example of where it might be beneficial to ignore the DRY principal is in a forum where [http://www.artima.com/intv/dry3.html &amp;quot;imposing standards aimed at strict adherence to DRY could stifle community involvement in contexts where it is highly valued, such as a Wiki.&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
As stated throughout the article, the benefits to following the DRY principle almost always outweighs the benefits of ignoring them.  It is almost impossible to create and use any significant amount of code and not have to perform maintenance on that code.  Maintenance and clarity are the main benefits derived from this principle as it helps to remove some of the human errors that can occur in updating code - especially code that is redundant.  In many cases it may take a little longer to generate initial code using the DRY principle, but the time will likely be recouped as soon as any maintenance is required.  It is enormously time consuming to find every occurrance of a piece of knowledge within a sizeable code structure if the DRY principle has not been followed.  With the principle employed, the programmer needs only to find the one relevant section and make the necessary changes.   All logical connections will automatically change predictably to accomodate and unrelated knowledge will be left intact.&lt;br /&gt;
&lt;br /&gt;
= External Links/References =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[1]Hunt, Andy and Thomas, Dave&lt;br /&gt;
Keep It DRY, SHY, and Tell the Other Guy,&lt;br /&gt;
IEEE Software, vol. 21, no. 3, pp. 101-103, May/Jun 2004&lt;br /&gt;
PMID: 9917440; UI: 99117608. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13983</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13983"/>
		<updated>2008-06-26T01:25:35Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Examples of the DRY Principle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples will be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance.&lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. The DRY coding philosophy requires that information not be duplicated.  Duplication of data makes code less explicit and requires additional steps to fully implement any change in the code.  With a single authority for a given piece of knowledge within a code structure, the programmer need only change the core authority to effect change throughout the structure.  The results of changes to coding are predictable as all the logical connections to the altered data remain in agreement.  Likewise, unrelated knowledge is left intact.&lt;br /&gt;
&lt;br /&gt;
Ultimately, the goal of the DRY principal is to make code maintenance easier.  At first glance, some projects may seem like maintenance will not be much of an issue.  The project may be very small or the parameters seem defined well enough that, once completed, the project will not need further adjustment.  In reality, it is rare that code is ever complete.  In fact it has been shown that requirements change at a rate of two percent per month[1].  Even if one were to ignore the possibility of change requirements after code is complete, one must consider the following question:  How often is a complete section of code written, never to be altered, on the first try?  The truth is that maintenance begins immediately after anyone alters anything in the existing code.  In other words, it is virtually impossible not to do maintenance.  If data or code is repeated and maintenance needs to be done it will require the programmer to make changes and substitutions everywhere in the code where the repeated data or code exists.  Programmers are people and people will make errors.  Eventually a replacement will be missed somewhere in the code.  Having a single point of truth or authority for a particular piece of data will require the programmer to correctly alter the code in only one location and he or she can be assured the changes will populate correctly throughout the rest of the related code.&lt;br /&gt;
&lt;br /&gt;
Code written following the DRY principle, given its nature, will allow for easier changes and will allow many changes to be made with decreased likelihood of error.  Errors introduced late in the development process are typically the most time-consuming and therefore the most expensive to fix.  The advantages of having followed the DRY principal increases as the development process progresses.  Late in the development process the code will be voluminous (relative to early in development) and more complex.  Adherence to the DRY principle will allieviate a significant number of coding errors that would result from the implementation of change to repeated code or data.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Another example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One of the most common ways to implement the DRY principal is with the use of code generators. Although it is&amp;lt;br&amp;gt;technically not generating usable code, [http://www.codegeneration.net/tiki-index.php?page=JavaDoc JavaDoc] uses the existing Java code to generate documentation for its code. &amp;lt;br&amp;gt;If the documentation was written independently of the code then changes to the code would very likely require changes &amp;lt;br&amp;gt;in the documentation. With JavaDoc, since the documentation is generated from the source code, the documentation &amp;lt;br&amp;gt;will still be relevant after maintenance is performed on the code. Using code generators like JavaDoc helps to &amp;lt;br&amp;gt;allow a single authority on a piece of knowledge within in the code to be maintained. The programmer changes the code &amp;lt;br&amp;gt;and the change is properly documented as a result.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
  •If you have duplicated data in your code because it has to have different&lt;br /&gt;
 representations in different places, can you write a function, tool or code&lt;br /&gt;
 generator to make one representation from the other, or all from a common source?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your documentation duplicates knowledge in your code, can you generate parts&lt;br /&gt;
 of the documentation from parts of the code, or vice-versa, or both from a common&lt;br /&gt;
 higher-level representation?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your header files and interface declarations duplicate knowledge in your&lt;br /&gt;
 implementation code, is there a way you can generate the header files and &lt;br /&gt;
 interface declarations from the code?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have metadata, tables, or constants they should be declared once an imported&lt;br /&gt;
 elsewhere. &amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have reused a section of code, a change will require finding all the sections&lt;br /&gt;
 that involved reuse.  Missing some of the changes will often cause very subtle errors.&lt;br /&gt;
&lt;br /&gt;
= DRY Principle - Always Good? =&lt;br /&gt;
Considering the increasing reuse, re-adaptation, and maintenance of code it appears as though it is rarely adventageous to ignore the DRY principle.  The only instances where it may be beneficial to ignore the DRY principals is when the cost of following the principal is greater than effort of maintaining separate copies of data.  An example would be something very small-scale that will not require any meaningful maintenance.  As mentioned earlier, code often starts in this diminutive form and then morphs into something much greater, so, again the DRY principle should be ignored with caution.&lt;br /&gt;
&lt;br /&gt;
Another example of where it might be beneficial to ignore the DRY principal is in a forum where [http://www.artima.com/intv/dry3.html &amp;quot;imposing standards aimed at strict adherence to DRY could stifle community involvement in contexts where it is highly valued, such as a Wiki.&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
As stated throughout the article, the benefits to following the DRY principle almost always outweighs the benefits of ignoring them.  It is almost impossible to create and use any significant amount of code and not have to perform maintenance on that code.  Maintenance and clarity are the main benefits derived from this principle as it helps to remove some of the human errors that can occur in updating code - especially code that is redundant.  In many cases it may take a little longer to generate initial code using the DRY principle, but the time will likely be recouped as soon as any maintenance is required.  It is enormously time consuming to find every occurrance of a piece of knowledge within a sizeable code structure if the DRY principle has not been followed.  With the principle employed, the programmer needs only to find the one relevant section and make the necessary changes.   All logical connections will automatically change predictably to accomodate and unrelated knowledge will be left intact.&lt;br /&gt;
&lt;br /&gt;
= External Links/References =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[1]Hunt, Andy and Thomas, Dave&lt;br /&gt;
Keep It DRY, SHY, and Tell the Other Guy,&lt;br /&gt;
IEEE Software, vol. 21, no. 3, pp. 101-103, May/Jun 2004&lt;br /&gt;
PMID: 9917440; UI: 99117608. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13978</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13978"/>
		<updated>2008-06-26T01:23:32Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Examples of the DRY Principle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples will be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance.&lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. The DRY coding philosophy requires that information not be duplicated.  Duplication of data makes code less explicit and requires additional steps to fully implement any change in the code.  With a single authority for a given piece of knowledge within a code structure, the programmer need only change the core authority to effect change throughout the structure.  The results of changes to coding are predictable as all the logical connections to the altered data remain in agreement.  Likewise, unrelated knowledge is left intact.&lt;br /&gt;
&lt;br /&gt;
Ultimately, the goal of the DRY principal is to make code maintenance easier.  At first glance, some projects may seem like maintenance will not be much of an issue.  The project may be very small or the parameters seem defined well enough that, once completed, the project will not need further adjustment.  In reality, it is rare that code is ever complete.  In fact it has been shown that requirements change at a rate of two percent per month[1].  Even if one were to ignore the possibility of change requirements after code is complete, one must consider the following question:  How often is a complete section of code written, never to be altered, on the first try?  The truth is that maintenance begins immediately after anyone alters anything in the existing code.  In other words, it is virtually impossible not to do maintenance.  If data or code is repeated and maintenance needs to be done it will require the programmer to make changes and substitutions everywhere in the code where the repeated data or code exists.  Programmers are people and people will make errors.  Eventually a replacement will be missed somewhere in the code.  Having a single point of truth or authority for a particular piece of data will require the programmer to correctly alter the code in only one location and he or she can be assured the changes will populate correctly throughout the rest of the related code.&lt;br /&gt;
&lt;br /&gt;
Code written following the DRY principle, given its nature, will allow for easier changes and will allow many changes to be made with decreased likelihood of error.  Errors introduced late in the development process are typically the most time-consuming and therefore the most expensive to fix.  The advantages of having followed the DRY principal increases as the development process progresses.  Late in the development process the code will be voluminous (relative to early in development) and more complex.  Adherence to the DRY principle will allieviate a significant number of coding errors that would result from the implementation of change to repeated code or data.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Another example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 One of the most common ways to implement the DRY principal is with the use of code&amp;lt;br&amp;gt; &lt;br /&gt;
generators.  Although it is technically not generating usable code, [http://www.codegeneration.net/tiki-index.php?page=JavaDoc JavaDoc] uses the existing&amp;lt;br&amp;gt; &lt;br /&gt;
Java code to generate documentation for its code. If the documentation was written&amp;lt;br&amp;gt;&lt;br /&gt;
independently of the code then changes to the code would very likely require changes&amp;lt;br&amp;gt;&lt;br /&gt;
in the documentation.  With JavaDoc, since the documentation is generated from the&amp;lt;br&amp;gt;&lt;br /&gt;
source code, the documentation will still be relevant after maintenance is performed&amp;lt;br&amp;gt; on the code.  Using code generators like JavaDoc helps to allow a single authority on a piece of knowledge within in the code to be maintained.  The programmer changes the code and the change is properly documented as a result.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
  •If you have duplicated data in your code because it has to have different&lt;br /&gt;
 representations in different places, can you write a function, tool or code&lt;br /&gt;
 generator to make one representation from the other, or all from a common source?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your documentation duplicates knowledge in your code, can you generate parts&lt;br /&gt;
 of the documentation from parts of the code, or vice-versa, or both from a common&lt;br /&gt;
 higher-level representation?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your header files and interface declarations duplicate knowledge in your&lt;br /&gt;
 implementation code, is there a way you can generate the header files and &lt;br /&gt;
 interface declarations from the code?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have metadata, tables, or constants they should be declared once an imported&lt;br /&gt;
 elsewhere. &amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have reused a section of code, a change will require finding all the sections&lt;br /&gt;
 that involved reuse.  Missing some of the changes will often cause very subtle errors.&lt;br /&gt;
&lt;br /&gt;
= DRY Principle - Always Good? =&lt;br /&gt;
Considering the increasing reuse, re-adaptation, and maintenance of code it appears as though it is rarely adventageous to ignore the DRY principle.  The only instances where it may be beneficial to ignore the DRY principals is when the cost of following the principal is greater than effort of maintaining separate copies of data.  An example would be something very small-scale that will not require any meaningful maintenance.  As mentioned earlier, code often starts in this diminutive form and then morphs into something much greater, so, again the DRY principle should be ignored with caution.&lt;br /&gt;
&lt;br /&gt;
Another example of where it might be beneficial to ignore the DRY principal is in a forum where [http://www.artima.com/intv/dry3.html &amp;quot;imposing standards aimed at strict adherence to DRY could stifle community involvement in contexts where it is highly valued, such as a Wiki.&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
As stated throughout the article, the benefits to following the DRY principle almost always outweighs the benefits of ignoring them.  It is almost impossible to create and use any significant amount of code and not have to perform maintenance on that code.  Maintenance and clarity are the main benefits derived from this principle as it helps to remove some of the human errors that can occur in updating code - especially code that is redundant.  In many cases it may take a little longer to generate initial code using the DRY principle, but the time will likely be recouped as soon as any maintenance is required.  It is enormously time consuming to find every occurrance of a piece of knowledge within a sizeable code structure if the DRY principle has not been followed.  With the principle employed, the programmer needs only to find the one relevant section and make the necessary changes.   All logical connections will automatically change predictably to accomodate and unrelated knowledge will be left intact.&lt;br /&gt;
&lt;br /&gt;
= External Links/References =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[1]Hunt, Andy and Thomas, Dave&lt;br /&gt;
Keep It DRY, SHY, and Tell the Other Guy,&lt;br /&gt;
IEEE Software, vol. 21, no. 3, pp. 101-103, May/Jun 2004&lt;br /&gt;
PMID: 9917440; UI: 99117608. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13976</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13976"/>
		<updated>2008-06-26T01:22:40Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Examples of the DRY Principle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples will be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance.&lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. The DRY coding philosophy requires that information not be duplicated.  Duplication of data makes code less explicit and requires additional steps to fully implement any change in the code.  With a single authority for a given piece of knowledge within a code structure, the programmer need only change the core authority to effect change throughout the structure.  The results of changes to coding are predictable as all the logical connections to the altered data remain in agreement.  Likewise, unrelated knowledge is left intact.&lt;br /&gt;
&lt;br /&gt;
Ultimately, the goal of the DRY principal is to make code maintenance easier.  At first glance, some projects may seem like maintenance will not be much of an issue.  The project may be very small or the parameters seem defined well enough that, once completed, the project will not need further adjustment.  In reality, it is rare that code is ever complete.  In fact it has been shown that requirements change at a rate of two percent per month[1].  Even if one were to ignore the possibility of change requirements after code is complete, one must consider the following question:  How often is a complete section of code written, never to be altered, on the first try?  The truth is that maintenance begins immediately after anyone alters anything in the existing code.  In other words, it is virtually impossible not to do maintenance.  If data or code is repeated and maintenance needs to be done it will require the programmer to make changes and substitutions everywhere in the code where the repeated data or code exists.  Programmers are people and people will make errors.  Eventually a replacement will be missed somewhere in the code.  Having a single point of truth or authority for a particular piece of data will require the programmer to correctly alter the code in only one location and he or she can be assured the changes will populate correctly throughout the rest of the related code.&lt;br /&gt;
&lt;br /&gt;
Code written following the DRY principle, given its nature, will allow for easier changes and will allow many changes to be made with decreased likelihood of error.  Errors introduced late in the development process are typically the most time-consuming and therefore the most expensive to fix.  The advantages of having followed the DRY principal increases as the development process progresses.  Late in the development process the code will be voluminous (relative to early in development) and more complex.  Adherence to the DRY principle will allieviate a significant number of coding errors that would result from the implementation of change to repeated code or data.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Another example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 One of the most common ways to implement the DRY principal is with the use of code generators.  Although it is technically not generating usable code, [http://www.codegeneration.net/tiki-index.php?page=JavaDoc JavaDoc] uses the existing Java code to generate documentation for its code. If the documentation was written independently of the code then changes to the code would very likely require changes in the documentation.  With JavaDoc, since the documentation is generated from the source code, the documentation will still be relevant after maintenance is performed on the code.  Using code generators like JavaDoc helps to allow a single authority on a piece of knowledge within in the code to be maintained.  The programmer changes the code and the change is properly documented as a result.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
  •If you have duplicated data in your code because it has to have different&lt;br /&gt;
 representations in different places, can you write a function, tool or code&lt;br /&gt;
 generator to make one representation from the other, or all from a common source?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your documentation duplicates knowledge in your code, can you generate parts&lt;br /&gt;
 of the documentation from parts of the code, or vice-versa, or both from a common&lt;br /&gt;
 higher-level representation?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your header files and interface declarations duplicate knowledge in your&lt;br /&gt;
 implementation code, is there a way you can generate the header files and &lt;br /&gt;
 interface declarations from the code?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have metadata, tables, or constants they should be declared once an imported&lt;br /&gt;
 elsewhere. &amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have reused a section of code, a change will require finding all the sections&lt;br /&gt;
 that involved reuse.  Missing some of the changes will often cause very subtle errors.&lt;br /&gt;
&lt;br /&gt;
= DRY Principle - Always Good? =&lt;br /&gt;
Considering the increasing reuse, re-adaptation, and maintenance of code it appears as though it is rarely adventageous to ignore the DRY principle.  The only instances where it may be beneficial to ignore the DRY principals is when the cost of following the principal is greater than effort of maintaining separate copies of data.  An example would be something very small-scale that will not require any meaningful maintenance.  As mentioned earlier, code often starts in this diminutive form and then morphs into something much greater, so, again the DRY principle should be ignored with caution.&lt;br /&gt;
&lt;br /&gt;
Another example of where it might be beneficial to ignore the DRY principal is in a forum where [http://www.artima.com/intv/dry3.html &amp;quot;imposing standards aimed at strict adherence to DRY could stifle community involvement in contexts where it is highly valued, such as a Wiki.&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
As stated throughout the article, the benefits to following the DRY principle almost always outweighs the benefits of ignoring them.  It is almost impossible to create and use any significant amount of code and not have to perform maintenance on that code.  Maintenance and clarity are the main benefits derived from this principle as it helps to remove some of the human errors that can occur in updating code - especially code that is redundant.  In many cases it may take a little longer to generate initial code using the DRY principle, but the time will likely be recouped as soon as any maintenance is required.  It is enormously time consuming to find every occurrance of a piece of knowledge within a sizeable code structure if the DRY principle has not been followed.  With the principle employed, the programmer needs only to find the one relevant section and make the necessary changes.   All logical connections will automatically change predictably to accomodate and unrelated knowledge will be left intact.&lt;br /&gt;
&lt;br /&gt;
= External Links/References =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[1]Hunt, Andy and Thomas, Dave&lt;br /&gt;
Keep It DRY, SHY, and Tell the Other Guy,&lt;br /&gt;
IEEE Software, vol. 21, no. 3, pp. 101-103, May/Jun 2004&lt;br /&gt;
PMID: 9917440; UI: 99117608. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13975</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13975"/>
		<updated>2008-06-26T01:21:57Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Examples of the DRY Principle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples will be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance.&lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. The DRY coding philosophy requires that information not be duplicated.  Duplication of data makes code less explicit and requires additional steps to fully implement any change in the code.  With a single authority for a given piece of knowledge within a code structure, the programmer need only change the core authority to effect change throughout the structure.  The results of changes to coding are predictable as all the logical connections to the altered data remain in agreement.  Likewise, unrelated knowledge is left intact.&lt;br /&gt;
&lt;br /&gt;
Ultimately, the goal of the DRY principal is to make code maintenance easier.  At first glance, some projects may seem like maintenance will not be much of an issue.  The project may be very small or the parameters seem defined well enough that, once completed, the project will not need further adjustment.  In reality, it is rare that code is ever complete.  In fact it has been shown that requirements change at a rate of two percent per month[1].  Even if one were to ignore the possibility of change requirements after code is complete, one must consider the following question:  How often is a complete section of code written, never to be altered, on the first try?  The truth is that maintenance begins immediately after anyone alters anything in the existing code.  In other words, it is virtually impossible not to do maintenance.  If data or code is repeated and maintenance needs to be done it will require the programmer to make changes and substitutions everywhere in the code where the repeated data or code exists.  Programmers are people and people will make errors.  Eventually a replacement will be missed somewhere in the code.  Having a single point of truth or authority for a particular piece of data will require the programmer to correctly alter the code in only one location and he or she can be assured the changes will populate correctly throughout the rest of the related code.&lt;br /&gt;
&lt;br /&gt;
Code written following the DRY principle, given its nature, will allow for easier changes and will allow many changes to be made with decreased likelihood of error.  Errors introduced late in the development process are typically the most time-consuming and therefore the most expensive to fix.  The advantages of having followed the DRY principal increases as the development process progresses.  Late in the development process the code will be voluminous (relative to early in development) and more complex.  Adherence to the DRY principle will allieviate a significant number of coding errors that would result from the implementation of change to repeated code or data.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Another example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 One of the most common ways to implement the DRY principal is with the use of code generators.  Although it is&amp;lt;br&amp;gt;technically not generating usable code, [http://www.codegeneration.net/tiki-index.php?page=JavaDoc JavaDoc] uses the existing Java code to generate documentation for its code. &amp;lt;br&amp;gt;If the documentation was written independently of the code then changes to the code would very likely require changes &amp;lt;br&amp;gt;in the documentation.  With JavaDoc, since the documentation is generated from the source code, the documentation &amp;lt;br&amp;gt;will still be relevant after maintenance is performed on the code.  Using code generators like JavaDoc helps to &amp;lt;br&amp;gt;allow a single authority on a piece of knowledge within in the code to be maintained.  The programmer changes the code &amp;lt;br&amp;gt;and the change is properly documented as a result.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
  •If you have duplicated data in your code because it has to have different&lt;br /&gt;
 representations in different places, can you write a function, tool or code&lt;br /&gt;
 generator to make one representation from the other, or all from a common source?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your documentation duplicates knowledge in your code, can you generate parts&lt;br /&gt;
 of the documentation from parts of the code, or vice-versa, or both from a common&lt;br /&gt;
 higher-level representation?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your header files and interface declarations duplicate knowledge in your&lt;br /&gt;
 implementation code, is there a way you can generate the header files and &lt;br /&gt;
 interface declarations from the code?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have metadata, tables, or constants they should be declared once an imported&lt;br /&gt;
 elsewhere. &amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have reused a section of code, a change will require finding all the sections&lt;br /&gt;
 that involved reuse.  Missing some of the changes will often cause very subtle errors.&lt;br /&gt;
&lt;br /&gt;
= DRY Principle - Always Good? =&lt;br /&gt;
Considering the increasing reuse, re-adaptation, and maintenance of code it appears as though it is rarely adventageous to ignore the DRY principle.  The only instances where it may be beneficial to ignore the DRY principals is when the cost of following the principal is greater than effort of maintaining separate copies of data.  An example would be something very small-scale that will not require any meaningful maintenance.  As mentioned earlier, code often starts in this diminutive form and then morphs into something much greater, so, again the DRY principle should be ignored with caution.&lt;br /&gt;
&lt;br /&gt;
Another example of where it might be beneficial to ignore the DRY principal is in a forum where [http://www.artima.com/intv/dry3.html &amp;quot;imposing standards aimed at strict adherence to DRY could stifle community involvement in contexts where it is highly valued, such as a Wiki.&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
As stated throughout the article, the benefits to following the DRY principle almost always outweighs the benefits of ignoring them.  It is almost impossible to create and use any significant amount of code and not have to perform maintenance on that code.  Maintenance and clarity are the main benefits derived from this principle as it helps to remove some of the human errors that can occur in updating code - especially code that is redundant.  In many cases it may take a little longer to generate initial code using the DRY principle, but the time will likely be recouped as soon as any maintenance is required.  It is enormously time consuming to find every occurrance of a piece of knowledge within a sizeable code structure if the DRY principle has not been followed.  With the principle employed, the programmer needs only to find the one relevant section and make the necessary changes.   All logical connections will automatically change predictably to accomodate and unrelated knowledge will be left intact.&lt;br /&gt;
&lt;br /&gt;
= External Links/References =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[1]Hunt, Andy and Thomas, Dave&lt;br /&gt;
Keep It DRY, SHY, and Tell the Other Guy,&lt;br /&gt;
IEEE Software, vol. 21, no. 3, pp. 101-103, May/Jun 2004&lt;br /&gt;
PMID: 9917440; UI: 99117608. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13961</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13961"/>
		<updated>2008-06-26T01:03:48Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Examples of the DRY Principle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples will be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance.&lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. The DRY coding philosophy requires that information not be duplicated.  Duplication of data makes code less explicit and requires additional steps to fully implement any change in the code.  With a single authority for a given piece of knowledge within a code structure, the programmer need only change the core authority to effect change throughout the structure.  The results of changes to coding are predictable as all the logical connections to the altered data remain in agreement.  Likewise, unrelated knowledge is left intact.&lt;br /&gt;
&lt;br /&gt;
Ultimately, the goal of the DRY principal is to make code maintenance easier.  At first glance, some projects may seem like maintenance will not be much of an issue.  The project may be very small or the parameters seem defined well enough that, once completed, the project will not need further adjustment.  In reality, it is rare that code is ever complete.  In fact it has been shown that requirements change at a rate of two percent per month[1].  Even if one were to ignore the possibility of change requirements after code is complete, one must consider the following question:  How often is a complete section of code written, never to be altered, on the first try?  The truth is that maintenance begins immediately after anyone alters anything in the existing code.  In other words, it is virtually impossible not to do maintenance.  If data or code is repeated and maintenance needs to be done it will require the programmer to make changes and substitutions everywhere in the code where the repeated data or code exists.  Programmers are people and people will make errors.  Eventually a replacement will be missed somewhere in the code.  Having a single point of truth or authority for a particular piece of data will require the programmer to correctly alter the code in only one location and he or she can be assured the changes will populate correctly throughout the rest of the related code.&lt;br /&gt;
&lt;br /&gt;
Code written following the DRY principle, given its nature, will allow for easier changes and will allow many changes to be made with decreased likelihood of error.  Errors introduced late in the development process are typically the most time-consuming and therefore the most expensive to fix.  The advantages of having followed the DRY principal increases as the development process progresses.  Late in the development process the code will be voluminous (relative to early in development) and more complex.  Adherence to the DRY principle will allieviate a significant number of coding errors that would result from the implementation of change to repeated code or data.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Another example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One of the most common ways to implement the DRY principal is with the use of code generators.  Although it is&amp;lt;br&amp;gt;technically not generating usable code, [http://www.codegeneration.net/tiki-index.php?page=JavaDoc JavaDoc] uses the existing Java code to generate documentation for its code. &amp;lt;br&amp;gt;If the documentation was written independently of the code then changes to the code would very likely require changes &amp;lt;br&amp;gt;in the documentation.  With JavaDoc, since the documentation is generated from the source code, the documentation &amp;lt;br&amp;gt;will still be relevant after maintenance is performed on the code.  Using code generators like JavaDoc helps to &amp;lt;br&amp;gt;allow a single authority on a piece of knowledge within in the code to be maintained.  The programmer changes the code &amp;lt;br&amp;gt;and the change is properly documented as a result.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
  •If you have duplicated data in your code because it has to have different&lt;br /&gt;
 representations in different places, can you write a function, tool or code&lt;br /&gt;
 generator to make one representation from the other, or all from a common source?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your documentation duplicates knowledge in your code, can you generate parts&lt;br /&gt;
 of the documentation from parts of the code, or vice-versa, or both from a common&lt;br /&gt;
 higher-level representation?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If your header files and interface declarations duplicate knowledge in your&lt;br /&gt;
 implementation code, is there a way you can generate the header files and &lt;br /&gt;
 interface declarations from the code?&amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have metadata, tables, or constants they should be declared once an imported&lt;br /&gt;
 elsewhere. &amp;lt;BR&amp;gt;&lt;br /&gt;
  •If you have reused a section of code, a change will require finding all the sections&lt;br /&gt;
 that involved reuse.  Missing some of the changes will often cause very subtle errors.&lt;br /&gt;
&lt;br /&gt;
= DRY Principle - Always Good? =&lt;br /&gt;
Considering the increasing reuse, re-adaptation, and maintenance of code it appears as though it is rarely adventageous to ignore the DRY principle.  The only instances where it may be beneficial to ignore the DRY principals is when the cost of following the principal is greater than effort of maintaining separate copies of data.  An example would be something very small-scale that will not require any meaningful maintenance.  As mentioned earlier, code often starts in this diminutive form and then morphs into something much greater, so, again the DRY principle should be ignored with caution.&lt;br /&gt;
&lt;br /&gt;
Another example of where it might be beneficial to ignore the DRY principal is in a forum where [http://www.artima.com/intv/dry3.html &amp;quot;imposing standards aimed at strict adherence to DRY could stifle community involvement in contexts where it is highly valued, such as a Wiki.&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
As stated throughout the article, the benefits to following the DRY principle almost always outweighs the benefits of ignoring them.  It is almost impossible to create and use any significant amount of code and not have to perform maintenance on that code.  Maintenance and clarity are the main benefits derived from this principle as it helps to remove some of the human errors that can occur in updating code - especially code that is redundant.  In many cases it may take a little longer to generate initial code using the DRY principle, but the time will likely be recouped as soon as any maintenance is required.  It is enormously time consuming to find every occurrance of a piece of knowledge within a sizeable code structure if the DRY principle has not been followed.  With the principle employed, the programmer needs only to find the one relevant section and make the necessary changes.   All logical connections will automatically change predictably to accomodate and unrelated knowledge will be left intact.&lt;br /&gt;
&lt;br /&gt;
= External Links/References =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[1]Hunt, Andy and Thomas, Dave&lt;br /&gt;
Keep It DRY, SHY, and Tell the Other Guy,&lt;br /&gt;
IEEE Software, vol. 21, no. 3, pp. 101-103, May/Jun 2004&lt;br /&gt;
PMID: 9917440; UI: 99117608. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13703</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13703"/>
		<updated>2008-06-25T04:23:02Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* What is the DRY Principle? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples whill be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance. &lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY philosophy is stated as every piece of knowledge must have a single, unambiguous, authoritative representation within a system.  The DRY Principle means you should ensure that every bit of knowledge of your system, be it in the source code, its documentation or any other documentation, should have a single representation.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. This process is aimed at simplifying the maintenance of code.     The philosophy emphasizes that information should not be duplicated, because duplication increases the difficulty of change, may decrease clarity, and leads to opportunities for inconsistency.&lt;br /&gt;
When the DRY principle is applied successfully, a modification of any single element of a system does not change other logically-unrelated elements. Additionally, elements that are logically related all change predictably and uniformly, and are thus kept in sync.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
= External Links =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13700</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13700"/>
		<updated>2008-06-25T04:14:48Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Programmer Checklist for the DRY Principle? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples whill be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance. &lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY code philosophy is stated as every piece of knowledge must have a single, &lt;br /&gt;
unambiguous, authoritative representation within a system.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. This process is aimed at simplifying the maintenance of code.     The philosophy emphasizes that information should not be duplicated, because duplication increases the difficulty of change, may decrease clarity, and leads to opportunities for inconsistency.&lt;br /&gt;
When the DRY principle is applied successfully, a modification of any single element of a system does not change other logically-unrelated elements. Additionally, elements that are logically related all change predictably and uniformly, and are thus kept in sync.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
= External Links =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13698</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13698"/>
		<updated>2008-06-25T04:14:33Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* External Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples whill be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance. &lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY code philosophy is stated as every piece of knowledge must have a single, &lt;br /&gt;
unambiguous, authoritative representation within a system.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. This process is aimed at simplifying the maintenance of code.     The philosophy emphasizes that information should not be duplicated, because duplication increases the difficulty of change, may decrease clarity, and leads to opportunities for inconsistency.&lt;br /&gt;
When the DRY principle is applied successfully, a modification of any single element of a system does not change other logically-unrelated elements. Additionally, elements that are logically related all change predictably and uniformly, and are thus kept in sync.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle? =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= External Links =&lt;br /&gt;
&lt;br /&gt;
* http://www.pragprog.com/titles/tpp/the-pragmatic-programmer&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13694</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13694"/>
		<updated>2008-06-25T04:04:10Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* External Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples whill be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance. &lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY code philosophy is stated as every piece of knowledge must have a single, &lt;br /&gt;
unambiguous, authoritative representation within a system.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. This process is aimed at simplifying the maintenance of code.     The philosophy emphasizes that information should not be duplicated, because duplication increases the difficulty of change, may decrease clarity, and leads to opportunities for inconsistency.&lt;br /&gt;
When the DRY principle is applied successfully, a modification of any single element of a system does not change other logically-unrelated elements. Additionally, elements that are logically related all change predictably and uniformly, and are thus kept in sync.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle? =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= External Links =&lt;br /&gt;
&lt;br /&gt;
* http://pragmaticprogrammers.com/&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13689</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 5 31</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_5_31&amp;diff=13689"/>
		<updated>2008-06-25T03:48:21Z</updated>

		<summary type="html">&lt;p&gt;Cadedam: /* Examples of the DRY Principle? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRY Principle =&lt;br /&gt;
The [http://en.wikipedia.org/wiki/DRY_code Don't Repeat Yourself (DRY)] principle is basic to writing maintainable code. The purpose of this Wiki is to find Web sites that explain the importance of the principle by writing prose that summarizes their arguments. Examples whill be provided of where the principle should be applied. A checklist will be created for programmers to consider in determining whether their code is in conformance. &lt;br /&gt;
&lt;br /&gt;
= What is the DRY Principle? =&lt;br /&gt;
The DRY code philosophy is stated as every piece of knowledge must have a single, &lt;br /&gt;
unambiguous, authoritative representation within a system.&lt;br /&gt;
&lt;br /&gt;
= The Importance of the DRY Principle? =&lt;br /&gt;
DRY, is also known as Single Point of Truth. This process is aimed at simplifying the maintenance of code.     The philosophy emphasizes that information should not be duplicated, because duplication increases the difficulty of change, may decrease clarity, and leads to opportunities for inconsistency.&lt;br /&gt;
When the DRY principle is applied successfully, a modification of any single element of a system does not change other logically-unrelated elements. Additionally, elements that are logically related all change predictably and uniformly, and are thus kept in sync.&lt;br /&gt;
&lt;br /&gt;
= Examples of the DRY Principle =&lt;br /&gt;
&lt;br /&gt;
Inadvertently, you may introduce duplication into your model without realizing that you are doing so. Suppose you have a class that represents a line as follows:&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Although this may appear to be a reasonable class for defining a line but we have duplication. If for example we store the start and end points and then the length we will have a problem if one of the points changes. The length will be incorrect. It would be much better to have the length be calculated from the existing start and end points.&lt;br /&gt;
&lt;br /&gt;
  class line {&lt;br /&gt;
     public:&lt;br /&gt;
      Point start;&lt;br /&gt;
      Point end;&lt;br /&gt;
      double length() { return start.distanceTo(end); }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Now we are not duplicating any information in our class and are following the principle of Don't Repeat Yourself.&lt;br /&gt;
&lt;br /&gt;
= Programmer Checklist for the DRY Principle? =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= External Links =&lt;br /&gt;
&lt;br /&gt;
* http://www.catb.org/esr/writings/taoup/html/ch04s02.html&lt;br /&gt;
* http://www.artima.com/intv/dry3.html&lt;br /&gt;
* http://blogs.msdn.com/steverowe/archive/2008/05/15/design-principle-don-t-repeat-yourself.aspx&lt;br /&gt;
* http://en.wikipedia.org/wiki/Don't_repeat_yourself&lt;br /&gt;
* http://en.wikipedia.org/wiki/DRY_code&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]]&lt;/div&gt;</summary>
		<author><name>Cadedam</name></author>
	</entry>
</feed>