DRY:
a principle in software
development and design
Presenter:
Neda Zia
A software design or development principle ,
is a basic tool or technique
that can be applied to designing
or writing code...
Every piece of knowledge must have a
single, unambiguous, authoritative representation within a
system.
Andy Hunt, Dave To...
Evils of Duplication
• Imposed duplication
• Inadvertent duplication
• Impatient duplication
• Interdeveloper duplication
Imposed duplication
• Multiple representation of information
• Documentation in code
• Documentation and code
• Language i...
Inadvertent duplication
class line {
private:
Point start;
Point end;
double length;
};
Inadvertent duplication
class line {
private:
Point start;
Point end;
double length() {
return start.distanceTo(end);
};
};
Inadvertent duplication
class line {
private:
bool changed;
double length;
Point start;
Point end;
public:
void setStart(P...
Impatient Duplication
“shortcuts make for long delays”
Interdeveloper Duplication
We need a good communication !
I will not repeat myself
I will not repeat myself
I will not repeat myself
I will not repeat myself
I will not repeat myse...
Upcoming SlideShare
Loading in …5
×

Dry

403 views

Published on

A short introduction to DRY,A principle in software development and design
Adopted from "The Pragmatic Programmer", By Andy Hunt and Dave Tomas

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
403
On SlideShare
0
From Embeds
0
Number of Embeds
147
Actions
Shares
0
Downloads
10
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Dry

  1. 1. DRY: a principle in software development and design Presenter: Neda Zia
  2. 2. A software design or development principle , is a basic tool or technique that can be applied to designing or writing code to make that code more maintainable, flexible, or extensible
  3. 3. Every piece of knowledge must have a single, unambiguous, authoritative representation within a system. Andy Hunt, Dave Tomas The Pragmatic Programmer DRY: Don’t Repeat Yourself !
  4. 4. Evils of Duplication • Imposed duplication • Inadvertent duplication • Impatient duplication • Interdeveloper duplication
  5. 5. Imposed duplication • Multiple representation of information • Documentation in code • Documentation and code • Language issues
  6. 6. Inadvertent duplication class line { private: Point start; Point end; double length; };
  7. 7. Inadvertent duplication class line { private: Point start; Point end; double length() { return start.distanceTo(end); }; };
  8. 8. Inadvertent duplication class line { private: bool changed; double length; Point start; Point end; public: void setStart(Point p){start=p;changed=true;} void setEnd(Point p){end=p;changed=true;} Point getStart(void){return start;} Point getEnd(void){return end;} double getLenght(){ If (changed){ Length= start.distanceTo(end); Changed=false; } Return length; } };
  9. 9. Impatient Duplication “shortcuts make for long delays”
  10. 10. Interdeveloper Duplication We need a good communication !
  11. 11. I will not repeat myself I will not repeat myself I will not repeat myself I will not repeat myself I will not repeat myself I will not repeat myself I will not repeat myself

×