<?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=Ncsueng</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=Ncsueng"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Ncsueng"/>
	<updated>2026-05-07T08:54:26Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29953</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29953"/>
		<updated>2009-11-24T02:25:36Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''DRY principle - Data''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself - Introduction'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync.&lt;br /&gt;
&lt;br /&gt;
This article briefly explains how the DRY principle not only applies to code but also to data.  It further describes how in some situations, violating the DRY principle is accepted for gains in areas where would not be possible without some way of duplicating information.  In such situations, it is extremely important for the original source of information to be known.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one way to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Violation of the DRY principle&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, however, the principle also applies to data.  Data can be created, passed around, copied and destroyed, and in general, data should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
 * Stale Data - if data is duplicated, it needs to remain in sync with the source or it will become stale and no longer valid&lt;br /&gt;
 * Overhead - in order for data not to become stale, it needs to be updated whenever the original source is also updated.  This could increase the processing in order to maintain the data in sync&lt;br /&gt;
 * Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
&lt;br /&gt;
==='''Scenarios where DRY principle is violated'''===&lt;br /&gt;
&lt;br /&gt;
There are certain scenarios, however, where duplication might not only be acceptable but also desirable.  However, in order to avoid the reasons just mentioned, certain rules should be followed.&lt;br /&gt;
&lt;br /&gt;
===='''Source Version Control'''====&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Version_control Source version control] is a management control tool that tracks different versions of data.  It is usually used in software development teams where several people might be making change to the same file.  It allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production.  Two such tools for management control that directly violate the DRY principle are [http://en.wikipedia.org/wiki/Subversion_(software) SVN] and [http://en.wikipedia.org/wiki/Concurrent_Versions_System CVS].&lt;br /&gt;
&lt;br /&gt;
This is direct violation of the DRY principle since at any given time, there could be copies of the same file in different branches allowing developers to work concurrently in different areas of the code without affection one another.  Developers can even work on different versions independently and merge them together at a later time.&lt;br /&gt;
&lt;br /&gt;
===='''Caching'''====&lt;br /&gt;
[http://en.wikipedia.org/wiki/Caching Caching] of data is the duplication of data that has been retrieved from a certain location, or calculated at an earlier time.  It is used when the time or processing power would be expensive to retrieve/calculate the data again.  Caching has proved to be useful in numerous applications including caching large amount of data transferred on the network, or caching data inside the processors that have been retrieved from memory.&lt;br /&gt;
&lt;br /&gt;
This violates the DRY principle by copying data locally in order to achieve faster processing than would normally be possible by having to fetch the same data across the network or another slower location.&lt;br /&gt;
&lt;br /&gt;
===='''Documentation'''====&lt;br /&gt;
Documentation can be automatically pulled and generated from code, which would essentially duplicate code and comments to create the document.  This is a useful technique since an updated documentation can be directly retrieved and created from the modified code without requiring individual to manually modify the doc.  This actually ensures that the document is up-to-date based on the latest code.&lt;br /&gt;
&lt;br /&gt;
This example of violation of the DRY Principle allows the developers to spent less time updating documentation every time the code is changed by allowing the documentation to be directly retrieved from the source code.  This is in direct violation of the DRY principle as the same data/code now appears in two different locations.&lt;br /&gt;
&lt;br /&gt;
==='''How to determine when to duplicate data'''===&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]  The duplication of data should only be considered when it will save time or resources or both.  Furthermore, the authoritative source of the data is well known.  In short, you should only consider data duplication if:&lt;br /&gt;
&lt;br /&gt;
* It could potentially simplify the system without needing up-to-date or precise information, as in calculating a result at one point in time, where it might not be important to perform the same calculation at a different time with updated information.&lt;br /&gt;
* It will increase the system performance without greatly decreasing maintainability.&lt;br /&gt;
* There is benefit of being to access different versions of the code in time, or sharing between different developers so that the code throughput is increased, as in the case of source control tools.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
Ideally, code and data should not be duplicated making maintainability and synchronization of information easy.  However, this document has described several scenarios where violating the DRY principle with regards to the duplication of data is acceptable.  In all examples provided, duplicating data significantly saved network bandwidth, computing processing, or human time.  Also, in all of the examples, only a single source of data was the authoritative source.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
1. [http://en.wikipedia.org/wiki/DRY The DRY Principle]&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;br /&gt;
&lt;br /&gt;
=='''Further Readings'''==&lt;br /&gt;
&lt;br /&gt;
1. [http://www.stat.auckland.ac.nz/~paul/ItDT/HTML/node23.html applying the DRY principle to writing computer code]&lt;br /&gt;
&lt;br /&gt;
2. [http://reinholdweber.com/css/refactoring-your-css-styles-to-comply-with-the-dry-principle/ Refactoring to comply with the DRY Principle]&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29932</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29932"/>
		<updated>2009-11-24T01:30:24Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''DRY principle - Data''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself - Introduction'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync.&lt;br /&gt;
&lt;br /&gt;
This article briefly explains how the DRY principle not only applies to code but also to data.  It further describes how in some situations, violating the DRY principle is accepted for gains in areas where would not be possible without some way of duplicating information.  In such situations, it is extremely important for the original source of information to be known.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one way to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Violation of the DRY principle&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, however, the principle also applies to data.  Data can be created, passed around, copied and destroyed, and in general, data should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
 * Stale Data - if data is duplicated, it needs to remain in sync with the source or it will become stale and no longer valid&lt;br /&gt;
 * More overhead - in order for data not to become stale, it needs to be updated whenever the original source is also updated.  This could increase the processing in order to maintain the data in sync&lt;br /&gt;
 * Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
&lt;br /&gt;
==='''Scenarios where DRY principle is violated'''===&lt;br /&gt;
&lt;br /&gt;
There are certain scenarios, however, where duplication might not only be acceptable, but at times desirable.  However, in order to avoid the reasons just mentioned, certain rules should be followed.&lt;br /&gt;
&lt;br /&gt;
===='''Source Version Control'''====&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Version_control Source version control] is a management control tool that tracks different versions of data.  It is usually used in software development teams where several people might be making change to the same file.  It allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production.  Two such tools for management control that directly violate the DRY principle are [http://en.wikipedia.org/wiki/Subversion_(software) SVN] and [http://en.wikipedia.org/wiki/Concurrent_Versions_System CVS].&lt;br /&gt;
&lt;br /&gt;
This is direct violation of the DRY principle since at any given time, there could be copies of the same file in different branches allowing developers to work concurrently in different areas of the code without affection one another.  Developers can even work on different versions independently and merge them together at a later time.&lt;br /&gt;
&lt;br /&gt;
===='''Caching'''====&lt;br /&gt;
[http://en.wikipedia.org/wiki/Caching Caching] of data is the duplication of data that has been retrieved from a certain location, or calculated at an earlier time.  It is used when the time or processing power would be expensive to retrieve/calculate the data again.  Caching has proved to be useful in numerous applications including caching large amount of data transferred on the network, or caching data inside the processors that have been retrieved from memory.&lt;br /&gt;
&lt;br /&gt;
This violates the DRY principle by copying data locally in order to achieve faster processing than would normally be possible by having to fetch the same data across the network or another slower location.&lt;br /&gt;
&lt;br /&gt;
===='''Documentation'''====&lt;br /&gt;
Documentation can be automatically pulled and generated from code, which would essentially duplicate code and comments to create the document.  This is a useful technique since an updated documentation can be directly retrieved and created from the modified code without requiring individual to manually modify the doc.  This actually ensures that the document is up-to-date based on the latest code.&lt;br /&gt;
&lt;br /&gt;
This example of violation of the DRY Principle allows the developers to spent less time updating documentation every time the code is changed by allowing the documentation to be directly retrieved from the source code.  This is in direct violation of the DRY principle as the same data/code now appears in two different locations.&lt;br /&gt;
&lt;br /&gt;
==='''How to determine when to duplicate data'''===&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]  The duplication of data should only be considered when it will save time or resources or both.  Furthermore, the authoritative source of the data is well known.  In short, you should only consider data duplication if:&lt;br /&gt;
&lt;br /&gt;
* It could potentially simplify the system without needing up-to-date or precise information, as in calculating a result at one point in time, where it might not be important to perform the same calculation at a different time with updated information.&lt;br /&gt;
* It will increase the system performance without greatly decreasing maintainability.&lt;br /&gt;
* There is benefit of being to access different versions of the code in time, or sharing between different developers so that the code throughput is increased, as in the case of source control tools.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
Ideally, code and data should not be duplicated making maintainability and synchronization of information easy.  However, this document has described several scenarios where violating the DRY principle with regards to the duplication of data is acceptable.  In all examples provided, duplicating data significantly saved network bandwidth, computing processing, or human time.  Also, in all of the examples, only a single source of data was the authoritative source.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
1. [http://en.wikipedia.org/wiki/DRY The DRY Principle]&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;br /&gt;
&lt;br /&gt;
=='''Further Readings'''==&lt;br /&gt;
&lt;br /&gt;
1. [http://www.stat.auckland.ac.nz/~paul/ItDT/HTML/node23.html applying the DRY principle to writing computer code]&lt;br /&gt;
&lt;br /&gt;
2. [http://reinholdweber.com/css/refactoring-your-css-styles-to-comply-with-the-dry-principle/ Refactoring to comply with the DRY Principle]&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29929</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29929"/>
		<updated>2009-11-24T01:26:57Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''How to determine when to duplicate data''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself - Introduction'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync.&lt;br /&gt;
&lt;br /&gt;
This article briefly explains how the DRY principle not only applies to code but also to data.  It further describes how in some situations, violating the DRY principle is accepted for gains in areas where would not be possible without some way of duplicating information.  In such situations, it is extremely important for the original source of information to be known.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one way to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Violation of the DRY principle&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed, and in general, data should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
 * Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
 * Out-of-date Data - data duplication usually means that you need to keep the same data in multiple locations in sync&lt;br /&gt;
&lt;br /&gt;
==='''Scenarios where DRY principle is violated'''===&lt;br /&gt;
&lt;br /&gt;
There are certain scenarios, however, where duplication might not only be acceptable, but at times desirable.  However, in order to avoid the reasons just mentioned, certain rules should be followed.&lt;br /&gt;
&lt;br /&gt;
===='''Source Version Control'''====&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Version_control Source version control] is a management control tool that tracks different versions of data.  It is usually used in software development teams where several people might be making change to the same file.  It allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production.  Two such tools for management control that directly violate the DRY principle are [http://en.wikipedia.org/wiki/Subversion_(software) SVN] and [http://en.wikipedia.org/wiki/Concurrent_Versions_System CVS].&lt;br /&gt;
&lt;br /&gt;
This is direct violation of the DRY principle since at any given time, there could be copies of the same file in different branches allowing developers to work concurrently in different areas of the code without affection one another.  Developers can even work on different versions independently and merge them together at a later time.&lt;br /&gt;
&lt;br /&gt;
===='''Caching'''====&lt;br /&gt;
[http://en.wikipedia.org/wiki/Caching Caching] of data is the duplication of data that has been retrieved from a certain location, or calculated at an earlier time.  It is used when the time or processing power would be expensive to retrieve/calculate the data again.  Caching has proved to be useful in numerous applications including caching large amount of data transferred on the network, or caching data inside the processors that have been retrieved from memory.&lt;br /&gt;
&lt;br /&gt;
This violates the DRY principle by copying data locally in order to achieve faster processing than would normally be possible by having to fetch the same data across the network or another slower location.&lt;br /&gt;
&lt;br /&gt;
===='''Documentation'''====&lt;br /&gt;
Documentation can be automatically pulled and generated from code, which would essentially duplicate code and comments to create the document.  This is a useful technique since an updated documentation can be directly retrieved and created from the modified code without requiring individual to manually modify the doc.  This actually ensures that the document is up-to-date based on the latest code.&lt;br /&gt;
&lt;br /&gt;
This example of violation of the DRY Principle allows the developers to spent less time updating documentation every time the code is changed by allowing the documentation to be directly retrieved from the source code.  This is in direct violation of the DRY principle as the same data/code now appears in two different locations.&lt;br /&gt;
&lt;br /&gt;
==='''How to determine when to duplicate data'''===&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]  The duplication of data should only be considered when it will save time or resources or both.  Furthermore, the authoritative source of the data is well known.  In short, you should only consider data duplication if:&lt;br /&gt;
&lt;br /&gt;
* It could potentially simplify the system without needing up-to-date or precise information, as in calculating a result at one point in time, where it might not be important to perform the same calculation at a different time with updated information.&lt;br /&gt;
* It will increase the system performance without greatly decreasing maintainability.&lt;br /&gt;
* There is benefit of being to access different versions of the code in time, or sharing between different developers so that the code throughput is increased, as in the case of source control tools.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
Ideally, code and data should not be duplicated making maintainability and synchronization of information easy.  However, this document has described several scenarios where violating the DRY principle with regards to the duplication of data is acceptable.  In all examples provided, duplicating data significantly saved network bandwidth, computing processing, or human time.  Also, in all of the examples, only a single source of data was the authoritative source.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
1. [http://en.wikipedia.org/wiki/DRY The DRY Principle]&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;br /&gt;
&lt;br /&gt;
=='''Further Readings'''==&lt;br /&gt;
&lt;br /&gt;
1. [http://www.stat.auckland.ac.nz/~paul/ItDT/HTML/node23.html applying the DRY principle to writing computer code]&lt;br /&gt;
&lt;br /&gt;
2. [http://reinholdweber.com/css/refactoring-your-css-styles-to-comply-with-the-dry-principle/ Refactoring to comply with the DRY Principle]&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29925</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29925"/>
		<updated>2009-11-24T01:23:40Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''How to determine when to duplicate data''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself - Introduction'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync.&lt;br /&gt;
&lt;br /&gt;
This article briefly explains how the DRY principle not only applies to code but also to data.  It further describes how in some situations, violating the DRY principle is accepted for gains in areas where would not be possible without some way of duplicating information.  In such situations, it is extremely important for the original source of information to be known.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one way to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Violation of the DRY principle&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed, and in general, data should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
 * Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
 * Out-of-date Data - data duplication usually means that you need to keep the same data in multiple locations in sync&lt;br /&gt;
&lt;br /&gt;
==='''Scenarios where DRY principle is violated'''===&lt;br /&gt;
&lt;br /&gt;
There are certain scenarios, however, where duplication might not only be acceptable, but at times desirable.  However, in order to avoid the reasons just mentioned, certain rules should be followed.&lt;br /&gt;
&lt;br /&gt;
===='''Source Version Control'''====&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Version_control Source version control] is a management control tool that tracks different versions of data.  It is usually used in software development teams where several people might be making change to the same file.  It allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production.  Two such tools for management control that directly violate the DRY principle are [http://en.wikipedia.org/wiki/Subversion_(software) SVN] and [http://en.wikipedia.org/wiki/Concurrent_Versions_System CVS].&lt;br /&gt;
&lt;br /&gt;
This is direct violation of the DRY principle since at any given time, there could be copies of the same file in different branches allowing developers to work concurrently in different areas of the code without affection one another.  Developers can even work on different versions independently and merge them together at a later time.&lt;br /&gt;
&lt;br /&gt;
===='''Caching'''====&lt;br /&gt;
[http://en.wikipedia.org/wiki/Caching Caching] of data is the duplication of data that has been retrieved from a certain location, or calculated at an earlier time.  It is used when the time or processing power would be expensive to retrieve/calculate the data again.  Caching has proved to be useful in numerous applications including caching large amount of data transferred on the network, or caching data inside the processors that have been retrieved from memory.&lt;br /&gt;
&lt;br /&gt;
This violates the DRY principle by copying data locally in order to achieve faster processing than would normally be possible by having to fetch the same data across the network or another slower location.&lt;br /&gt;
&lt;br /&gt;
===='''Documentation'''====&lt;br /&gt;
Documentation can be automatically pulled and generated from code, which would essentially duplicate code and comments to create the document.  This is a useful technique since an updated documentation can be directly retrieved and created from the modified code without requiring individual to manually modify the doc.  This actually ensures that the document is up-to-date based on the latest code.&lt;br /&gt;
&lt;br /&gt;
This example of violation of the DRY Principle allows the developers to spent less time updating documentation every time the code is changed by allowing the documentation to be directly retrieved from the source code.  This is in direct violation of the DRY principle as the same data/code now appears in two different locations.&lt;br /&gt;
&lt;br /&gt;
==='''How to determine when to duplicate data'''===&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]  The duplication of data should only be considered when it will save time or resources or both.  Furthermore, the authoritative source of the data is well known.  In short, you should only consider data duplication&lt;br /&gt;
&lt;br /&gt;
* If doing so will increase the system performance without greatly decreasing maintainability.&lt;br /&gt;
* In the case of source control tools, if there is benefit of being to access different versions of the code in time, or sharing between different developers so that the code throughput is increased.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
Ideally, code and data should not be duplicated making maintainability and synchronization of information easy.  However, this document has described several scenarios where violating the DRY principle with regards to the duplication of data is acceptable.  In all examples provided, duplicating data significantly saved network bandwidth, computing processing, or human time.  Also, in all of the examples, only a single source of data was the authoritative source.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
1. [http://en.wikipedia.org/wiki/DRY The DRY Principle]&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;br /&gt;
&lt;br /&gt;
=='''Further Readings'''==&lt;br /&gt;
&lt;br /&gt;
1. [http://www.stat.auckland.ac.nz/~paul/ItDT/HTML/node23.html applying the DRY principle to writing computer code]&lt;br /&gt;
&lt;br /&gt;
2. [http://reinholdweber.com/css/refactoring-your-css-styles-to-comply-with-the-dry-principle/ Refactoring to comply with the DRY Principle]&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29923</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29923"/>
		<updated>2009-11-24T01:17:28Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''Source Version Control''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself - Introduction'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync.&lt;br /&gt;
&lt;br /&gt;
This article briefly explains how the DRY principle not only applies to code but also to data.  It further describes how in some situations, violating the DRY principle is accepted for gains in areas where would not be possible without some way of duplicating information.  In such situations, it is extremely important for the original source of information to be known.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one way to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Violation of the DRY principle&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed, and in general, data should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
 * Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
 * Out-of-date Data - data duplication usually means that you need to keep the same data in multiple locations in sync&lt;br /&gt;
&lt;br /&gt;
==='''Scenarios where DRY principle is violated'''===&lt;br /&gt;
&lt;br /&gt;
There are certain scenarios, however, where duplication might not only be acceptable, but at times desirable.  However, in order to avoid the reasons just mentioned, certain rules should be followed.&lt;br /&gt;
&lt;br /&gt;
===='''Source Version Control'''====&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Version_control Source version control] is a management control tool that tracks different versions of data.  It is usually used in software development teams where several people might be making change to the same file.  It allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production.  Two such tools for management control that directly violate the DRY principle are [http://en.wikipedia.org/wiki/Subversion_(software) SVN] and [http://en.wikipedia.org/wiki/Concurrent_Versions_System CVS].&lt;br /&gt;
&lt;br /&gt;
This is direct violation of the DRY principle since at any given time, there could be copies of the same file in different branches allowing developers to work concurrently in different areas of the code without affection one another.  Developers can even work on different versions independently and merge them together at a later time.&lt;br /&gt;
&lt;br /&gt;
===='''Caching'''====&lt;br /&gt;
[http://en.wikipedia.org/wiki/Caching Caching] of data is the duplication of data that has been retrieved from a certain location, or calculated at an earlier time.  It is used when the time or processing power would be expensive to retrieve/calculate the data again.  Caching has proved to be useful in numerous applications including caching large amount of data transferred on the network, or caching data inside the processors that have been retrieved from memory.&lt;br /&gt;
&lt;br /&gt;
This violates the DRY principle by copying data locally in order to achieve faster processing than would normally be possible by having to fetch the same data across the network or another slower location.&lt;br /&gt;
&lt;br /&gt;
===='''Documentation'''====&lt;br /&gt;
Documentation can be automatically pulled and generated from code, which would essentially duplicate code and comments to create the document.  This is a useful technique since an updated documentation can be directly retrieved and created from the modified code without requiring individual to manually modify the doc.  This actually ensures that the document is up-to-date based on the latest code.&lt;br /&gt;
&lt;br /&gt;
This example of violation of the DRY Principle allows the developers to spent less time updating documentation every time the code is changed by allowing the documentation to be directly retrieved from the source code.  This is in direct violation of the DRY principle as the same data/code now appears in two different locations.&lt;br /&gt;
&lt;br /&gt;
==='''How to determine when to duplicate data'''===&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]  The duplication of data should only be considered when it will save time or resources or both.  Furthermore, the authoritative source of the data is well known.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
Ideally, code and data should not be duplicated making maintainability and synchronization of information easy.  However, this document has described several scenarios where violating the DRY principle with regards to the duplication of data is acceptable.  In all examples provided, duplicating data significantly saved network bandwidth, computing processing, or human time.  Also, in all of the examples, only a single source of data was the authoritative source.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
1. [http://en.wikipedia.org/wiki/DRY The DRY Principle]&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;br /&gt;
&lt;br /&gt;
=='''Further Readings'''==&lt;br /&gt;
&lt;br /&gt;
1. [http://www.stat.auckland.ac.nz/~paul/ItDT/HTML/node23.html applying the DRY principle to writing computer code]&lt;br /&gt;
&lt;br /&gt;
2. [http://reinholdweber.com/css/refactoring-your-css-styles-to-comply-with-the-dry-principle/ Refactoring to comply with the DRY Principle]&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29896</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29896"/>
		<updated>2009-11-23T20:22:30Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself - Introduction'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync.&lt;br /&gt;
&lt;br /&gt;
This article briefly explains how the DRY principle not only applies to code but also to data.  It further describes how in some situations, violating the DRY principle is accepted for gains in areas where would not be possible without some way of duplicating information.  In such situations, it is extremely important for the original source of information to be known.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one way to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Violation of the DRY principle&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed, and in general, data should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
 * Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
 * Out-of-date Data - data duplication usually means that you need to keep the same data in multiple locations in sync&lt;br /&gt;
&lt;br /&gt;
==='''Scenarios where DRY principle is violated'''===&lt;br /&gt;
&lt;br /&gt;
There are certain scenarios, however, where duplication might not only be acceptable, but at times desirable.  However, in order to avoid the reasons just mentioned, certain rules should be followed.&lt;br /&gt;
&lt;br /&gt;
===='''Source Version Control'''====&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Version_control Source version control] is a management control tool that tracks different versions of data.  It is usually used in software development teams where several people might be making change to the same file.  It allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production.  Two such tools for management control that directly violate the DRY principle are [http://en.wikipedia.org/wiki/Subversion_(software) SVN] and [http://en.wikipedia.org/wiki/Concurrent_Versions_System CVS].&lt;br /&gt;
&lt;br /&gt;
This is direct violation of the DRY principle since at any given time, there could be copies of the same file in different branches allowing developers to work concurrently in different areas of the code without affection one another.&lt;br /&gt;
&lt;br /&gt;
===='''Caching'''====&lt;br /&gt;
[http://en.wikipedia.org/wiki/Caching Caching] of data is the duplication of data that has been retrieved from a certain location, or calculated at an earlier time.  It is used when the time or processing power would be expensive to retrieve/calculate the data again.  Caching has proved to be useful in numerous applications including caching large amount of data transferred on the network, or caching data inside the processors that have been retrieved from memory.&lt;br /&gt;
&lt;br /&gt;
This violates the DRY principle by copying data locally in order to achieve faster processing than would normally be possible by having to fetch the same data across the network or another slower location.&lt;br /&gt;
&lt;br /&gt;
===='''Documentation'''====&lt;br /&gt;
Documentation can be automatically pulled and generated from code, which would essentially duplicate code and comments to create the document.  This is a useful technique since an updated documentation can be directly retrieved and created from the modified code without requiring individual to manually modify the doc.  This actually ensures that the document is up-to-date based on the latest code.&lt;br /&gt;
&lt;br /&gt;
This example of violation of the DRY Principle allows the developers to spent less time updating documentation every time the code is changed by allowing the documentation to be directly retrieved from the source code.  This is in direct violation of the DRY principle as the same data/code now appears in two different locations.&lt;br /&gt;
&lt;br /&gt;
==='''How to determine when to duplicate data'''===&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]  The duplication of data should only be considered when it will save time or resources or both.  Furthermore, the authoritative source of the data is well known.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
Ideally, code and data should not be duplicated making maintainability and synchronization of information easy.  However, this document has described several scenarios where violating the DRY principle with regards to the duplication of data is acceptable.  In all examples provided, duplicating data significantly saved network bandwidth, computing processing, or human time.  Also, in all of the examples, only a single source of data was the authoritative source.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
1. [http://en.wikipedia.org/wiki/DRY The DRY Principle]&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;br /&gt;
&lt;br /&gt;
=='''Further Readings'''==&lt;br /&gt;
&lt;br /&gt;
1. [http://www.stat.auckland.ac.nz/~paul/ItDT/HTML/node23.html applying the DRY principle to writing computer code]&lt;br /&gt;
&lt;br /&gt;
2. [http://reinholdweber.com/css/refactoring-your-css-styles-to-comply-with-the-dry-principle/ Refactoring to comply with the DRY Principle]&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29892</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29892"/>
		<updated>2009-11-23T20:15:20Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''Source Version Control''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*This document could benefit from additional links and references that can allow the reader to go beyond the wiki material.&lt;br /&gt;
*I think the topic is fairly well covered, although you could provide some additional details on where else the DRY principle applies, like with certain design patterns.&lt;br /&gt;
*Organization could have been better.&lt;br /&gt;
*Coverage could have been more on the decision about when to use the principle and the desirable features of the principle.&lt;br /&gt;
*More examples could have been provided.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself - Introduction'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one way to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Repeated Code&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed, and in general, data should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
 * Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
 * Out-of-date Data - data duplication usually means that you need to keep the same data in multiple locations in sync&lt;br /&gt;
&lt;br /&gt;
==='''Scenarios where DRY principle is violated'''===&lt;br /&gt;
There are certain scenarios, however, where duplication might not only be acceptable, but at times desirable.  However, in order to avoid the reasons just mentioned, certain rules should be followed.&lt;br /&gt;
&lt;br /&gt;
===='''Source Version Control'''====&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Version_control Source version control] is a management control tool that tracks different versions of data.  It is usually used in software development teams where several people might be making change to the same file.  It allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production.  Two such tools for management control that directly violate the DRY principle are [http://en.wikipedia.org/wiki/Subversion_(software) SVN] and [http://en.wikipedia.org/wiki/Concurrent_Versions_System CVS].&lt;br /&gt;
&lt;br /&gt;
This is direct violation of the DRY principle since at any given time, there could be copies of the same file in different branches allowing developers to work concurrently in different areas of the code without affection one another.&lt;br /&gt;
&lt;br /&gt;
===='''Caching'''====&lt;br /&gt;
[http://en.wikipedia.org/wiki/Caching Caching] of data is the duplication of data that has been retrieved from a certain location, or calculated at an earlier time.  It is used when the time or processing power would be expensive to retrieve/calculate the data again.  Caching has proved to be useful in numerous applications including caching large amount of data transferred on the network, or caching data inside the processors that have been retrieved from memory.&lt;br /&gt;
&lt;br /&gt;
This violates the DRY principle by copying data locally in order to achieve faster processing than would normally be possible by having to fetch the same data across the network or another slower location.&lt;br /&gt;
&lt;br /&gt;
===='''Documentation'''====&lt;br /&gt;
Documentation can be automatically pulled and generated from code, which would essentially duplicate code and comments to create the document.  This is a useful technique since an updated documentation can be directly retrieved and created from the modified code without requiring individual to manually modify the doc.  This actually ensures that the document is up-to-date based on the latest code.&lt;br /&gt;
&lt;br /&gt;
This example of violation of the DRY Principle allows the developers to spent less time updating documentation every time the code is changed by allowing the documentation to be directly retrieved from the source code.  This is in direct violation of the DRY principle as the same data/code now appears in two different locations.&lt;br /&gt;
&lt;br /&gt;
==='''How to determine when to duplicate data'''===&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]  The duplication of data should only be considered when it will save time or resources or both.  Furthermore, the authoritative source of the data is well known.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
Ideally, code and data should not be duplicated making maintainability and synchronization of information easy.  However, this document has described several scenarios where violating the DRY principle with regards to the duplication of data is acceptable.  In all examples provided, duplicating data significantly saved network bandwidth, computing processing, or human time.  Also, in all of the examples, only a single source of data was the authoritative source.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;br /&gt;
&lt;br /&gt;
=='''Further Readings'''==&lt;br /&gt;
&lt;br /&gt;
1. [http://www.stat.auckland.ac.nz/~paul/ItDT/HTML/node23.html applying the DRY principle to writing computer code]&lt;br /&gt;
&lt;br /&gt;
2. [http://reinholdweber.com/css/refactoring-your-css-styles-to-comply-with-the-dry-principle/ Refactoring to comply with the DRY Principle]&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29891</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29891"/>
		<updated>2009-11-23T20:07:48Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*This document could benefit from additional links and references that can allow the reader to go beyond the wiki material.&lt;br /&gt;
*I think the topic is fairly well covered, although you could provide some additional details on where else the DRY principle applies, like with certain design patterns.&lt;br /&gt;
*Organization could have been better.&lt;br /&gt;
*Coverage could have been more on the decision about when to use the principle and the desirable features of the principle.&lt;br /&gt;
*More examples could have been provided.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself - Introduction'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one way to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Repeated Code&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed, and in general, data should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
 * Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
 * Out-of-date Data - data duplication usually means that you need to keep the same data in multiple locations in sync&lt;br /&gt;
&lt;br /&gt;
==='''Scenarios where DRY principle is violated'''===&lt;br /&gt;
There are certain scenarios, however, where duplication might not only be acceptable, but at times desirable.  However, in order to avoid the reasons just mentioned, certain rules should be followed.&lt;br /&gt;
&lt;br /&gt;
===='''Source Version Control'''====&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Version_control Source version control] is a management control tool that tracks different versions of data.  It is usually used in software development teams where several people might be making change to the same file.  It allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
&lt;br /&gt;
This is direct violation of the DRY principle since at any given time, there could be copies of the same file in different branches, allowing developers to work concurrently in different areas of the code without affection one another.&lt;br /&gt;
&lt;br /&gt;
===='''Caching'''====&lt;br /&gt;
[http://en.wikipedia.org/wiki/Caching Caching] of data is the duplication of data that has been retrieved from a certain location, or calculated at an earlier time.  It is used when the time or processing power would be expensive to retrieve/calculate the data again.  Caching has proved to be useful in numerous applications including caching large amount of data transferred on the network, or caching data inside the processors that have been retrieved from memory.&lt;br /&gt;
&lt;br /&gt;
This violates the DRY principle by copying data locally in order to achieve faster processing than would normally be possible by having to fetch the same data across the network or another slower location.&lt;br /&gt;
&lt;br /&gt;
===='''Documentation'''====&lt;br /&gt;
Documentation can be automatically pulled and generated from code, which would essentially duplicate code and comments to create the document.  This is a useful technique since an updated documentation can be directly retrieved and created from the modified code without requiring individual to manually modify the doc.  This actually ensures that the document is up-to-date based on the latest code.&lt;br /&gt;
&lt;br /&gt;
This example of violation of the DRY Principle allows the developers to spent less time updating documentation every time the code is changed by allowing the documentation to be directly retrieved from the source code.  This is in direct violation of the DRY principle as the same data/code now appears in two different locations.&lt;br /&gt;
&lt;br /&gt;
==='''How to determine when to duplicate data'''===&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]  The duplication of data should only be considered when it will save time or resources or both.  Furthermore, the authoritative source of the data is well known.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
Ideally, code and data should not be duplicated making maintainability and synchronization of information easy.  However, this document has described several scenarios where violating the DRY principle with regards to the duplication of data is acceptable.  In all examples provided, duplicating data significantly saved network bandwidth, computing processing, or human time.  Also, in all of the examples, only a single source of data was the authoritative source.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;br /&gt;
&lt;br /&gt;
=='''Further Readings'''==&lt;br /&gt;
&lt;br /&gt;
1. [http://www.stat.auckland.ac.nz/~paul/ItDT/HTML/node23.html applying the DRY principle to writing computer code]&lt;br /&gt;
&lt;br /&gt;
2. [http://reinholdweber.com/css/refactoring-your-css-styles-to-comply-with-the-dry-principle/ Refactoring to comply with the DRY Principle]&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29890</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29890"/>
		<updated>2009-11-23T20:03:19Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
*This document could benefit from additional links and references that can allow the reader to go beyond the wiki material.&lt;br /&gt;
*I think the topic is fairly well covered, although you could provide some additional details on where else the DRY principle applies, like with certain design patterns.&lt;br /&gt;
*Organization could have been better.&lt;br /&gt;
*Coverage could have been more on the decision about when to use the principle and the desirable features of the principle.&lt;br /&gt;
*More examples could have been provided.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself - Introduction'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one way to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Repeated Code&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed, and in general, data should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
 * Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
 * Out-of-date Data - data duplication usually means that you need to keep the same data in multiple locations in sync&lt;br /&gt;
&lt;br /&gt;
==='''Scenarios where DRY principle is violated'''===&lt;br /&gt;
There are certain scenarios, however, where duplication might not only be acceptable, but at times desirable.  However, in order to avoid the reasons just mentioned, certain rules should be followed.&lt;br /&gt;
&lt;br /&gt;
===='''Source Version Control'''====&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Version_control Source version control] is a management control tool that tracks different versions of data.  It is usually used in software development teams where several people might be making change to the same file.  It allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
&lt;br /&gt;
This is direct violation of the DRY principle since at any given time, there could be copies of the same file in different branches, allowing developers to work concurrently in different areas of the code without affection one another.&lt;br /&gt;
&lt;br /&gt;
===='''Caching'''====&lt;br /&gt;
[http://en.wikipedia.org/wiki/Caching Caching] of data is the duplication of data that has been retrieved from a certain location, or calculated at an earlier time.  It is used when the time or processing power would be expensive to retrieve/calculate the data again.  Caching has proved to be useful in numerous applications including caching large amount of data transferred on the network, or caching data inside the processors that have been retrieved from memory.&lt;br /&gt;
&lt;br /&gt;
This violates the DRY principle by copying data locally in order to achieve faster processing than would normally be possible by having to fetch the same data across the network or another slower location.&lt;br /&gt;
&lt;br /&gt;
===='''Documentation'''====&lt;br /&gt;
Documentation can be automatically pulled and generated from code, which would essentially duplicate code and comments to create the document.  This is a useful technique since an updated documentation can be directly retrieved and created from the modified code without requiring individual to manually modify the doc.  This actually ensures that the document is up-to-date based on the latest code.&lt;br /&gt;
&lt;br /&gt;
This example of violation of the DRY Principle allows the developers to spent less time updating documentation every time the code is changed by allowing the documentation to be directly retrieved from the source code.  This is in direct violation of the DRY principle as the same data/code now appears in two different locations.&lt;br /&gt;
&lt;br /&gt;
==='''How to determine when to duplicate data'''===&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]  The duplication of data should only be considered when it will save time or resources or both.  Furthermore, the authoritative source of the data is well known.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
Ideally, code and data should not be duplicated making maintainability and synchronization of information easy.  However, this document has described several scenarios where violating the DRY principle with regards to the duplication of data is acceptable.  In all examples provided, duplicating data significantly saved network bandwidth, computing processing, or human time.  Also, in all of the examples, only a single source of data was the authoritative source.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;br /&gt;
&lt;br /&gt;
=='''Further Readings'''==&lt;br /&gt;
&lt;br /&gt;
1. [http://www.stat.auckland.ac.nz/~paul/ItDT/HTML/node23.html applying the DRY principle to writing computer code]&lt;br /&gt;
&lt;br /&gt;
2. http://wolfbyte-net.blogspot.com/2009/01/ccd-red-degree-principle-staying-dry.html&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29882</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29882"/>
		<updated>2009-11-23T04:25:45Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*sections 4-6 could are very brief but perhaps you could explain how they relate to DRY&lt;br /&gt;
*This document could benefit from additional links and references that can allow the reader to go beyond the wiki material.&lt;br /&gt;
*I think the topic is fairly well covered, although you could provide some additional details on where else the DRY principle applies, like with certain design patterns.&lt;br /&gt;
*Organization could have been better.&lt;br /&gt;
*Coverage could have been more on the decision about when to use the principle and the desirable features of the principle.&lt;br /&gt;
*More examples could have been provided.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself - Introduction'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one way to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Repeated Code&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed, and in general, data should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
 * Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
 * Out-of-date Data - data duplication usually means that you need to keep the same data in multiple locations in sync&lt;br /&gt;
&lt;br /&gt;
==='''Scenarios where DRY principle is violated'''===&lt;br /&gt;
There are certain scenarios, however, where duplication might not only be acceptable, but at times desirable.  However, in order to avoid the reasons just mentioned, certain rules should be followed.&lt;br /&gt;
&lt;br /&gt;
===='''Source Version Control'''====&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Version_control Source version control] is a management control tool that tracks different versions of data.  It is usually used in software development teams where several people might be making change to the same file.  It allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
&lt;br /&gt;
===='''Caching'''====&lt;br /&gt;
[http://en.wikipedia.org/wiki/Caching Caching] of data is the duplication of data that has been retrieved from a certain location, or calculated at an earlier time.  It is used when the time or processing power would be expensive to retrieve/calculate the data again.  Caching has proved to be useful in numerous applications including caching large amount of data transferred on the network, or caching data inside the processors that have been retrieved from memory.&lt;br /&gt;
&lt;br /&gt;
===='''Documentation'''====&lt;br /&gt;
Documentation can be automatically pulled and generated from code, which would essentially duplicate code and comments to create the document.  This is a useful technique since an updated documentation can be directly retrieved and created from the modified code without requiring individual to manually modify the doc.  This actually ensures that the document is up-to-date based on the latest code.&lt;br /&gt;
&lt;br /&gt;
==='''How to determine when to duplicate data'''===&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]  The duplication of data should only be considered when it will save time or resources or both.  Furthermore, the authoritative source of the data is well known.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
Ideally, code and data should not be duplicated making maintainability and synchronization of information easy.  However, this document has described several scenarios where violating the DRY principle with regards to the duplication of data is acceptable.  In all examples provided, duplicating data significantly saved network bandwidth, computing processing, or human time.  Also, in all of the examples, only a single source of data was the authoritative source.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29881</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29881"/>
		<updated>2009-11-23T04:23:17Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself - Introduction'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one way to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Repeated Code&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed, and in general, data should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
 * Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
 * Out-of-date Data - data duplication usually means that you need to keep the same data in multiple locations in sync&lt;br /&gt;
&lt;br /&gt;
==='''Scenarios where DRY principle is violated'''===&lt;br /&gt;
There are certain scenarios, however, where duplication might not only be acceptable, but at times desirable.  However, in order to avoid the reasons just mentioned, certain rules should be followed.&lt;br /&gt;
&lt;br /&gt;
===='''Source Version Control'''====&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Version_control Source version control] is a management control tool that tracks different versions of data.  It is usually used in software development teams where several people might be making change to the same file.  It allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
&lt;br /&gt;
===='''Caching'''====&lt;br /&gt;
[http://en.wikipedia.org/wiki/Caching Caching] of data is the duplication of data that has been retrieved from a certain location, or calculated at an earlier time.  It is used when the time or processing power would be expensive to retrieve/calculate the data again.  Caching has proved to be useful in numerous applications including caching large amount of data transferred on the network, or caching data inside the processors that have been retrieved from memory.&lt;br /&gt;
&lt;br /&gt;
===='''Documentation'''====&lt;br /&gt;
Documentation can be automatically pulled and generated from code, which would essentially duplicate code and comments to create the document.  This is a useful technique since an updated documentation can be directly retrieved and created from the modified code without requiring individual to manually modify the doc.  This actually ensures that the document is up-to-date based on the latest code.&lt;br /&gt;
&lt;br /&gt;
==='''How to determine when to duplicate data'''===&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]  The duplication of data should only be considered when it will save time or resources or both.  Furthermore, the authoritative source of the data is well known.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
Ideally, code and data should not be duplicated making maintainability and synchronization of information easy.  However, this document has described several scenarios where violating the DRY principle with regards to the duplication of data is acceptable.  In all examples provided, duplicating data significantly saved network bandwidth, computing processing, or human time.  Also, in all of the examples, only a single source of data was the authoritative source.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29401</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29401"/>
		<updated>2009-11-19T02:42:44Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''DRY principle - Code''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself - Introduction'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one way to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Repeated Code&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed, and in general, data should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
 * Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
 * Out-of-date Data - data duplication usually means that you need to keep the same data in multiple locations in sync&lt;br /&gt;
&lt;br /&gt;
There are certain scenarios, however, where duplication might not only be acceptable, but at times desirable.  However, in order to avoid the reasons just mentioned, certain rules should be followed.&lt;br /&gt;
&lt;br /&gt;
=='''Source Version Control'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Version_control Source version control] is a management control tool that tracks different versions of data.  It is usually used in software development teams where several people might be making change to the same file.  It allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
&lt;br /&gt;
=='''Caching'''==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Caching Caching] of data is the duplication of data that has been retrieved from a certain location, or calculated at an earlier time.  It is used when the time or processing power would be expensive to retrieve/calculate the data again.  Caching has proved to be useful in numerous applications including caching large amount of data transferred on the network, or caching data inside the processors that have been retrieved from memory.&lt;br /&gt;
&lt;br /&gt;
=='''Documentation'''==&lt;br /&gt;
Documentation can be automatically pulled and generated from code, which would essentially duplicate code and comments to create the document.  This is a useful technique since an updated documentation can be directly retrieved and created from the modified code without requiring individual to manually modify the doc.  This actually ensures that the document is up-to-date based on the latest code.&lt;br /&gt;
&lt;br /&gt;
=='''How to determine when to duplicate data'''==&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]  The duplication of data should only be considered when it will save time or resources or both.  Furthermore, the authoritative source of the data is well known.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
Ideally, code and data should not be duplicated making maintainability and synchronization of information easy.  However, this document has described several scenarios where violating the DRY principle with regards to the duplication of data is acceptable.  In all examples provided, duplicating data significantly saved network bandwidth, computing processing, or human time.  Also, in all of the examples, only a single source of data was the authoritative source.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29392</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29392"/>
		<updated>2009-11-19T02:37:21Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself - Introduction'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Repeated Code&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed, and in general, data should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
 * Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
 * Out-of-date Data - data duplication usually means that you need to keep the same data in multiple locations in sync&lt;br /&gt;
&lt;br /&gt;
There are certain scenarios, however, where duplication might not only be acceptable, but at times desirable.  However, in order to avoid the reasons just mentioned, certain rules should be followed.&lt;br /&gt;
&lt;br /&gt;
=='''Source Version Control'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Version_control Source version control] is a management control tool that tracks different versions of data.  It is usually used in software development teams where several people might be making change to the same file.  It allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
&lt;br /&gt;
=='''Caching'''==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Caching Caching] of data is the duplication of data that has been retrieved from a certain location, or calculated at an earlier time.  It is used when the time or processing power would be expensive to retrieve/calculate the data again.  Caching has proved to be useful in numerous applications including caching large amount of data transferred on the network, or caching data inside the processors that have been retrieved from memory.&lt;br /&gt;
&lt;br /&gt;
=='''Documentation'''==&lt;br /&gt;
Documentation can be automatically pulled and generated from code, which would essentially duplicate code and comments to create the document.  This is a useful technique since an updated documentation can be directly retrieved and created from the modified code without requiring individual to manually modify the doc.  This actually ensures that the document is up-to-date based on the latest code.&lt;br /&gt;
&lt;br /&gt;
=='''How to determine when to duplicate data'''==&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]  The duplication of data should only be considered when it will save time or resources or both.  Furthermore, the authoritative source of the data is well known.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
Ideally, code and data should not be duplicated making maintainability and synchronization of information easy.  However, this document has described several scenarios where violating the DRY principle with regards to the duplication of data is acceptable.  In all examples provided, duplicating data significantly saved network bandwidth, computing processing, or human time.  Also, in all of the examples, only a single source of data was the authoritative source.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29242</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29242"/>
		<updated>2009-11-19T01:57:34Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself - Introduction'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Repeated Code&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed, and in general, data should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
 * Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
 * Out-of-date Data - data duplication usually means that you need to keep the same data in multiple locations in sync&lt;br /&gt;
&lt;br /&gt;
the There are certain scenarios, however, where duplication might not only be acceptable, but at times desirable.  However, in order to avoid the reasons just mentioned, certain rules should be followed.&lt;br /&gt;
&lt;br /&gt;
=='''Source Version Control'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Version_control Source version control] is a management control tool that tracks different versions of data.  It is usually used in software development teams where several people might be making change to the same file.  It allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
&lt;br /&gt;
=='''Caching'''==&lt;br /&gt;
* Caching of data can also prove to be useful if directly obtaining the data each time is resource and time intensive.  Caching data would result in better system efficiency as long as the authoritative source is well known.&lt;br /&gt;
&lt;br /&gt;
=='''Documentation'''==&lt;br /&gt;
* Documentation can be automatically generated from code, which would essentially duplicate code and comments to create the document.&lt;br /&gt;
&lt;br /&gt;
=='''Data duplication - when is it useful?'''==&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29144</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29144"/>
		<updated>2009-11-19T01:32:40Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Repeated Code&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed.  In general, data, just like code, should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
* Out-of-date Data - data duplication usually means that you need to keep the same data in multiple locations in sync&lt;br /&gt;
&lt;br /&gt;
There are certain scenarios where duplication might not only be acceptable, but at times desirable.&lt;br /&gt;
&lt;br /&gt;
=='''Source Version Control'''==&lt;br /&gt;
&lt;br /&gt;
In some instances, the duplication of data might actually be acceptable and even desirable.&lt;br /&gt;
&lt;br /&gt;
* Source version control allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
&lt;br /&gt;
=='''Caching'''==&lt;br /&gt;
* Caching of data can also prove to be useful if directly obtaining the data each time is resource and time intensive.  Caching data would result in better system efficiency as long as the authoritative source is well known.&lt;br /&gt;
&lt;br /&gt;
=='''Documentation'''==&lt;br /&gt;
* Documentation can be automatically generated from code, which would essentially duplicate code and comments to create the document.&lt;br /&gt;
&lt;br /&gt;
=='''Data duplication - when is it useful?'''==&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29140</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29140"/>
		<updated>2009-11-19T01:28:49Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Code'''==&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Repeated Code&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
=='''DRY principle - Data'''==&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed.  In general, data, just like code, should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
* Out-of-date Data - data duplication usually means that you need to keep the same data in multiple locations in sync&lt;br /&gt;
&lt;br /&gt;
=='''Data duplication - acceptable?'''==&lt;br /&gt;
&lt;br /&gt;
In some instances, the duplication of data might actually be acceptable and even desirable.&lt;br /&gt;
&lt;br /&gt;
* Source version control allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
* Caching of data can also prove to be useful if directly obtaining the data each time is resource and time intensive.  Caching data would result in better system efficiency as long as the authoritative source is well known.&lt;br /&gt;
* Documentation can be automatically generated from code, which would essentially duplicate code and comments to create the document.&lt;br /&gt;
&lt;br /&gt;
=='''Data duplication - when is it useful?'''==&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29135</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=29135"/>
		<updated>2009-11-19T01:27:06Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the rest of the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Code'''===&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Repeated Code&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Data'''===&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed.  In general, data, just like code, should not be duplicated for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Additional memory - data duplication usually means more memory to store and manipulate&lt;br /&gt;
* Out-of-date Data - data duplication usually means that you need to keep the same data in multiple locations in sync&lt;br /&gt;
&lt;br /&gt;
===='''Data duplication - acceptable?'''====&lt;br /&gt;
&lt;br /&gt;
In some instances, the duplication of data might actually be acceptable and even desirable.&lt;br /&gt;
&lt;br /&gt;
* Source version control allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
* Caching of data can also prove to be useful if directly obtaining the data each time is resource and time intensive.  Caching data would result in better system efficiency as long as the authoritative source is well known.&lt;br /&gt;
* Documentation can be automatically generated from code, which would essentially duplicate code and comments to create the document.&lt;br /&gt;
&lt;br /&gt;
===='''Data duplication - when is it useful?'''====&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=28024</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=28024"/>
		<updated>2009-11-18T04:17:35Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Code'''===&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Repeated Code&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Data'''===&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed.  In general, data, just like code, should not be duplicated as a change in one location would leave the data out of sync with somewhere else.&lt;br /&gt;
&lt;br /&gt;
===='''Data duplication - acceptable?'''====&lt;br /&gt;
&lt;br /&gt;
In some instances, the duplication of data might actually be acceptable and even desirable.&lt;br /&gt;
&lt;br /&gt;
* Source version control allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
* Caching of data can also prove to be useful if directly obtaining the data each time is resource and time intensive.  Caching data would result in better system efficiency as long as the authoritative source is well known.&lt;br /&gt;
* Documentation can be automatically generated from code, which would essentially duplicate code and comments to create the document.&lt;br /&gt;
&lt;br /&gt;
===='''Data duplication - when is it useful?'''====&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=28023</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=28023"/>
		<updated>2009-11-18T04:16:40Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Code'''===&lt;br /&gt;
&lt;br /&gt;
The idea of why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Repeated Code&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY Principle&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Data'''===&lt;br /&gt;
&lt;br /&gt;
Most of the documentation regarding the DRY principle usually discusses the duplication of code in methods and functions in a system, but the principle also applies to data.  Data can be created, passed around, copied and destroyed.  In general, data, just like code, should not be duplicated as a change in one location would leave the data out of sync with somewhere else.&lt;br /&gt;
&lt;br /&gt;
===='''Data duplication'''====&lt;br /&gt;
&lt;br /&gt;
In some instances, the duplication of data might actually be acceptable and even desirable.&lt;br /&gt;
&lt;br /&gt;
* Source version control allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
* Caching of data can also prove to be useful if directly obtaining the data each time is resource and time intensive.  Caching data would result in better system efficiency as long as the authoritative source is well known.&lt;br /&gt;
* Documentation can be automatically generated from code, which would essentially duplicate code and comments to create the document.&lt;br /&gt;
&lt;br /&gt;
===='''How to decide when data duplication might be useful'''====&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=27957</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=27957"/>
		<updated>2009-11-18T03:41:50Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Don't Repeat Yourself'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Code'''===&lt;br /&gt;
&lt;br /&gt;
The idea why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Java classes repeat functionality&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Java classes with repeated functionality factored out&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to other classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Data'''===&lt;br /&gt;
&lt;br /&gt;
The DRY principle not only applies to methods and functions in a system, but also to data.  Data can be created, passed around, copied and destroyed.  In general, data, just like code, should not be duplicated as a change in one location would leave the data out of sync with somewhere else.&lt;br /&gt;
&lt;br /&gt;
===='''When data duplication might be acceptable'''====&lt;br /&gt;
&lt;br /&gt;
In some instances, the duplication of data might actually be acceptable and even desirable.&lt;br /&gt;
&lt;br /&gt;
* Source version control allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
* Caching of data can also prove to be useful if directly obtaining the data each time is resource and time intensive.  Caching data would result in better system efficiency as long as the authoritative source is well known.&lt;br /&gt;
* Documentation can be automatically generated from code, which would essentially duplicate code and comments to create the document.&lt;br /&gt;
&lt;br /&gt;
===='''How to decide when data duplication might be useful'''====&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;br /&gt;
&lt;br /&gt;
4. &lt;br /&gt;
&lt;br /&gt;
5. &lt;br /&gt;
&lt;br /&gt;
6. &lt;br /&gt;
&lt;br /&gt;
7. &lt;br /&gt;
&lt;br /&gt;
8. &lt;br /&gt;
&lt;br /&gt;
9.&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26729</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26729"/>
		<updated>2009-11-12T23:43:24Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Don't Repeat Yourself'''===&lt;br /&gt;
&lt;br /&gt;
[[Image:DRY.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Code'''===&lt;br /&gt;
&lt;br /&gt;
The idea why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Java classes repeat functionality&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Java classes with repeated functionality factored out&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to other classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Data'''===&lt;br /&gt;
&lt;br /&gt;
The DRY principle not only applies to methods and functions in a system, but also to data.  Data can be created, passed around, copied and destroyed.  In general, data, just like code, should not be duplicated as a change in one location would leave the data out of sync with somewhere else.&lt;br /&gt;
&lt;br /&gt;
===='''When data duplication might be acceptable'''====&lt;br /&gt;
&lt;br /&gt;
In some instances, the duplication of data might actually be acceptable and even desirable.&lt;br /&gt;
&lt;br /&gt;
* Source version control allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
* Caching of data can also prove to be useful if directly obtaining the data each time is resource and time intensive.  Caching data would result in better system efficiency as long as the authoritative source is well known.&lt;br /&gt;
* Documentation can be automatically generated from code, which would essentially duplicate code and comments to create the document.&lt;br /&gt;
&lt;br /&gt;
===='''How to decide when data duplication might be useful'''====&lt;br /&gt;
&lt;br /&gt;
When considering whether data duplication might be helpful and acceptable, one must &amp;quot;identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).&amp;quot; [3]&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;br /&gt;
&lt;br /&gt;
4. &lt;br /&gt;
&lt;br /&gt;
5. &lt;br /&gt;
&lt;br /&gt;
6. &lt;br /&gt;
&lt;br /&gt;
7. &lt;br /&gt;
&lt;br /&gt;
8. &lt;br /&gt;
&lt;br /&gt;
9.&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26728</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26728"/>
		<updated>2009-11-12T23:31:34Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Don't Repeat Yourself'''===&lt;br /&gt;
&lt;br /&gt;
[[Image:DRY.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Code'''===&lt;br /&gt;
&lt;br /&gt;
The idea why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Java classes repeat functionality&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Java classes with repeated functionality factored out&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to other classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Data'''===&lt;br /&gt;
&lt;br /&gt;
The DRY principle not only applies to methods and functions in a system, but also to data.  Data can be created, passed around, copied and destroyed.  In general, data, just like code, should not be duplicated as a change in one location would leave the data out of sync with somewhere else.&lt;br /&gt;
&lt;br /&gt;
===='''When data duplication might be acceptable'''====&lt;br /&gt;
&lt;br /&gt;
In some instances, the duplication of data might actually be acceptable and even desirable.&lt;br /&gt;
&lt;br /&gt;
* Source version control allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
* Caching of data can also prove to be useful if directly obtaining the data each time is resource and time intensive.  Caching data would result in better system efficiency as long as the authoritative source is well known.&lt;br /&gt;
&lt;br /&gt;
===='''How to decide when data duplication might be useful'''====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. http://c2.com/cgi/wiki?DontRepeatYourself&lt;br /&gt;
&lt;br /&gt;
4. &lt;br /&gt;
&lt;br /&gt;
5. &lt;br /&gt;
&lt;br /&gt;
6. &lt;br /&gt;
&lt;br /&gt;
7. &lt;br /&gt;
&lt;br /&gt;
8. &lt;br /&gt;
&lt;br /&gt;
9.&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26720</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26720"/>
		<updated>2009-11-12T23:07:39Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Don't Repeat Yourself'''===&lt;br /&gt;
&lt;br /&gt;
[[Image:DRY.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Code'''===&lt;br /&gt;
&lt;br /&gt;
The idea why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Java classes repeat functionality&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Java classes with repeated functionality factored out&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to other classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Data'''===&lt;br /&gt;
&lt;br /&gt;
The DRY principle not only applies to methods and functions in a system, but also to data.  Data can be created, passed around, copied and destroyed.  In general, data, just like code, should not be duplicated as a change in one location would leave the data out of sync with somewhere else.&lt;br /&gt;
&lt;br /&gt;
===='''When data duplication might be acceptable'''====&lt;br /&gt;
&lt;br /&gt;
In some instances, the duplication of data might actually be acceptable and even desirable.&lt;br /&gt;
&lt;br /&gt;
* Source version control allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
* Caching of data can also prove to be useful if directly obtaining the data each time is resource and time intensive.  Caching data would result in better system efficiency, however, the original source of data has to be known, and some type of information should be validated to decide that the cached data is still valid.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. &lt;br /&gt;
&lt;br /&gt;
4. &lt;br /&gt;
&lt;br /&gt;
5. &lt;br /&gt;
&lt;br /&gt;
6. &lt;br /&gt;
&lt;br /&gt;
7. &lt;br /&gt;
&lt;br /&gt;
8. &lt;br /&gt;
&lt;br /&gt;
9.&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26719</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26719"/>
		<updated>2009-11-12T23:07:16Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) does not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave code (or functionality) somewhere else unmodified and out of sync. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Don't Repeat Yourself'''===&lt;br /&gt;
&lt;br /&gt;
[[Image:DRY.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Code'''===&lt;br /&gt;
&lt;br /&gt;
The idea why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Java classes repeat functionality&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Java classes with repeated functionality factored out&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to other classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - Data'''===&lt;br /&gt;
&lt;br /&gt;
The DRY principle not only applies to methods and functions in a system, but also to data.  Data can be created, passed around, copied and destroyed.  In general, data, just like code, should not be duplicated as a change in one location would leave the data out of sync with somewhere else.&lt;br /&gt;
&lt;br /&gt;
===='''When data duplication might be acceptable'''====&lt;br /&gt;
&lt;br /&gt;
In some instances, the duplication of data might actually be acceptable and even desirable.&lt;br /&gt;
&lt;br /&gt;
  * Source version control allows multiple copies of the data, sometimes with slight variations, in different branches and tags.  This is a good practice for this tool since at any given time there could be code in several stages: development, testing and production&lt;br /&gt;
  * Caching of data can also prove to be useful if directly obtaining the data each time is resource and time intensive.  Caching data would result in better system efficiency, however, the original source of data has to be known, and some type of information should be validated to decide that the cached data is still valid.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. &lt;br /&gt;
&lt;br /&gt;
4. &lt;br /&gt;
&lt;br /&gt;
5. &lt;br /&gt;
&lt;br /&gt;
6. &lt;br /&gt;
&lt;br /&gt;
7. &lt;br /&gt;
&lt;br /&gt;
8. &lt;br /&gt;
&lt;br /&gt;
9.&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26505</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26505"/>
		<updated>2009-11-10T01:54:06Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) do not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave the same code (or functionality) somewhere else unmodified. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Don't Repeat Yourself'''===&lt;br /&gt;
&lt;br /&gt;
[[Image:DRY.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - related to code'''===&lt;br /&gt;
&lt;br /&gt;
The idea why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Java classes repeat functionality&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Java classes with repeated functionality factored out&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The example above can be applied to other classes where the common code does not only return a string, but instead performs some kind of procedure or calculation.  In such a scenario, if the programmer was to make a change to one of the procedure and was not aware of the other, the code now would be different, possibly even providing different results.&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - related to data'''===&lt;br /&gt;
&lt;br /&gt;
The DRY principle not only applies to methods and functions, but also to data.  &lt;br /&gt;
&lt;br /&gt;
===='''DRY principle - bad when used with data'''====&lt;br /&gt;
===='''DRY principle - good when used with data'''====&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. &lt;br /&gt;
&lt;br /&gt;
4. &lt;br /&gt;
&lt;br /&gt;
5. &lt;br /&gt;
&lt;br /&gt;
6. &lt;br /&gt;
&lt;br /&gt;
7. &lt;br /&gt;
&lt;br /&gt;
8. &lt;br /&gt;
&lt;br /&gt;
9.&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26502</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26502"/>
		<updated>2009-11-10T01:26:59Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) do not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave the same code (or functionality) somewhere else unmodified. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Don't Repeat Yourself'''===&lt;br /&gt;
&lt;br /&gt;
[[Image:DRY.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - related to code'''===&lt;br /&gt;
&lt;br /&gt;
The idea why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Java classes repeat functionality&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Factoring out the common code&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - related to data'''===&lt;br /&gt;
&lt;br /&gt;
===='''DRY principle - bad when used with data'''====&lt;br /&gt;
===='''DRY principle - good when used with data'''====&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. &lt;br /&gt;
&lt;br /&gt;
4. &lt;br /&gt;
&lt;br /&gt;
5. &lt;br /&gt;
&lt;br /&gt;
6. &lt;br /&gt;
&lt;br /&gt;
7. &lt;br /&gt;
&lt;br /&gt;
8. &lt;br /&gt;
&lt;br /&gt;
9.&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26501</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26501"/>
		<updated>2009-11-10T01:24:51Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) do not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave the same code (or functionality) somewhere else unmodified. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Don't Repeat Yourself'''===&lt;br /&gt;
&lt;br /&gt;
[[Image:DRY.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - related to code'''===&lt;br /&gt;
&lt;br /&gt;
The idea why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot; [2]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Not applying DRY&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public class Person {&lt;br /&gt;
    private String name;&lt;br /&gt;
    private String address;&lt;br /&gt;
    public String getName() { return name; }&lt;br /&gt;
    public String getAddress() { return address; }&lt;br /&gt;
 &lt;br /&gt;
  }&lt;br /&gt;
  public class Student {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String gpa;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getGPA() { return gpa; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
  public class Employee {&lt;br /&gt;
    private Person me;&lt;br /&gt;
    private String salary;&lt;br /&gt;
    public String getName() { return me.getName; }&lt;br /&gt;
    public String getAddress() { return me.getAddress; }&lt;br /&gt;
    public String getSalary() { return salary; }&lt;br /&gt;
    ... other methods and data ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - related to data'''===&lt;br /&gt;
&lt;br /&gt;
===='''DRY principle - bad when used with data'''====&lt;br /&gt;
===='''DRY principle - good when used with data'''====&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. &lt;br /&gt;
&lt;br /&gt;
4. &lt;br /&gt;
&lt;br /&gt;
5. &lt;br /&gt;
&lt;br /&gt;
6. &lt;br /&gt;
&lt;br /&gt;
7. &lt;br /&gt;
&lt;br /&gt;
8. &lt;br /&gt;
&lt;br /&gt;
9.&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26493</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26493"/>
		<updated>2009-11-10T00:01:15Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down into smaller parts with logically unrelated pieces separated, allowing easier changes to one element without affecting the system.  DRY also helps by keeping related code together, and making sure that the same code (or even just the same functionality) do not appear in two different locations in the system.  This helps with ensuring that fixing one bug, or enhancing one part of the system, does not leave the same code (or functionality) somewhere else unmodified. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Don't Repeat Yourself'''===&lt;br /&gt;
&lt;br /&gt;
[[Image:DRY.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - related to code'''===&lt;br /&gt;
&lt;br /&gt;
The idea why one does not want more than one way to represent something in the system is simple: if you have more than one to represent something, with time, the different representation are more likely to be out of sync.  As Dave Thomas, author of Programming Ruby: A Pragmatic Programmer's Guide, says &amp;quot;A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - related to data'''===&lt;br /&gt;
&lt;br /&gt;
===='''DRY principle - bad when used with data'''====&lt;br /&gt;
===='''DRY principle - good when used with data'''====&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. [http://www.artima.com/intv/dry.html Orthogonality and the DRY Principle - A Conversation with Andy Hunt and Dave Thomas, Part II]&lt;br /&gt;
&lt;br /&gt;
3. &lt;br /&gt;
&lt;br /&gt;
4. &lt;br /&gt;
&lt;br /&gt;
5. &lt;br /&gt;
&lt;br /&gt;
6. &lt;br /&gt;
&lt;br /&gt;
7. &lt;br /&gt;
&lt;br /&gt;
8. &lt;br /&gt;
&lt;br /&gt;
9.&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26479</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26479"/>
		<updated>2009-11-09T01:58:17Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that &amp;quot;every piece of knowledge must have a single, unambiguous, authoritative representation within a system&amp;quot; [1].  By applying DRY practice to your software, the system is broken down with logically unrelated pieces separated, allowing easier changes to one element without affecting the system.  Also, by not having the same code, or even the same functionality, in two different locations, only a change in one area of the system is required to enhancement or fix a bug.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Don't Repeat Yourself'''===&lt;br /&gt;
&lt;br /&gt;
[[Image:DRY.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - related to code'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - related to data'''===&lt;br /&gt;
&lt;br /&gt;
===='''DRY principle - bad when used with data'''====&lt;br /&gt;
===='''DRY principle - good when used with data'''====&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://en.wikipedia.org/wiki/DRY&lt;br /&gt;
&lt;br /&gt;
2. &lt;br /&gt;
&lt;br /&gt;
3. &lt;br /&gt;
&lt;br /&gt;
4. &lt;br /&gt;
&lt;br /&gt;
5. &lt;br /&gt;
&lt;br /&gt;
6. &lt;br /&gt;
&lt;br /&gt;
7. &lt;br /&gt;
&lt;br /&gt;
8. &lt;br /&gt;
&lt;br /&gt;
9.&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26478</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26478"/>
		<updated>2009-11-09T01:26:02Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/DRY ''DRY'' 3] (or Don't Repeat Yourself) describes ...&lt;br /&gt;
&lt;br /&gt;
== '''DRY principle for data''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Don't Repeat Yourself'''===&lt;br /&gt;
&lt;br /&gt;
[[Image:DRY.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - related to code'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': DRY &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==='''DRY principle - related to data'''===&lt;br /&gt;
&lt;br /&gt;
===='''DRY principle - bad when used with data'''====&lt;br /&gt;
===='''DRY principle - good when used with data'''====&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. &lt;br /&gt;
&lt;br /&gt;
2. &lt;br /&gt;
&lt;br /&gt;
3. &lt;br /&gt;
&lt;br /&gt;
4. &lt;br /&gt;
&lt;br /&gt;
5. &lt;br /&gt;
&lt;br /&gt;
6. &lt;br /&gt;
&lt;br /&gt;
7. &lt;br /&gt;
&lt;br /&gt;
8. &lt;br /&gt;
&lt;br /&gt;
9.&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26477</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 4 br</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_4_br&amp;diff=26477"/>
		<updated>2009-11-09T01:17:15Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Topic: DRY principle for data&lt;br /&gt;
Most of the literature on the DRY principle relates to code. But the principle also applies to data. Survey the issues related to copying the same data, and give reasons (e.g., caching) why it might sometimes be desirable, and how one should decide where it is helpful not to follow this general rule.&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25835</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25835"/>
		<updated>2009-10-14T01:11:45Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''Metaprogramming''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article covers the following goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated, specifically how reflection and metaprogramming support SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architecture'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  The SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished by passing messages. [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
SOA offers the following technical advantages:&lt;br /&gt;
*Offers services across platforms&lt;br /&gt;
*Allows services to be split across systems and networks&lt;br /&gt;
*Allows services to be location independent and close to their business units&lt;br /&gt;
*Provides a bridge between incompatible technologies&lt;br /&gt;
*Leverages existing technologies&lt;br /&gt;
*Reduces dependency on custom systems&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain data, sufficient detail about the characteristic of the data and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  Furthermore, [http://en.wikipedia.org/wiki/Metadata Metadata] (data that describes the actual data) [http://en.wikipedia.org/wiki/Metadata 6] in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README file is metadata that describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA does not limit the protocol used to transfer the data.  A wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
[[Image:SOA_Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
We created this simplified image to illustrate the basic principles of service oriented architectures.  &lt;br /&gt;
* Services may be used by multiple applications.&lt;br /&gt;
* Services do not call on each other.&lt;br /&gt;
* Services communicate via protocols.&lt;br /&gt;
* An example protocol is provided, in which the application passes x to the Sin function, and Sin(x) is returned.&lt;br /&gt;
* Because of the protocol link, services may be written in different programming languages, or even be hosted on different computers with different operating systems, which allows for great flexibility.&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language. [http://en.wikipedia.org/wiki/Metaprogramming 7]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.  From this statement, code is automatically generated that provides a function to write the name (setter) and a function to read the name (getter).&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [http://weare.buildingsky.net/2009/08/25/rubys-metaprogramming-toolbox 9] &lt;br /&gt;
  Array.send(:define_method, :ducky) { puts 'ducky' }&lt;br /&gt;
&lt;br /&gt;
This example does something particularly interesting.  At run time, it defines a new method called ducky that prints out the word &amp;quot;ducky&amp;quot;.  This line modifies the program at run time!&lt;br /&gt;
&lt;br /&gt;
Another example in Ruby is the ActiveRecord library.  It dynamically creates accessor methods that map directly to each column in the database.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': ActiveRecord metaprogramming in Ruby [10]&lt;br /&gt;
  class Movie &amp;lt; ActiveRecord::Base&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  movie = Movie.create&lt;br /&gt;
  movie.title = &amp;quot;Doctor Strangelove&amp;quot;&lt;br /&gt;
  movie.title                          # =&amp;gt; &amp;quot;Doctor Strangelove&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In the example above, we create a new instance of Movie, which subclasses ActiveRecord. We then directly access the database's title column using the setter method 'title=' and then the getter method 'title'.  These methods are not defined anywhere in the source code, but instead, ActiveRecord automatically defines them based on the database column.&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Ruby [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5]&lt;br /&gt;
&lt;br /&gt;
  # without reflection&lt;br /&gt;
  Foo.new.hello&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  Object.const_get(:Foo).new.send(:hello)&lt;br /&gt;
&lt;br /&gt;
In this example, the first and second lines illustrate how the code is written without reflection.  The first line is a comment, and the second line is the actual code.  The code calls on Foo.new.hello, which calls on the object Foo, method new, and from what is returned on that, calls the method hello.  The second section does practically the same thing, but with reflection.  The main difference is that the object called by :hello can be determined at run time.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': More Reflection in Ruby [http://www.ruby-doc.org/core/classes/ObjectSpace.html 8]&lt;br /&gt;
&lt;br /&gt;
  ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
In this example, Ruby can determine all the objects that are defined.  This particular line of code prints out all the numeric objects that are currently defined.&lt;br /&gt;
&lt;br /&gt;
=='''How metaprogramming and reflection enhance SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture is enhanced when the underlying programs are able to dynamically adapt to the data received. Metaprogramming and Reflection make this possible.&lt;br /&gt;
&lt;br /&gt;
The services in a Service-oriented Architecture make use of the data passed around between them.  When the data passed around represents code, for example 'print &amp;quot;Hello World&amp;quot;' in a language independent way, the receiving service would use metaprogramming to write code to just that.  The service would then use reflection to determine what methods are available, in our case 'print', and would perform that task.  If the service logic was to &amp;quot;repeat 3 times&amp;quot;, then the code would ultimately print &amp;quot;Hello World&amp;quot; that number of times.&lt;br /&gt;
&lt;br /&gt;
XML may be used to transfer the message as follows:&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''' XML Data:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;message&amp;gt;&lt;br /&gt;
    &amp;lt;method&amp;gt;print&amp;lt;/method&amp;gt;&lt;br /&gt;
    &amp;lt;data&amp;gt;Hello World&amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A more practical use of reflection and metaprogramming in a SOA would be a service that examines the code passed to it for security holes.  This service could use reflection to examine the code.  The code could be sent to the service via whatever protocol is chosen.  Next, the service would evaluate the code for common security flaws.  If the program is determined to be safe enough, the service may run the code in a safe environment and perform further testing.  The service would output the results of the analysis, and perhaps even an auto-corrected program when it is complete.&lt;br /&gt;
&lt;br /&gt;
Currently, compilers are a good illustration of metaprogramming and reflection working in a service.  The compiler may be viewed as a service within SOA's.  It can be run on many different systems, which is a major benefit of SOA's.  Data (the code) is sent to a service (the compiler) which then translates it to machine code for the particular system.  Metaprogramming is at work here, because each line of code is generally used to write one or more lines of machine code.  The code and compiler effectively write a new program in machine code.  Machine code is code that a system can execute.  Reflection may take place when symbols generated by one section of code are referenced by another section of code. [http://dvanderboom.wordpress.com/2008/11/06/programming-language-directions/ 11]&lt;br /&gt;
&lt;br /&gt;
A pattern emerges when studying these examples.  Metaprogramming and reflection may be used within the service to enhance the capability of the service.  The data passed in to the service is often what guides how metaprogramming and reflection take place.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
SOA is an evolution of distributed computing based on web services.  It is an attractive solution for companies since it is platform independent allowing different software and hardware to communicate together easily.&lt;br /&gt;
&lt;br /&gt;
Metaprogramming and reflection are programming styles used to take advantage of the features in dynamic programming languages. They provide a great advantage when used in the development of SOAs to allow the services to dynamically change and adapt to the messages being passed between services. &lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of reflection&lt;br /&gt;
&lt;br /&gt;
6. http://en.wikipedia.org/wiki/Metadata - Explanation of metadata&lt;br /&gt;
&lt;br /&gt;
7. http://en.wikipedia.org/wiki/Metaprogramming - Explanation of metaprogramming&lt;br /&gt;
&lt;br /&gt;
8. http://www.ruby-doc.org/core/classes/ObjectSpace.html - Explanation of the ObjectSpace command in Ruby&lt;br /&gt;
&lt;br /&gt;
9. http://weare.buildingsky.net/2009/08/25/rubys-metaprogramming-toolbox - Explanation of tools that Ruby provides for metaprogramming&lt;br /&gt;
&lt;br /&gt;
10. Perrotta, Paolo (2009).  ''Metaprogramming Ruby''.&lt;br /&gt;
&lt;br /&gt;
11. http://dvanderboom.wordpress.com/2008/11/06/programming-language-directions/ - Illustrates the use of a compiler as a service&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25773</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25773"/>
		<updated>2009-10-13T03:46:57Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''References''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article covers the following goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated, specifically how reflection and metaprogramming support SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architecture'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished by passing messages. [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
SOA offers the following technical advantages:&lt;br /&gt;
*Offers services across platforms&lt;br /&gt;
*Allows services to be split across systems and networks&lt;br /&gt;
*Allows services to be location independent and close to their business units&lt;br /&gt;
*Provides a bridge between incompatible technologies&lt;br /&gt;
*Leverages existing technologies&lt;br /&gt;
*Reduces dependency on custom systems&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, [http://en.wikipedia.org/wiki/Metadata Metadata] (data that describes the actual data) [http://en.wikipedia.org/wiki/Metadata 6] in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README file is metadata that describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA does not limit the protocol used to transfer the data.  A wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
[[Image:SOA_Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
We created this simplified image to illustrate the basic principles of service oriented architectures.  &lt;br /&gt;
* Services may be used by multiple applications.&lt;br /&gt;
* Services do not call on each other.&lt;br /&gt;
* Services communicate via protocols.&lt;br /&gt;
* An example protocol is provided, in which the application passes x to the Sin function, and Sin(x) is returned.&lt;br /&gt;
* Because of the protocol link, services may be written in different programming languages, or even be hosted on different computers with different operating systems, which allows for great flexibility.&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language. [http://en.wikipedia.org/wiki/Metaprogramming 7]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.  From this statement, code is automatically generated that provides a function to write the name (setter) and a function to read the name (getter).&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [http://weare.buildingsky.net/2009/08/25/rubys-metaprogramming-toolbox 9] &lt;br /&gt;
  Array.send(:define_method, :ducky) { puts 'ducky' }&lt;br /&gt;
&lt;br /&gt;
This example does something particularly interesting.  At run time, it defines a new method called ducky that prints out the word &amp;quot;ducky&amp;quot;.  This line modifies the program at run time!&lt;br /&gt;
&lt;br /&gt;
Another example in Ruby is the ActiveRecord library.  It dynamically creates accessor methods that map directly to each column in the database.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': ActiveRecord metaprogramming in Ruby [10]&lt;br /&gt;
  class Movie &amp;lt; ActiveRecord::Base&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  movie = Movie.create&lt;br /&gt;
  movie.title = &amp;quot;Doctor Strangelove&amp;quot;&lt;br /&gt;
  movie.title                          # =&amp;gt; &amp;quot;Doctor Strangelove&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In the example above, we create a new instance of Movie, which subclasses ActiveRecord::Base, and then call the setter method 'title=', and then the getter method 'title'.  Neither of these methods is defined anywhere in the source code, but instead, ActiveRecord automatically defines them.&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Ruby [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5]&lt;br /&gt;
&lt;br /&gt;
  # without reflection&lt;br /&gt;
  Foo.new.hello&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  Object.const_get(:Foo).new.send(:hello)&lt;br /&gt;
&lt;br /&gt;
In this example, the first and second lines illustrate how the code is written without reflection.  The first line is a comment, and the second line is the actual code.  The code calls on Foo.new.hello, which calls on the object Foo, method new, and from what is returned on that, calls the method hello.  The second section does practically the same thing, but with reflection.  The main difference is that the object called by :hello can be determined at run time.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': More Reflection in Ruby [http://www.ruby-doc.org/core/classes/ObjectSpace.html 8]&lt;br /&gt;
&lt;br /&gt;
  ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
In this example, Ruby can determine all the objects that are defined.  This particular line of code prints out all the numeric objects that are currently defined.&lt;br /&gt;
&lt;br /&gt;
=='''How metaprogramming and reflection enhance SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture is enhanced when the underlying programs are able to dynamically adapt to the data received. Metaprogramming and Reflection make this possible.&lt;br /&gt;
&lt;br /&gt;
The services in a Service-oriented Architecture make use of the data passed around between them.  When the data passed around represents code, for example 'print &amp;quot;Hello World&amp;quot;' in a language independent way, the receiving service would use metaprogramming to write code to just that.  The service would then use reflection to determine what methods are available, in our case 'print', and would perform that task.  If the service logic was to &amp;quot;repeat 3 times&amp;quot;, then the code would ultimately print &amp;quot;Hello World&amp;quot; that number of times.&lt;br /&gt;
&lt;br /&gt;
XML may be used to transfer the message as follows:&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''' XML Data:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;message&amp;gt;&lt;br /&gt;
    &amp;lt;method&amp;gt;print&amp;lt;/method&amp;gt;&lt;br /&gt;
    &amp;lt;data&amp;gt;Hello World&amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A more practical use of reflection and metaprogramming in a SOA would be a service that examines the code passed to it for security holes.  This service could use reflection to examine the code.  The code could be sent to the service via whatever protocol is chosen.  Next, the service would evaluate the code for common security flaws.  If the program is determined to be safe enough, the service may run the code in a safe environment and perform further testing.  The service would output the results of the analysis, and perhaps even an auto-corrected program when it is complete.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
SOA is an evolution of distributed computing based on web services.  It is an attractive solution for companies since it is platform independent allowing different software and hardware to communicate together easily.&lt;br /&gt;
&lt;br /&gt;
Metaprogramming and reflection are programming styles used to take advantage of the features in dynamic programming languages. They provide a great advantage when used in the development of SOAs to allow the services to dynamically change and adapt to the messages being passed between services. &lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of reflection&lt;br /&gt;
&lt;br /&gt;
6. http://en.wikipedia.org/wiki/Metadata - Explanation of metadata&lt;br /&gt;
&lt;br /&gt;
7. http://en.wikipedia.org/wiki/Metaprogramming - Explanation of metaprogramming&lt;br /&gt;
&lt;br /&gt;
8. http://www.ruby-doc.org/core/classes/ObjectSpace.html - Explanation of the ObjectSpace command in Ruby&lt;br /&gt;
&lt;br /&gt;
9. http://weare.buildingsky.net/2009/08/25/rubys-metaprogramming-toolbox - Explanation of tools that Ruby provides for metaprogramming&lt;br /&gt;
&lt;br /&gt;
10. Perrotta, Paolo (2009).  ''Metaprogramming Ruby''.&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25772</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25772"/>
		<updated>2009-10-13T03:45:59Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''Metaprogramming''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article covers the following goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated, specifically how reflection and metaprogramming support SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architecture'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished by passing messages. [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
SOA offers the following technical advantages:&lt;br /&gt;
*Offers services across platforms&lt;br /&gt;
*Allows services to be split across systems and networks&lt;br /&gt;
*Allows services to be location independent and close to their business units&lt;br /&gt;
*Provides a bridge between incompatible technologies&lt;br /&gt;
*Leverages existing technologies&lt;br /&gt;
*Reduces dependency on custom systems&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, [http://en.wikipedia.org/wiki/Metadata Metadata] (data that describes the actual data) [http://en.wikipedia.org/wiki/Metadata 6] in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README file is metadata that describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA does not limit the protocol used to transfer the data.  A wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
[[Image:SOA_Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
We created this simplified image to illustrate the basic principles of service oriented architectures.  &lt;br /&gt;
* Services may be used by multiple applications.&lt;br /&gt;
* Services do not call on each other.&lt;br /&gt;
* Services communicate via protocols.&lt;br /&gt;
* An example protocol is provided, in which the application passes x to the Sin function, and Sin(x) is returned.&lt;br /&gt;
* Because of the protocol link, services may be written in different programming languages, or even be hosted on different computers with different operating systems, which allows for great flexibility.&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language. [http://en.wikipedia.org/wiki/Metaprogramming 7]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.  From this statement, code is automatically generated that provides a function to write the name (setter) and a function to read the name (getter).&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [http://weare.buildingsky.net/2009/08/25/rubys-metaprogramming-toolbox 9] &lt;br /&gt;
  Array.send(:define_method, :ducky) { puts 'ducky' }&lt;br /&gt;
&lt;br /&gt;
This example does something particularly interesting.  At run time, it defines a new method called ducky that prints out the word &amp;quot;ducky&amp;quot;.  This line modifies the program at run time!&lt;br /&gt;
&lt;br /&gt;
Another example in Ruby is the ActiveRecord library.  It dynamically creates accessor methods that map directly to each column in the database.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': ActiveRecord metaprogramming in Ruby [10]&lt;br /&gt;
  class Movie &amp;lt; ActiveRecord::Base&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  movie = Movie.create&lt;br /&gt;
  movie.title = &amp;quot;Doctor Strangelove&amp;quot;&lt;br /&gt;
  movie.title                          # =&amp;gt; &amp;quot;Doctor Strangelove&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In the example above, we create a new instance of Movie, which subclasses ActiveRecord::Base, and then call the setter method 'title=', and then the getter method 'title'.  Neither of these methods is defined anywhere in the source code, but instead, ActiveRecord automatically defines them.&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Ruby [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5]&lt;br /&gt;
&lt;br /&gt;
  # without reflection&lt;br /&gt;
  Foo.new.hello&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  Object.const_get(:Foo).new.send(:hello)&lt;br /&gt;
&lt;br /&gt;
In this example, the first and second lines illustrate how the code is written without reflection.  The first line is a comment, and the second line is the actual code.  The code calls on Foo.new.hello, which calls on the object Foo, method new, and from what is returned on that, calls the method hello.  The second section does practically the same thing, but with reflection.  The main difference is that the object called by :hello can be determined at run time.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': More Reflection in Ruby [http://www.ruby-doc.org/core/classes/ObjectSpace.html 8]&lt;br /&gt;
&lt;br /&gt;
  ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
In this example, Ruby can determine all the objects that are defined.  This particular line of code prints out all the numeric objects that are currently defined.&lt;br /&gt;
&lt;br /&gt;
=='''How metaprogramming and reflection enhance SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture is enhanced when the underlying programs are able to dynamically adapt to the data received. Metaprogramming and Reflection make this possible.&lt;br /&gt;
&lt;br /&gt;
The services in a Service-oriented Architecture make use of the data passed around between them.  When the data passed around represents code, for example 'print &amp;quot;Hello World&amp;quot;' in a language independent way, the receiving service would use metaprogramming to write code to just that.  The service would then use reflection to determine what methods are available, in our case 'print', and would perform that task.  If the service logic was to &amp;quot;repeat 3 times&amp;quot;, then the code would ultimately print &amp;quot;Hello World&amp;quot; that number of times.&lt;br /&gt;
&lt;br /&gt;
XML may be used to transfer the message as follows:&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''' XML Data:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;message&amp;gt;&lt;br /&gt;
    &amp;lt;method&amp;gt;print&amp;lt;/method&amp;gt;&lt;br /&gt;
    &amp;lt;data&amp;gt;Hello World&amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A more practical use of reflection and metaprogramming in a SOA would be a service that examines the code passed to it for security holes.  This service could use reflection to examine the code.  The code could be sent to the service via whatever protocol is chosen.  Next, the service would evaluate the code for common security flaws.  If the program is determined to be safe enough, the service may run the code in a safe environment and perform further testing.  The service would output the results of the analysis, and perhaps even an auto-corrected program when it is complete.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
SOA is an evolution of distributed computing based on web services.  It is an attractive solution for companies since it is platform independent allowing different software and hardware to communicate together easily.&lt;br /&gt;
&lt;br /&gt;
Metaprogramming and reflection are programming styles used to take advantage of the features in dynamic programming languages. They provide a great advantage when used in the development of SOAs to allow the services to dynamically change and adapt to the messages being passed between services. &lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of reflection&lt;br /&gt;
&lt;br /&gt;
6. http://en.wikipedia.org/wiki/Metadata - Explanation of metadata&lt;br /&gt;
&lt;br /&gt;
7. http://en.wikipedia.org/wiki/Metaprogramming - Explanation of metaprogramming&lt;br /&gt;
&lt;br /&gt;
8. http://www.ruby-doc.org/core/classes/ObjectSpace.html - Explanation of the ObjectSpace command in Ruby&lt;br /&gt;
&lt;br /&gt;
9. http://weare.buildingsky.net/2009/08/25/rubys-metaprogramming-toolbox - Explanation of tools that Ruby provides for metaprogramming&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25771</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25771"/>
		<updated>2009-10-13T03:45:27Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''Metaprogramming''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article covers the following goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated, specifically how reflection and metaprogramming support SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architecture'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished by passing messages. [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
SOA offers the following technical advantages:&lt;br /&gt;
*Offers services across platforms&lt;br /&gt;
*Allows services to be split across systems and networks&lt;br /&gt;
*Allows services to be location independent and close to their business units&lt;br /&gt;
*Provides a bridge between incompatible technologies&lt;br /&gt;
*Leverages existing technologies&lt;br /&gt;
*Reduces dependency on custom systems&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, [http://en.wikipedia.org/wiki/Metadata Metadata] (data that describes the actual data) [http://en.wikipedia.org/wiki/Metadata 6] in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README file is metadata that describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA does not limit the protocol used to transfer the data.  A wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
[[Image:SOA_Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
We created this simplified image to illustrate the basic principles of service oriented architectures.  &lt;br /&gt;
* Services may be used by multiple applications.&lt;br /&gt;
* Services do not call on each other.&lt;br /&gt;
* Services communicate via protocols.&lt;br /&gt;
* An example protocol is provided, in which the application passes x to the Sin function, and Sin(x) is returned.&lt;br /&gt;
* Because of the protocol link, services may be written in different programming languages, or even be hosted on different computers with different operating systems, which allows for great flexibility.&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language. [http://en.wikipedia.org/wiki/Metaprogramming 7]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.  From this statement, code is automatically generated that provides a function to write the name (setter) and a function to read the name (getter).&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [http://weare.buildingsky.net/2009/08/25/rubys-metaprogramming-toolbox 9] &lt;br /&gt;
  Array.send(:define_method, :ducky) { puts 'ducky' }&lt;br /&gt;
&lt;br /&gt;
This example does something particularly interesting.  At run time, it defines a new method called ducky that prints out the word &amp;quot;ducky&amp;quot;.  This line modifies the program at run time!&lt;br /&gt;
&lt;br /&gt;
Another example in Ruby is the ActiveRecord library.  It dynamically creates accessor methods that map directly to each column in the database.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': ActiveRecord metaprogramming in Ruby&lt;br /&gt;
class Movie &amp;lt; ActiveRecord::Base&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
movie = Movie.create&lt;br /&gt;
movie.title = &amp;quot;Doctor Strangelove&amp;quot;&lt;br /&gt;
movie.title                          # =&amp;gt; &amp;quot;Doctor Strangelove&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In the example above, we create a new instance of Movie, which subclasses ActiveRecord::Base, and then call the setter method 'title=', and then the getter method 'title'.  Neither of these methods is defined anywhere in the source code, but instead, ActiveRecord automatically defines them.&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Ruby [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5]&lt;br /&gt;
&lt;br /&gt;
  # without reflection&lt;br /&gt;
  Foo.new.hello&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  Object.const_get(:Foo).new.send(:hello)&lt;br /&gt;
&lt;br /&gt;
In this example, the first and second lines illustrate how the code is written without reflection.  The first line is a comment, and the second line is the actual code.  The code calls on Foo.new.hello, which calls on the object Foo, method new, and from what is returned on that, calls the method hello.  The second section does practically the same thing, but with reflection.  The main difference is that the object called by :hello can be determined at run time.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': More Reflection in Ruby [http://www.ruby-doc.org/core/classes/ObjectSpace.html 8]&lt;br /&gt;
&lt;br /&gt;
  ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
In this example, Ruby can determine all the objects that are defined.  This particular line of code prints out all the numeric objects that are currently defined.&lt;br /&gt;
&lt;br /&gt;
=='''How metaprogramming and reflection enhance SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture is enhanced when the underlying programs are able to dynamically adapt to the data received. Metaprogramming and Reflection make this possible.&lt;br /&gt;
&lt;br /&gt;
The services in a Service-oriented Architecture make use of the data passed around between them.  When the data passed around represents code, for example 'print &amp;quot;Hello World&amp;quot;' in a language independent way, the receiving service would use metaprogramming to write code to just that.  The service would then use reflection to determine what methods are available, in our case 'print', and would perform that task.  If the service logic was to &amp;quot;repeat 3 times&amp;quot;, then the code would ultimately print &amp;quot;Hello World&amp;quot; that number of times.&lt;br /&gt;
&lt;br /&gt;
XML may be used to transfer the message as follows:&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''' XML Data:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;message&amp;gt;&lt;br /&gt;
    &amp;lt;method&amp;gt;print&amp;lt;/method&amp;gt;&lt;br /&gt;
    &amp;lt;data&amp;gt;Hello World&amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A more practical use of reflection and metaprogramming in a SOA would be a service that examines the code passed to it for security holes.  This service could use reflection to examine the code.  The code could be sent to the service via whatever protocol is chosen.  Next, the service would evaluate the code for common security flaws.  If the program is determined to be safe enough, the service may run the code in a safe environment and perform further testing.  The service would output the results of the analysis, and perhaps even an auto-corrected program when it is complete.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
SOA is an evolution of distributed computing based on web services.  It is an attractive solution for companies since it is platform independent allowing different software and hardware to communicate together easily.&lt;br /&gt;
&lt;br /&gt;
Metaprogramming and reflection are programming styles used to take advantage of the features in dynamic programming languages. They provide a great advantage when used in the development of SOAs to allow the services to dynamically change and adapt to the messages being passed between services. &lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of reflection&lt;br /&gt;
&lt;br /&gt;
6. http://en.wikipedia.org/wiki/Metadata - Explanation of metadata&lt;br /&gt;
&lt;br /&gt;
7. http://en.wikipedia.org/wiki/Metaprogramming - Explanation of metaprogramming&lt;br /&gt;
&lt;br /&gt;
8. http://www.ruby-doc.org/core/classes/ObjectSpace.html - Explanation of the ObjectSpace command in Ruby&lt;br /&gt;
&lt;br /&gt;
9. http://weare.buildingsky.net/2009/08/25/rubys-metaprogramming-toolbox - Explanation of tools that Ruby provides for metaprogramming&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25770</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25770"/>
		<updated>2009-10-13T03:30:21Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''How metaprogramming and reflection enhance SOA''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article covers the following goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated, specifically how reflection and metaprogramming support SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architecture'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished by passing messages. [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
SOA offers the following technical advantages:&lt;br /&gt;
*Offers services across platforms&lt;br /&gt;
*Allows services to be split across systems and networks&lt;br /&gt;
*Allows services to be location independent and close to their business units&lt;br /&gt;
*Provides a bridge between incompatible technologies&lt;br /&gt;
*Leverages existing technologies&lt;br /&gt;
*Reduces dependency on custom systems&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, [http://en.wikipedia.org/wiki/Metadata Metadata] (data that describes the actual data) [http://en.wikipedia.org/wiki/Metadata 6] in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README file is metadata that describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA does not limit the protocol used to transfer the data.  A wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
[[Image:SOA_Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
We created this simplified image to illustrate the basic principles of service oriented architectures.  &lt;br /&gt;
* Services may be used by multiple applications.&lt;br /&gt;
* Services do not call on each other.&lt;br /&gt;
* Services communicate via protocols.&lt;br /&gt;
* An example protocol is provided, in which the application passes x to the Sin function, and Sin(x) is returned.&lt;br /&gt;
* Because of the protocol link, services may be written in different programming languages, or even be hosted on different computers with different operating systems, which allows for great flexibility.&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language. [http://en.wikipedia.org/wiki/Metaprogramming 7]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.  From this statement, code is automatically generated that provides a function to write the name (setter) and a function to read the name (getter).&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [http://weare.buildingsky.net/2009/08/25/rubys-metaprogramming-toolbox 9] &lt;br /&gt;
  Array.send(:define_method, :ducky) { puts 'ducky' }&lt;br /&gt;
&lt;br /&gt;
This example does something particularly interesting.  At run time, it defines a new method called ducky that prints out the word &amp;quot;ducky&amp;quot;.  This line modifies the program at run time!&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Ruby [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5]&lt;br /&gt;
&lt;br /&gt;
  # without reflection&lt;br /&gt;
  Foo.new.hello&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  Object.const_get(:Foo).new.send(:hello)&lt;br /&gt;
&lt;br /&gt;
In this example, the first and second lines illustrate how the code is written without reflection.  The first line is a comment, and the second line is the actual code.  The code calls on Foo.new.hello, which calls on the object Foo, method new, and from what is returned on that, calls the method hello.  The second section does practically the same thing, but with reflection.  The main difference is that the object called by :hello can be determined at run time.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': More Reflection in Ruby [http://www.ruby-doc.org/core/classes/ObjectSpace.html 8]&lt;br /&gt;
&lt;br /&gt;
  ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
In this example, Ruby can determine all the objects that are defined.  This particular line of code prints out all the numeric objects that are currently defined.&lt;br /&gt;
&lt;br /&gt;
=='''How metaprogramming and reflection enhance SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture is enhanced when the underlying programs are able to dynamically adapt to the data received. Metaprogramming and Reflection make this possible.&lt;br /&gt;
&lt;br /&gt;
The services in a Service-oriented Architecture make use of the data passed around between them.  When the data passed around represents code, for example 'print &amp;quot;Hello World&amp;quot;' in a language independent way, the receiving service would use metaprogramming to write code to just that.  The service would then use reflection to determine what methods are available, in our case 'print', and would perform that task.  If the service logic was to &amp;quot;repeat 3 times&amp;quot;, then the code would ultimately print &amp;quot;Hello World&amp;quot; that number of times.&lt;br /&gt;
&lt;br /&gt;
XML may be used to transfer the message as follows:&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''' XML Data:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;message&amp;gt;&lt;br /&gt;
    &amp;lt;method&amp;gt;print&amp;lt;/method&amp;gt;&lt;br /&gt;
    &amp;lt;data&amp;gt;Hello World&amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A more practical use of reflection and metaprogramming in a SOA would be a service that examines the code passed to it for security holes.  This service could use reflection to examine the code.  The code could be sent to the service via whatever protocol is chosen.  Next, the service would evaluate the code for common security flaws.  If the program is determined to be safe enough, the service may run the code in a safe environment and perform further testing.  The service would output the results of the analysis, and perhaps even an auto-corrected program when it is complete.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
SOA is an evolution of distributed computing based on web services.  It is an attractive solution for companies since it is platform independent allowing different software and hardware to communicate together easily.&lt;br /&gt;
&lt;br /&gt;
Metaprogramming and reflection are programming styles used to take advantage of the features in dynamic programming languages. They provide a great advantage when used in the development of SOAs to allow the services to dynamically change and adapt to the messages being passed between services. &lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of reflection&lt;br /&gt;
&lt;br /&gt;
6. http://en.wikipedia.org/wiki/Metadata - Explanation of metadata&lt;br /&gt;
&lt;br /&gt;
7. http://en.wikipedia.org/wiki/Metaprogramming - Explanation of metaprogramming&lt;br /&gt;
&lt;br /&gt;
8. http://www.ruby-doc.org/core/classes/ObjectSpace.html - Explanation of the ObjectSpace command in Ruby&lt;br /&gt;
&lt;br /&gt;
9. http://weare.buildingsky.net/2009/08/25/rubys-metaprogramming-toolbox - Explanation of tools that Ruby provides for metaprogramming&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25769</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25769"/>
		<updated>2009-10-13T03:29:26Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''How metaprogramming and reflection enhance SOA''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article covers the following goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated, specifically how reflection and metaprogramming support SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architecture'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished by passing messages. [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
SOA offers the following technical advantages:&lt;br /&gt;
*Offers services across platforms&lt;br /&gt;
*Allows services to be split across systems and networks&lt;br /&gt;
*Allows services to be location independent and close to their business units&lt;br /&gt;
*Provides a bridge between incompatible technologies&lt;br /&gt;
*Leverages existing technologies&lt;br /&gt;
*Reduces dependency on custom systems&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, [http://en.wikipedia.org/wiki/Metadata Metadata] (data that describes the actual data) [http://en.wikipedia.org/wiki/Metadata 6] in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README file is metadata that describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA does not limit the protocol used to transfer the data.  A wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
[[Image:SOA_Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
We created this simplified image to illustrate the basic principles of service oriented architectures.  &lt;br /&gt;
* Services may be used by multiple applications.&lt;br /&gt;
* Services do not call on each other.&lt;br /&gt;
* Services communicate via protocols.&lt;br /&gt;
* An example protocol is provided, in which the application passes x to the Sin function, and Sin(x) is returned.&lt;br /&gt;
* Because of the protocol link, services may be written in different programming languages, or even be hosted on different computers with different operating systems, which allows for great flexibility.&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language. [http://en.wikipedia.org/wiki/Metaprogramming 7]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.  From this statement, code is automatically generated that provides a function to write the name (setter) and a function to read the name (getter).&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [http://weare.buildingsky.net/2009/08/25/rubys-metaprogramming-toolbox 9] &lt;br /&gt;
  Array.send(:define_method, :ducky) { puts 'ducky' }&lt;br /&gt;
&lt;br /&gt;
This example does something particularly interesting.  At run time, it defines a new method called ducky that prints out the word &amp;quot;ducky&amp;quot;.  This line modifies the program at run time!&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Ruby [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5]&lt;br /&gt;
&lt;br /&gt;
  # without reflection&lt;br /&gt;
  Foo.new.hello&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  Object.const_get(:Foo).new.send(:hello)&lt;br /&gt;
&lt;br /&gt;
In this example, the first and second lines illustrate how the code is written without reflection.  The first line is a comment, and the second line is the actual code.  The code calls on Foo.new.hello, which calls on the object Foo, method new, and from what is returned on that, calls the method hello.  The second section does practically the same thing, but with reflection.  The main difference is that the object called by :hello can be determined at run time.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': More Reflection in Ruby [http://www.ruby-doc.org/core/classes/ObjectSpace.html 8]&lt;br /&gt;
&lt;br /&gt;
  ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
In this example, Ruby can determine all the objects that are defined.  This particular line of code prints out all the numeric objects that are currently defined.&lt;br /&gt;
&lt;br /&gt;
=='''How metaprogramming and reflection enhance SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture is enhanced when the underlying programs are able to dynamically adapt to the data received. Metaprogramming and Reflection make this possible.&lt;br /&gt;
&lt;br /&gt;
The services in a Service-oriented Architecture make use of the data passed around between them.  When the data passed around represents code, for example 'print &amp;quot;Hello World&amp;quot;' in a language independent way, the receiving service would use metaprogramming to write code to just that.  The service would then use reflection to determine was is available, in our case 'print', and would perform that task.  If the service logic was to &amp;quot;repeat 3 times&amp;quot;, then the code would ultimately print &amp;quot;Hello World&amp;quot; that number of times.&lt;br /&gt;
&lt;br /&gt;
XML may be used to transfer the message as follows:&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''' XML Data:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;message&amp;gt;&lt;br /&gt;
    &amp;lt;method&amp;gt;print&amp;lt;/method&amp;gt;&lt;br /&gt;
    &amp;lt;data&amp;gt;Hello World&amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A more practical use of reflection and metaprogramming in a SOA would be a service that examines the code passed to it for security holes.  This service could use reflection to examine the code.  The code could be sent to the service via whatever protocol is chosen.  Next, the service would evaluate the code for common security flaws.  If the program is determined to be safe enough, the service may run the code in a safe environment and perform further testing.  The service would output the results of the analysis, and perhaps even an auto-corrected program when it is complete.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
SOA is an evolution of distributed computing based on web services.  It is an attractive solution for companies since it is platform independent allowing different software and hardware to communicate together easily.&lt;br /&gt;
&lt;br /&gt;
Metaprogramming and reflection are programming styles used to take advantage of the features in dynamic programming languages. They provide a great advantage when used in the development of SOAs to allow the services to dynamically change and adapt to the messages being passed between services. &lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of reflection&lt;br /&gt;
&lt;br /&gt;
6. http://en.wikipedia.org/wiki/Metadata - Explanation of metadata&lt;br /&gt;
&lt;br /&gt;
7. http://en.wikipedia.org/wiki/Metaprogramming - Explanation of metaprogramming&lt;br /&gt;
&lt;br /&gt;
8. http://www.ruby-doc.org/core/classes/ObjectSpace.html - Explanation of the ObjectSpace command in Ruby&lt;br /&gt;
&lt;br /&gt;
9. http://weare.buildingsky.net/2009/08/25/rubys-metaprogramming-toolbox - Explanation of tools that Ruby provides for metaprogramming&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25762</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25762"/>
		<updated>2009-10-13T02:53:35Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article covers the following goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated, specifically how reflection and metaprogramming support SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
!!!!&lt;br /&gt;
- Enhance final section&lt;br /&gt;
&lt;br /&gt;
- Add a Conclusion&lt;br /&gt;
&lt;br /&gt;
- Metaprogramming and Reflection sections were very brief. Perhaps, you could add some Ruby code instead of Python. Maybe touch on things like ObjectSpace.each_object and similar.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architecture'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished by passing messages. [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
SOA offers the following technical advantages:&lt;br /&gt;
*Offers services across platforms&lt;br /&gt;
*Allows services to be split across systems and networks&lt;br /&gt;
*Allows services to be location independent and close to their business units&lt;br /&gt;
*Provides a bridge between incompatible technologies&lt;br /&gt;
*Leverages existing technologies&lt;br /&gt;
*Reduces dependency on custom systems&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, [http://en.wikipedia.org/wiki/Metadata Metadata] (data that describes the actual data) [http://en.wikipedia.org/wiki/Metadata 6] in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README file is metadata that describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA does not limit the protocol used to transfer the data.  A wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
[[Image:SOA_Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
We created this simplified image to illustrate the basic principles of service oriented architectures.  &lt;br /&gt;
* Services may be used by multiple applications.&lt;br /&gt;
* Services do not call on each other.&lt;br /&gt;
* Services communicate via protocols.&lt;br /&gt;
* An example protocol is provided, in which the application passes x to the Sin function, and Sin(x) is returned.&lt;br /&gt;
* Because of the protocol link, services may be written in different programming languages, or even be hosted on different computers with different operating systems, which allows for great flexibility.&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language. [http://en.wikipedia.org/wiki/Metaprogramming 7]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.  From this statement, code is automatically generated that provides a function to write the name (setter) and a function to read the name (getter).&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes on dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Ruby [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5]&lt;br /&gt;
&lt;br /&gt;
  # without reflection&lt;br /&gt;
  Foo.new.hello&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  Object.const_get(:Foo).new.send(:hello)&lt;br /&gt;
&lt;br /&gt;
In this example, the first and second lines illustrate how the code is written without reflection.  The first line is a comment, and the second line is the actual code.  The code calls on Foo.new.hello, which calls on the object Foo, method new, and from what is returned on that, calls the method hello.  The second section does practically the same thing, but with reflection.  The main difference is that the object called by :hello can be determined at run time.&lt;br /&gt;
&lt;br /&gt;
=='''How metaprogramming and reflection enhance SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture is enhanced when the underlying programs are able to dynamically adapt to the data received. Metaprogramming and Reflection make this possible.&lt;br /&gt;
&lt;br /&gt;
The services in a Service-oriented Architecture make use of the data passed around between them.  When the data passed around represents code, for example 'print &amp;quot;Hello World&amp;quot;' in a language independent way, the receiving service would use metaprogramming to write code to just that.  The service would then use reflection to determine was is available, in our case 'print', and would perform that task.  If the service logic was to &amp;quot;repeat 3 times&amp;quot;, then the code would ultimately print &amp;quot;Hello World&amp;quot; that number of times.&lt;br /&gt;
&lt;br /&gt;
XML may be used to transfer the message as follows:&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''' XML Metaprogramming:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;message&amp;gt;&lt;br /&gt;
    &amp;lt;method&amp;gt;print&amp;lt;/method&amp;gt;&lt;br /&gt;
    &amp;lt;data&amp;gt;Hello World&amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A more practical use of reflection and metaprogramming in a SOA would be a service that examines the code passed to it for security holes.  This service could use reflection to examine the code.  The code could be sent to the service via whatever protocol is chosen.  Next, the service would evaluate the code for common security flaws.  If the program is determined to be safe enough, the service may run the code in a safe environment and perform further testing.  The service would output the results of the analysis, and perhaps even an auto-corrected program when it is complete.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
SOA is an evolution of distributed computing based on web services.  It is an attractive solution for companies since it is platform independent allowing different software and hardware to communicate together easily.&lt;br /&gt;
&lt;br /&gt;
Metaprogramming and reflection are programming styles used to take advantage of the features in dynamic programming languages. They provide a great advantage when used in the development of SOAs to allow the services to dynamically change and adapt to the messages being passed between services. &lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of reflection&lt;br /&gt;
&lt;br /&gt;
6. http://en.wikipedia.org/wiki/Metadata - Explanation of metadata&lt;br /&gt;
&lt;br /&gt;
7. http://en.wikipedia.org/wiki/Metaprogramming - Explanation of metaprogramming&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25348</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25348"/>
		<updated>2009-10-10T01:59:34Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''How metaprogramming and reflection enhance SOA''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article covers the following goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated, specifically how reflection and metaprogramming support SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architecture'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished by passing messages. [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
SOA offers the following technical advantages:&lt;br /&gt;
*Offers services across platforms&lt;br /&gt;
*Allows services to be split across systems and networks&lt;br /&gt;
*Allows services to be location independent and close to their business units&lt;br /&gt;
*Provides a bridge between incompatible technologies&lt;br /&gt;
*Leverages existing technologies&lt;br /&gt;
*Reduces dependency on custom systems&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, [http://en.wikipedia.org/wiki/Metadata Metadata] (data that describes the actual data) [http://en.wikipedia.org/wiki/Metadata 6] in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README file is metadata that describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA does not limit the protocol used to transfer the data.  A wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
[[Image:SOA_Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
We created this simplified image to illustrate the basic principles of service oriented architectures.  &lt;br /&gt;
* Services may be used by multiple applications.&lt;br /&gt;
* Services do not call on each other.&lt;br /&gt;
* Services communicate via protocols.&lt;br /&gt;
* An example protocol is provided, in which the application passes x to the Sin function, and Sin(x) is returned.&lt;br /&gt;
* Because of the protocol link, services may be written in different programming languages, or even be hosted on different computers with different operating systems, which allows for great flexibility.&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language. [http://en.wikipedia.org/wiki/Metaprogramming 7]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.  From this statement, code is automatically generated that provides a function to write the name (setter) and a function to read the name (getter).&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes on dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
=='''How metaprogramming and reflection enhance SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture is enhanced when the underlying programs are able to dynamically adapt to the data received. Metaprogramming and Reflection make this possible.&lt;br /&gt;
&lt;br /&gt;
The services in a Service-oriented Architecture make use of the data passed around between them.  When the data passed around represents code, for example 'print &amp;quot;Hello World&amp;quot;' in a language independent way, the receiving service would use metaprogramming to write code to just that.  The service would then use reflection to determine was is available, in our case 'print', and would perform that task.  If the service logic was to &amp;quot;repeat 3 times&amp;quot;, then the code would ultimately print &amp;quot;Hello World&amp;quot; that number of times.&lt;br /&gt;
&lt;br /&gt;
XML may be used to transfer the message as follows:&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''' XML Metaprogramming:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;message&amp;gt;&lt;br /&gt;
    &amp;lt;method&amp;gt;print&amp;lt;/method&amp;gt;&lt;br /&gt;
    &amp;lt;data&amp;gt;Hello World&amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A more practical example would be a service that examines the code passed to it for security holes.  These examples both make use of metaprogramming and reflection.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of reflection&lt;br /&gt;
&lt;br /&gt;
6. http://en.wikipedia.org/wiki/Metadata - Explanation of metadata&lt;br /&gt;
&lt;br /&gt;
7. http://en.wikipedia.org/wiki/Metaprogramming - Explanation of metaprogramming&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25320</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25320"/>
		<updated>2009-10-10T01:46:12Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''How metaprogramming and reflection enhance SOA''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article covers the following three goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated.&lt;br /&gt;
#Examines how reflection and metaprogramming supports SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architecture'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished by passing messages [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
SOA offers the following technical advantages:&lt;br /&gt;
*Offers services across platforms&lt;br /&gt;
*Allows services to be split across systems and networks&lt;br /&gt;
*Allows services to be location independent and close to their business units&lt;br /&gt;
*Provides a bridge between incompatible technologies&lt;br /&gt;
*Leverages existing technologies&lt;br /&gt;
*Reduces dependency on custom systems&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, [http://en.wikipedia.org/wiki/Metadata Metadata] (data that describes the actual data) [http://en.wikipedia.org/wiki/Metadata 6] in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README file is metadata that describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA also does not limit the protocol used to transfer the data and a wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
[[Image:SOA_Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
We created this simplified image to illustrate the basic principles of service oriented architectures.  &lt;br /&gt;
* Services may be used by multiple applications.&lt;br /&gt;
* Services do not call on each other.&lt;br /&gt;
* Services communicate via protocols.&lt;br /&gt;
* An example protocol is provided, in which the application passes x to the Sin function, and Sin(x) is returned.&lt;br /&gt;
* Because of the protocol link, services may be written in different programming languages, or even be hosted on different computers with different operating systems, which allows for great flexibility.&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language. [http://en.wikipedia.org/wiki/Metaprogramming 7]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.  From this statement, code is automatically generated that provides a function to write the name (setter) and a function to read the name (getter).&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes on dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
=='''How metaprogramming and reflection enhance SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture is enhanced when the underlying programs are able to dynamically adapt to the data received. Metaprogramming and Reflection make this possible.&lt;br /&gt;
&lt;br /&gt;
The services in a Service-oriented Architecture make use of the data passed around between them.  When the data passed around represents code, for example 'print &amp;quot;Hello World&amp;quot;' in a language independent way, the receiving service would use metaprogramming to write code to just that.  The service would then use reflection to determine was is available, in our case 'print', and would perform that task.  If the service logic was to &amp;quot;repeat 3 times&amp;quot;, then the code would ultimately print &amp;quot;Hello World&amp;quot; that number of times.  A more practical example would be a service that examines the code passed to it for security holes.  These examples both make use of metaprogramming and reflection.  &lt;br /&gt;
&lt;br /&gt;
What follows is another example of how metaprogramming and reflection may be used in SOA:&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''' XML Metaprogramming:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;data&amp;gt;&lt;br /&gt;
    &amp;lt;method&amp;gt;print&amp;lt;/method&amp;gt;&lt;br /&gt;
    &amp;lt;message&amp;gt;Hello World&amp;lt;/message&amp;gt;&lt;br /&gt;
  &amp;lt;/data&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An XML metadata schema can be used to transport the data.&lt;br /&gt;
&lt;br /&gt;
This data is now passed around between services, and each service may be extended dynamically to use it.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of reflection&lt;br /&gt;
&lt;br /&gt;
6. http://en.wikipedia.org/wiki/Metadata - Explanation of metadata&lt;br /&gt;
&lt;br /&gt;
7. http://en.wikipedia.org/wiki/Metaprogramming - Explanation of metaprogramming&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25227</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25227"/>
		<updated>2009-10-10T01:12:02Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''How it is all related and enhances SOA''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article covers the following three goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated.&lt;br /&gt;
#Examines how reflection and metaprogramming supports SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architecture'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished by passing messages [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
SOA offers the following technical advantages:&lt;br /&gt;
*Offers services across platforms&lt;br /&gt;
*Allows services to be split across systems and networks&lt;br /&gt;
*Allows services to be location independent and close to their business units&lt;br /&gt;
*Provides a bridge between incompatible technologies&lt;br /&gt;
*Leverages existing technologies&lt;br /&gt;
*Reduces dependency on custom systems&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, [http://en.wikipedia.org/wiki/Metadata Metadata] (data that describes the actual data) [http://en.wikipedia.org/wiki/Metadata 6] in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README file is metadata that describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA also does not limit the protocol used to transfer the data and a wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
[[Image:SOA_Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
We created this simplified image to illustrate the basic principles of service oriented architectures.  &lt;br /&gt;
* Services may be used by multiple applications.&lt;br /&gt;
* Services do not call on each other.&lt;br /&gt;
* Services communicate via protocols.&lt;br /&gt;
* An example protocol is provided, in which the application passes x to the Sin function, and Sin(x) is returned.&lt;br /&gt;
* Because of the protocol link, services may be written in different programming languages, or even be hosted on different computers with different operating systems, which allows for great flexibility.&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language. [http://en.wikipedia.org/wiki/Metaprogramming 7]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.  From this statement, code is automatically generated that provides a function to write the name (setter) and a function to read the name (getter).&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes on dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
=='''How it is all related and enhances SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture is enhanced when the underlying programs are able to dynamically adapt to the data received. Metaprogramming and Reflection make this possible.&lt;br /&gt;
&lt;br /&gt;
The services in a Service-oriented Architecture make use of the data passed around between them.  When the data passed around represents code, for example 'print &amp;quot;Hello World&amp;quot;' in a language independent way, the receiving service would use metaprogramming to write code to just that.  The service would then use reflection to determine was is available, in our case 'print', and would perform that task.  If the service logic was to &amp;quot;repeat 3 times&amp;quot;, then the code would ultimately print &amp;quot;Hello World&amp;quot; that number of times.&lt;br /&gt;
&lt;br /&gt;
The application would pass the line saying to print &amp;quot;Hello World&amp;quot; to the service, would then print Hello World three times.  Another more practical example would be a service that examines the code passed to it for security holes.  These examples both make use of metaprogramming and reflection.  One limitation to this concept, however, is that it would limit the code to a specific language.  For example, if a Ruby line: puts &amp;quot;Hello World&amp;quot; is passed into a service written to accept Java code, it will not work properly.  Services and applications would need to talk in the same language in this case, which would, for these applications, take away the benefit that services may be written in different languages.&lt;br /&gt;
&lt;br /&gt;
A second thought we came up with is to send data that reperesents code.  For example, we could pass a message that says print Hello World, and then the service would do that in whatever language it is written in.  The first word could be read, and then the service could call the proper code within itself to meet that request.  This could be accomplished with metaprogramming and reflection.  The message could be analyzed and the method called could be changed based on what function is requested in the message.&lt;br /&gt;
&lt;br /&gt;
The concept of reflection and metaprogramming can be used to extend the services and dynamically modify their behavior.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
An XML metadata schema is extended to include a new tag/value.  This data is now passed around between services, and each service can be extended dynamically to use it.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of reflection&lt;br /&gt;
&lt;br /&gt;
6. http://en.wikipedia.org/wiki/Metadata - Explanation of metadata&lt;br /&gt;
&lt;br /&gt;
7. http://en.wikipedia.org/wiki/Metaprogramming - Explanation of metaprogramming&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25194</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25194"/>
		<updated>2009-10-10T00:56:14Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''How it is all related and enhances SOA''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article covers the following three goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated.&lt;br /&gt;
#Examines how reflection and metaprogramming supports SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architecture'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished by passing messages [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
SOA offers the following technical advantages:&lt;br /&gt;
*Offers services across platforms&lt;br /&gt;
*Allows services to be split across systems and networks&lt;br /&gt;
*Allows services to be location independent and close to their business units&lt;br /&gt;
*Provides a bridge between incompatible technologies&lt;br /&gt;
*Leverages existing technologies&lt;br /&gt;
*Reduces dependency on custom systems&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, [http://en.wikipedia.org/wiki/Metadata Metadata] (data that describes the actual data) [http://en.wikipedia.org/wiki/Metadata 6] in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README file is metadata that describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA also does not limit the protocol used to transfer the data and a wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
[[Image:SOA_Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
We created this simplified image to illustrate the basic principles of service oriented architectures.  &lt;br /&gt;
* Services may be used by multiple applications.&lt;br /&gt;
* Services do not call on each other.&lt;br /&gt;
* Services communicate via protocols.&lt;br /&gt;
* An example protocol is provided, in which the application passes x to the Sin function, and Sin(x) is returned.&lt;br /&gt;
* Because of the protocol link, services may be written in different programming languages, or even be hosted on different computers with different operating systems, which allows for great flexibility.&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language. [http://en.wikipedia.org/wiki/Metaprogramming 7]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.  From this statement, code is automatically generated that provides a function to write the name (setter) and a function to read the name (getter).&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes on dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
=='''How it is all related and enhances SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture is enhanced when the underlying programs are able to dynamically adapt to the data received. Metaprogramming and Reflection make this possible.&lt;br /&gt;
&lt;br /&gt;
The services in a Service-oriented Architecture make use of the data passed around between them.  When the data passed around represents code, for example 'print &amp;quot;Hello World&amp;quot;', and is language independent, the receiving service One thought we came with on how metaprogramming and reflection could be useful in a SOA is if the protocol consists of passing code.  For example, a service could &amp;quot;repeat 3 times&amp;quot; and the code passed to it could print &amp;quot;Hello World&amp;quot;.  The application would pass the line saying to print &amp;quot;Hello World&amp;quot; to the service, would then print Hello World three times.  Another more practical example would be a service that examines the code passed to it for security holes.  These examples both make use of metaprogramming and reflection.  One limitation to this concept, however, is that it would limit the code to a specific language.  For example, if a Ruby line: puts &amp;quot;Hello World&amp;quot; is passed into a service written to accept Java code, it will not work properly.  Services and applications would need to talk in the same language in this case, which would, for these applications, take away the benefit that services may be written in different languages.&lt;br /&gt;
&lt;br /&gt;
A second thought we came up with is to send data that reperesents code.  For example, we could pass a message that says print Hello World, and then the service would do that in whatever language it is written in.  The first word could be read, and then the service could call the proper code within itself to meet that request.  This could be accomplished with metaprogramming and reflection.  The message could be analyzed and the method called could be changed based on what function is requested in the message.&lt;br /&gt;
&lt;br /&gt;
The concept of reflection and metaprogramming can be used to extend the services and dynamically modify their behavior.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
An XML metadata schema is extended to include a new tag/value.  This data is now passed around between services, and each service can be extended dynamically to use it.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of reflection&lt;br /&gt;
&lt;br /&gt;
6. http://en.wikipedia.org/wiki/Metadata - Explanation of metadata&lt;br /&gt;
&lt;br /&gt;
7. http://en.wikipedia.org/wiki/Metaprogramming - Explanation of metaprogramming&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25171</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25171"/>
		<updated>2009-10-10T00:52:05Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article covers the following three goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated.&lt;br /&gt;
#Examines how reflection and metaprogramming supports SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architecture'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished by passing messages [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
SOA offers the following technical advantages:&lt;br /&gt;
*Offers services across platforms&lt;br /&gt;
*Allows services to be split across systems and networks&lt;br /&gt;
*Allows services to be location independent and close to their business units&lt;br /&gt;
*Provides a bridge between incompatible technologies&lt;br /&gt;
*Leverages existing technologies&lt;br /&gt;
*Reduces dependency on custom systems&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, [http://en.wikipedia.org/wiki/Metadata Metadata] (data that describes the actual data) [http://en.wikipedia.org/wiki/Metadata 6] in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README file is metadata that describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA also does not limit the protocol used to transfer the data and a wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
[[Image:SOA_Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
We created this simplified image to illustrate the basic principles of service oriented architectures.  &lt;br /&gt;
* Services may be used by multiple applications.&lt;br /&gt;
* Services do not call on each other.&lt;br /&gt;
* Services communicate via protocols.&lt;br /&gt;
* An example protocol is provided, in which the application passes x to the Sin function, and Sin(x) is returned.&lt;br /&gt;
* Because of the protocol link, services may be written in different programming languages, or even be hosted on different computers with different operating systems, which allows for great flexibility.&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language. [http://en.wikipedia.org/wiki/Metaprogramming 7]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.  From this statement, code is automatically generated that provides a function to write the name (setter) and a function to read the name (getter).&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes on dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
=='''How it is all related and enhances SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture is enhanced when the underlying programs are able to dynamically adapt to the data received. Metaprogramming and Reflection make this possible.&lt;br /&gt;
&lt;br /&gt;
The services in a Service-oriented Architecture make use of the data passed around between them.  If the data passed around represents code, One thought we came with on how metaprogramming and reflection could be useful in a SOA is if the protocol consists of passing code.  For example, a service could &amp;quot;repeat 3 times&amp;quot; and the code passed to it could print &amp;quot;Hello World&amp;quot;.  The application would pass the line saying to print &amp;quot;Hello World&amp;quot; to the service, would then print Hello World three times.  Another more practical example would be a service that examines the code passed to it for security holes.  These examples both make use of metaprogramming and reflection.  One limitation to this concept, however, is that it would limit the code to a specific language.  For example, if a Ruby line: puts &amp;quot;Hello World&amp;quot; is passed into a service written to accept Java code, it will not work properly.  Services and applications would need to talk in the same language in this case, which would, for these applications, take away the benefit that services may be written in different languages.&lt;br /&gt;
&lt;br /&gt;
A second thought we came up with is to send data that reperesents code.  For example, we could pass a message that says print Hello World, and then the service would do that in whatever language it is written in.  The first word could be read, and then the service could call the proper code within itself to meet that request.  This could be accomplished with metaprogramming and reflection.  The message could be analyzed and the method called could be changed based on what function is requested in the message.&lt;br /&gt;
&lt;br /&gt;
The concept of reflection and metaprogramming can be used to extend the services and dynamically modify their behavior.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
An XML metadata schema is extended to include a new tag/value.  This data is now passed around between services, and each service can be extended dynamically to use it.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of reflection&lt;br /&gt;
&lt;br /&gt;
6. http://en.wikipedia.org/wiki/Metadata - Explanation of metadata&lt;br /&gt;
&lt;br /&gt;
7. http://en.wikipedia.org/wiki/Metaprogramming - Explanation of metaprogramming&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25148</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=25148"/>
		<updated>2009-10-10T00:46:09Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: /* '''An overview of the concepts''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article covers the following three goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated.&lt;br /&gt;
#Examines how reflection and metaprogramming supports SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architecture'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished by passing messages [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
SOA offers the following technical advantages:&lt;br /&gt;
*Offers services across platforms&lt;br /&gt;
*Allows services to be split across systems and networks&lt;br /&gt;
*Allows services to be location independent and close to their business units&lt;br /&gt;
*Provides a bridge between incompatible technologies&lt;br /&gt;
*Leverages existing technologies&lt;br /&gt;
*Reduces dependency on custom systems&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, [http://en.wikipedia.org/wiki/Metadata Metadata] (data that describes the actual data) [http://en.wikipedia.org/wiki/Metadata 6] in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README file is metadata that describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA also does not limit the protocol used to transfer the data and a wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
[[Image:SOA_Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
We created this simplified image to illustrate the basic principles of service oriented architectures.  &lt;br /&gt;
* Services may be used by multiple applications.&lt;br /&gt;
* Services do not call on each other.&lt;br /&gt;
* Services communicate via protocols.&lt;br /&gt;
* An example protocol is provided, in which the application passes x to the Sin function, and Sin(x) is returned.&lt;br /&gt;
* Because of the protocol link, services may be written in different programming languages, or even be hosted on different computers with different operating systems, which allows for great flexibility.&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language. [http://en.wikipedia.org/wiki/Metaprogramming 7]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.  From this statement, code is automatically generated that provides a function to write the name (setter) and a function to read the name (getter).&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes on dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
=='''How it is all related'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Enhancing SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture is enhanced when the underlying programs are able to dynamically adapt to the data received. Metaprogramming and Reflection make this possible.&lt;br /&gt;
&lt;br /&gt;
For example, a SOA system might have services located in entirely different locations, maintained by different teams of programmers and written in different programming languages.  A modification to the system could potentially require the different teams, who might be in different physical locations, to coordinate the development and deployment of this enhancement.  This task could turn out to be extremelly difficult to complete, making the process longer and more costly.  It would then be more difficult to justify any change.  &lt;br /&gt;
!!!! How does metaprogramming and reflection address this?&lt;br /&gt;
&lt;br /&gt;
One thought we came with on how metaprogramming and reflection could be useful in a SOA is if the protocol consists of passing code.  For example, a service could &amp;quot;repeat 3 times&amp;quot; and the code passed to it could print &amp;quot;Hello World&amp;quot;.  The application would pass the line saying to print &amp;quot;Hello World&amp;quot; to the service, would then print Hello World three times.  Another more practical example would be a service that examines the code passed to it for security holes.  These examples both make use of metaprogramming and reflection.  One limitation to this concept, however, is that it would limit the code to a specific language.  For example, if a Ruby line: puts &amp;quot;Hello World&amp;quot; is passed into a service written to accept Java code, it will not work properly.  Services and applications would need to talk in the same language in this case, which would, for these applications, take away the benefit that services may be written in different languages.&lt;br /&gt;
&lt;br /&gt;
A second thought we came up with is to send data that reperesents code.  For example, we could pass a message that says print Hello World, and then the service would do that in whatever language it is written in.  The first word could be read, and then the service could call the proper code within itself to meet that request.  This could be accomplished with metaprogramming and reflection.  The message could be analyzed and the method called could be changed based on what function is requested in the message.&lt;br /&gt;
&lt;br /&gt;
The concept of reflection and metaprogramming can be used to extend the services and dynamically modify their behavior.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
An XML metadata schema is extended to include a new tag/value.  This data is now passed around between services, and each service can be extended dynamically to use it.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of reflection&lt;br /&gt;
&lt;br /&gt;
6. http://en.wikipedia.org/wiki/Metadata - Explanation of metadata&lt;br /&gt;
&lt;br /&gt;
7. http://en.wikipedia.org/wiki/Metaprogramming - Explanation of metaprogramming&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=24839</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=24839"/>
		<updated>2009-10-09T23:44:16Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article covers the following three goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated.&lt;br /&gt;
#Examines how reflection and metaprogramming supports SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architecture'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished by passing messages [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, [http://en.wikipedia.org/wiki/Metadata Metadata] (data that describes the actual data) [http://en.wikipedia.org/wiki/Metadata 6] in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README file is metadata that describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA also does not limit the protocol used to transfer the data and a wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
[[Image:SOA_Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
We created this simplified image to illustrate the basic principles of service oriented architectures.  &lt;br /&gt;
* Services may be used by multiple applications.&lt;br /&gt;
* Services do not call on each other.&lt;br /&gt;
* Services communicate via protocols.&lt;br /&gt;
* An example protocol is provided, in which the application passes x to the Sin function, and Sin(x) is returned.&lt;br /&gt;
* Because of the protocol link, services may be written in different programming languages, or even be hosted on different computers with different operating systems, which allows for great flexibility.&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language. [http://en.wikipedia.org/wiki/Metaprogramming 7]&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.  From this statement, code is automatically generated that provides a function to write the name (setter) and a function to read the name (getter).&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes on dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
=='''How it is all related'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Enhancing SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture becomes greatly effective when the underlying programs are able to dynamically adapt to the data received. Metaprogramming and Reflection can be used to make this possible.&lt;br /&gt;
&lt;br /&gt;
For example, a SOA system might have services located in entirely different locations, maintained by different teams of programmers and written in different programming languages.  A modification to the system could potentially require the different teams, who might be in different physical locations, to coordinate the development and deployment of this enhancement.  This task could turn out to be extremelly difficult to complete, making the process longer and more costly, making it more difficult to justify any change.&lt;br /&gt;
&lt;br /&gt;
The concept of reflection and metaprogramming can be used to extend the services and dynamically modify their behavior.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
An XML metadata schema is extended to include a new tag/value.  This data is now passed around between services, and each service can be extended dynamically to use it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of reflection&lt;br /&gt;
&lt;br /&gt;
6. http://en.wikipedia.org/wiki/Metadata - Explanation of metadata&lt;br /&gt;
&lt;br /&gt;
7. http://en.wikipedia.org/wiki/Metaprogramming - Explanation of metaprogramming&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=23305</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=23305"/>
		<updated>2009-10-09T01:07:48Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;!!!! I have copied things that help with formatting the page from my prior wiki.  Feel free to add in anything that you think may help with formatting from your project.&lt;br /&gt;
&lt;br /&gt;
!!!! Main topic (to keep us on track):&lt;br /&gt;
&lt;br /&gt;
!!!! Note: Delete all the !!!! parts when done.  These are notes while developing the wiki.&lt;br /&gt;
&lt;br /&gt;
!!!! SOA provides another view of providing functionality based upon services offered in terms of protocols and a specific API. To provide services, platforms rely upon principles and the power that can be expressed through reflection and meta programming. Research and report how these critical concepts relate to and support SOA.&lt;br /&gt;
&lt;br /&gt;
!!!! Reword the following paragraph to &amp;quot;sound better&amp;quot;.D: I am not sure if it sounds better, but here's my first pass at it. I'm not sure what verb should go in place of 'solve'&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article describes how this is possible and '''solves??''' three goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated.&lt;br /&gt;
#Examines how reflection and metaprogramming supports SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architectures'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished with by passing messages [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
!!!! If we can, find a way to make the footnote in brackets, without brackets will probably work though.&lt;br /&gt;
!!!! Did you intend to say &amp;quot;subroutine calls&amp;quot; above?  I changed it from calls to subroutine calls because the topics did not appear to match.D: yes, that's what I meant, please remove this after reading&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, metadata (data that describes the actual data) in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA also does not limit the protocol used to transfer the data and a wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
!!!! It may be a good idea to add a graphical example of a SOA here&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes on dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
=='''How it is all related'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Enhancing SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture becomes greatly effective when the underlying programs are able to dynamically adapt to the data received.  Two very important concepts support this principles that SOA is build upon:&lt;br /&gt;
&lt;br /&gt;
The concept of reflection can be used to extend the service being provided by a system in a Service-oriented Architecture by allowing the transfered data to modify the behavior.&lt;br /&gt;
&lt;br /&gt;
=='''Appendix'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metadata '''Metadata'''] - data that describes the actual data&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of Reflection&lt;br /&gt;
&lt;br /&gt;
!!!! Remove the title below if we do not have any good external links.&lt;br /&gt;
== Useful External Links ==&lt;br /&gt;
'''&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=23294</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=23294"/>
		<updated>2009-10-09T00:52:41Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;!!!! I have copied things that help with formatting the page from my prior wiki.  Feel free to add in anything that you think may help with formatting from your project.&lt;br /&gt;
&lt;br /&gt;
!!!! Main topic (to keep us on track):&lt;br /&gt;
&lt;br /&gt;
!!!! Note: Delete all the !!!! parts when done.  These are notes while developing the wiki.&lt;br /&gt;
&lt;br /&gt;
!!!! SOA provides another view of providing functionality based upon services offered in terms of protocols and a specific API. To provide services, platforms rely upon principles and the power that can be expressed through reflection and meta programming. Research and report how these critical concepts relate to and support SOA.&lt;br /&gt;
&lt;br /&gt;
!!!! Reword the following paragraph to &amp;quot;sound better&amp;quot;.D: I am not sure if it sounds better, but here's my first pass at it. I'm not sure what verb should go in place of 'solve'&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to design a software system and connect the separate components using services.  Reflection and metaprogramming are two powerful concepts that directly support the principles of SOA.  This article describes how this is possible and '''solves??''' three goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated.&lt;br /&gt;
#Examines how reflection and metaprogramming supports SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architectures'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This is generally accomplished with by passing messages [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
!!!! If we can, find a way to make the footnote in brackets, without brackets will probably work though.&lt;br /&gt;
!!!! Did you intend to say &amp;quot;subroutine calls&amp;quot; above?  I changed it from calls to subroutine calls because the topics did not appear to match.D: yes, that's what I meant, please remove this after reading&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, metadata (data that describes the actual data) in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA also does not limit the protocol used to transfer the data and a wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
!!!! It may be a good idea to add a graphical example of a SOA here&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent example of a metaprogram. It allows the programmer to code in a higher level language and then the compiler will convert that program into machine language.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes on dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
=='''How it is all related'''==&lt;br /&gt;
&lt;br /&gt;
!!!! Explain&lt;br /&gt;
&lt;br /&gt;
=='''Enhancing SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture becomes greatly effective when the underlying programs are able to dynamically adapt to the data received.  Two very important concepts support this principles that SOA is build upon:&lt;br /&gt;
&lt;br /&gt;
#[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] - Programs that write and manipulate other programs&lt;br /&gt;
#The concept of reflection can be used to extend the service being provided by a system in a Service-oriented Architecture by allowing the transfered data to modify the behavior.&lt;br /&gt;
&lt;br /&gt;
=='''Appendix'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metadata '''Metadata'''] - data that describes the actual data&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of Reflection&lt;br /&gt;
&lt;br /&gt;
!!!! Remove the title below if we do not have any good external links.&lt;br /&gt;
== Useful External Links ==&lt;br /&gt;
'''&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=23288</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=23288"/>
		<updated>2009-10-09T00:42:20Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;!!!! I have copied things that help with formatting the page from my prior wiki.  Feel free to add in anything that you think may help with formatting from your project.&lt;br /&gt;
&lt;br /&gt;
!!!! Main topic (to keep us on track):&lt;br /&gt;
&lt;br /&gt;
!!!! Note: Delete all the !!!! parts when done.  These are notes while developing the wiki.&lt;br /&gt;
&lt;br /&gt;
!!!! SOA provides another view of providing functionality based upon services offered in terms of protocols and a specific API. To provide services, platforms rely upon principles and the power that can be expressed through reflection and meta programming. Research and report how these critical concepts relate to and support SOA.&lt;br /&gt;
&lt;br /&gt;
!!!! Reword the following paragraph to &amp;quot;sound better&amp;quot;.D: I am not sure if it sounds better, but here's my first pass at it&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how services can can be used to connect separate software components in a system.  Reflection and metaprogramming are two concepts that directly support the principles of SOA.  This article has three goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated.&lt;br /&gt;
#Examines how reflection and metaprogramming supports SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architectures'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This may be accomplished with the use of messages [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
!!!! If we can, find a way to make the footnote in brackets, without brackets will probably work though.&lt;br /&gt;
!!!! Did you intend to say &amp;quot;subroutine calls&amp;quot; above?  I changed it from calls to subroutine calls because the topics did not appear to match.D: yes, that's what I meant, please remove this after reading&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, metadata (data that describes the actual data) in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA also does not limit the protocol used to transfer the data and a wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
!!!! It may be a good idea to add a graphical example of a SOA here&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] is the writing of computer programs that write other computer programs.  This allows the programmer to complete tasks faster than if (s)he had to code everything manually.  A [http://en.wikipedia.org/wiki/Compiler compiler] is an excellent of a metaprogram, it allows the programmer to code in a higher level language and then the compiler will convert that program into machine language.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create [http://en.wikipedia.org/wiki/Mutator_method 'setters' and 'getters'] for the name attribute via metaprogramming.&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] is a specific type of meta-programming and emphasizes on dynamic program modification.  It is the ability of a programming language to inspect its own code and can therefore be used to extend the language beyond its usual capabilities.  For example, it is possible to use reflection to inspect an object for a desired function and execute it dynamically.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
=='''How it is all related'''==&lt;br /&gt;
&lt;br /&gt;
!!!! Explain&lt;br /&gt;
&lt;br /&gt;
=='''Enhancing SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture becomes greatly effective when the underlying programs are able to dynamically adapt to the data received.  Two very important concepts support this principles that SOA is build upon:&lt;br /&gt;
&lt;br /&gt;
#[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] - Programs that write and manipulate other programs&lt;br /&gt;
#The concept of reflection can be used to extend the service being provided by a system in a Service-oriented Architecture by allowing the transfered data to modify the behavior.&lt;br /&gt;
&lt;br /&gt;
=='''Appendix'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metadata '''Metadata'''] - data that describes the actual data&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of Reflection&lt;br /&gt;
&lt;br /&gt;
!!!! Remove the title below if we do not have any good external links.&lt;br /&gt;
== Useful External Links ==&lt;br /&gt;
'''&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=23282</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=23282"/>
		<updated>2009-10-09T00:26:23Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;!!!! I have copied things that help with formatting the page from my prior wiki.  Feel free to add in anything that you think may help with formatting from your project.&lt;br /&gt;
&lt;br /&gt;
!!!! Main topic (to keep us on track):&lt;br /&gt;
&lt;br /&gt;
!!!! Note: Delete all the !!!! parts when done.  These are notes while developing the wiki.&lt;br /&gt;
&lt;br /&gt;
!!!! SOA provides another view of providing functionality based upon services offered in terms of protocols and a specific API. To provide services, platforms rely upon principles and the power that can be expressed through reflection and meta programming. Research and report how these critical concepts relate to and support SOA.&lt;br /&gt;
&lt;br /&gt;
!!!! Reword the following paragraph to &amp;quot;sound better&amp;quot;.D: I am not sure if it sounds better, but here's my first pass at it&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how services can can be used to connect separate software components in a system.  Reflection and metaprogramming are two concepts that directly support the principles of SOA.  This article has three goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated.&lt;br /&gt;
#Examines how reflection and metaprogramming supports SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architectures'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This may be accomplished with the use of messages [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
!!!! If we can, find a way to make the footnote in brackets, without brackets will probably work though.&lt;br /&gt;
!!!! Did you intend to say &amp;quot;subroutine calls&amp;quot; above?  I changed it from calls to subroutine calls because the topics did not appear to match.D: yes, that's what I meant, please remove this after reading&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, metadata (data that describes the actual data) in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA also does not limit the protocol used to transfer the data and a wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
!!!! It may be a good idea to add a graphical example of a SOA here&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
!!!! Discuss metaprogramming&lt;br /&gt;
!!!! It may be good to include a programming example here&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [2] &lt;br /&gt;
  class Person&lt;br /&gt;
    attr_accessor :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
In the example above, attr_accessor is used to create 'setters' and 'getters' for the 'name' attribute via metaprogramming.&lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
Reflection is a specific type of meta-programming and emphasizes on dynamic program modification.  The concept of reflection can be used to extend the service being provided by a system in a Service-oriented Architecture by allowing the transfered data to modify the behavior.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
=='''How it is all related'''==&lt;br /&gt;
&lt;br /&gt;
!!!! Explain&lt;br /&gt;
&lt;br /&gt;
=='''Enhancing SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture becomes greatly effective when the underlying programs are able to dynamically adapt to the data received.  Two very important concepts support this principles that SOA is build upon:&lt;br /&gt;
&lt;br /&gt;
#[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] - Programs that write and manipulate other programs&lt;br /&gt;
#[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] - Programs that modify their own behavior&lt;br /&gt;
&lt;br /&gt;
=='''Appendix'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metadata '''Metadata'''] - data that describes the actual data&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of Reflection&lt;br /&gt;
&lt;br /&gt;
!!!! Remove the title below if we do not have any good external links.&lt;br /&gt;
== Useful External Links ==&lt;br /&gt;
'''&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=23270</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 va</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_va&amp;diff=23270"/>
		<updated>2009-10-09T00:20:59Z</updated>

		<summary type="html">&lt;p&gt;Ncsueng: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;!!!! I have copied things that help with formatting the page from my prior wiki.  Feel free to add in anything that you think may help with formatting from your project.&lt;br /&gt;
&lt;br /&gt;
!!!! Main topic (to keep us on track):&lt;br /&gt;
&lt;br /&gt;
!!!! Note: Delete all the !!!! parts when done.  These are notes while developing the wiki.&lt;br /&gt;
&lt;br /&gt;
!!!! SOA provides another view of providing functionality based upon services offered in terms of protocols and a specific API. To provide services, platforms rely upon principles and the power that can be expressed through reflection and meta programming. Research and report how these critical concepts relate to and support SOA.&lt;br /&gt;
&lt;br /&gt;
!!!! Reword the following paragraph to &amp;quot;sound better&amp;quot;.D: I am not sure if it sounds better, but here's my first pass at it&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how services can can be used to connect separate software components in a system.  Reflection and metaprogramming are two concepts that directly support the principles of SOA.  This article has three goals:&lt;br /&gt;
#Provides a simple understanding of reflection, metaprogramming, and SOA's.&lt;br /&gt;
#Explains how these concepts are interrelated.&lt;br /&gt;
#Examines how reflection and metaprogramming supports SOA's.&lt;br /&gt;
&lt;br /&gt;
== '''Service Oriented Architecture (SOA), Reflection, and Metaprogramming''' ==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''An overview of the concepts'''==&lt;br /&gt;
&lt;br /&gt;
==='''Service Oriented Architectures'''===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture''] (or SOA) is a concept in computing that defines the interaction of different software in terms of protocols and functionality.  A SOA can be viewed as containing multiple services which may be linked as desired by protocols.  SOA is designed so that each functional unit of software in a system is isolated from each other and provides a service without directly making [http://en.wikipedia.org/wiki/Subroutine subroutine calls] to each other.  This may be accomplished with the use of messages [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
!!!! If we can, find a way to make the footnote in brackets, without brackets will probably work though.&lt;br /&gt;
!!!! Did you intend to say &amp;quot;subroutine calls&amp;quot; above?  I changed it from calls to subroutine calls because the topics did not appear to match.D: yes, that's what I meant, please remove this after reading&lt;br /&gt;
&lt;br /&gt;
The information being used to communicate between services must contain sufficient detail about the characteristic of the data and the data itself and must remain independent of the underlying platform and programming language.  Although SOA does not specify the format to transfer data, programmers have generally used XML for this purpose.  However, metadata (data that describes the actual data) in the SOA must:  [http://en.wikipedia.org/wiki/Service_oriented_architecture 3]&lt;br /&gt;
&lt;br /&gt;
*Be easy to configure&lt;br /&gt;
*Provide an easy way to discover services&lt;br /&gt;
*Provide an easy way to incorporate services&lt;br /&gt;
*Remain coherent&lt;br /&gt;
*Preserve data integrity&lt;br /&gt;
*Be easy to manage&lt;br /&gt;
&lt;br /&gt;
A simple example of metadata is a README file that specifies the inputs and outputs to a program.  The inputs and outputs of the program would be the data, and the README describes this data.&lt;br /&gt;
&lt;br /&gt;
SOA also does not limit the protocol used to transfer the data and a wide variety of technologies can be used including [http://en.wikipedia.org/wiki/SOAP_(protocol) SOAP], [http://en.wikipedia.org/wiki/Representational_State_Transfer REST] and [http://en.wikipedia.org/wiki/Remote_procedure_call RPC].  This is generally left for the programmer of the system.&lt;br /&gt;
&lt;br /&gt;
!!!! It may be a good idea to add a graphical example of a SOA here&lt;br /&gt;
&lt;br /&gt;
==='''Metaprogramming'''===&lt;br /&gt;
&lt;br /&gt;
!!!! Discuss metaprogramming&lt;br /&gt;
!!!! It may be good to include a programming example here&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Metaprogramming in Ruby [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
&lt;br /&gt;
==='''Reflection'''===&lt;br /&gt;
&lt;br /&gt;
Reflection is a specific type of meta-programming and emphasizes on dynamic program modification.  The concept of reflection can be used to extend the service being provided by a system in a Service-oriented Architecture by allowing the transfered data to modify the behavior.&lt;br /&gt;
&lt;br /&gt;
:*'''''Example''': Reflection in Perl [http://en.wikipedia.org/wiki/Reflection_(computer_science) 5] &lt;br /&gt;
  # without reflection&lt;br /&gt;
  my $foo = Foo-&amp;gt;new();&lt;br /&gt;
  $foo-&amp;gt;hello();&lt;br /&gt;
 &lt;br /&gt;
  # with reflection&lt;br /&gt;
  my $class  = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
  my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
  my $object = $class-&amp;gt;new();&lt;br /&gt;
  $object-&amp;gt;$method();&lt;br /&gt;
&lt;br /&gt;
In the example with reflection, $object and $method can be determined and even changed at run time.  This allows the program to change its own behavior.&lt;br /&gt;
&lt;br /&gt;
=='''How it is all related'''==&lt;br /&gt;
&lt;br /&gt;
!!!! Explain&lt;br /&gt;
&lt;br /&gt;
=='''Enhancing SOA'''==&lt;br /&gt;
&lt;br /&gt;
Service-oriented Architecture becomes greatly effective when the underlying programs are able to dynamically adapt to the data received.  Two very important concepts support this principles that SOA is build upon:&lt;br /&gt;
&lt;br /&gt;
#[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming] - Programs that write and manipulate other programs&lt;br /&gt;
#[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] - Programs that modify their own behavior&lt;br /&gt;
&lt;br /&gt;
=='''Appendix'''==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Metadata '''Metadata'''] - data that describes the actual data&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
'''&lt;br /&gt;
1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA&lt;br /&gt;
&lt;br /&gt;
2. Thomas, Dave (2006).  ''Programming Ruby, The Pragmatic Programmers' Guide''.&lt;br /&gt;
&lt;br /&gt;
3. http://en.wikipedia.org/wiki/Service_oriented_architecture - A very detailed explanation of SOA&lt;br /&gt;
&lt;br /&gt;
4. http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html - A more easy to understand explanation of SOA&lt;br /&gt;
&lt;br /&gt;
5. http://en.wikipedia.org/wiki/Reflection_(computer_science) - Explanation of Reflection&lt;br /&gt;
&lt;br /&gt;
!!!! Remove the title below if we do not have any good external links.&lt;br /&gt;
== Useful External Links ==&lt;br /&gt;
'''&lt;/div&gt;</summary>
		<author><name>Ncsueng</name></author>
	</entry>
</feed>