CSC/ECE 517 Fall 2009/wiki3 4 br: Difference between revisions

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




[http://en.wikipedia.org/wiki/DRY ''DRY'' 3] (or Don't Repeat Yourself) describes ...
__TOC__


== '''DRY principle for data''' ==
=='''An overview of the concepts'''==


__TOC__
[http://en.wikipedia.org/wiki/DRY ''DRY''] (or Don't Repeat Yourself) is a software engineering principle that says that "every piece of knowledge must have a single, unambiguous, authoritative representation within a system" [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.


=='''An overview of the concepts'''==


==='''Don't Repeat Yourself'''===
==='''Don't Repeat Yourself'''===
Line 33: Line 32:
=='''References'''==
=='''References'''==
'''
'''
1.  
1. http://en.wikipedia.org/wiki/DRY


2.  
2.  

Revision as of 01:58, 9 November 2009

Topic: DRY principle for data 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.


An overview of the concepts

DRY (or Don't Repeat Yourself) is a software engineering principle that says that "every piece of knowledge must have a single, unambiguous, authoritative representation within a system" [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.


Don't Repeat Yourself

File:DRY.jpg


DRY principle - related to code

  • Example: DRY
 class Person
   attr_accessor :name
 end

DRY principle - related to data

DRY principle - bad when used with data

DRY principle - good when used with data

Conclusion

References

1. http://en.wikipedia.org/wiki/DRY

2.

3.

4.

5.

6.

7.

8.

9.