CSE687 - Object Oriented Design

Design Note #5
Display Information, not Data

Revised: 4/28/2011
Home Courses Code Handouts CoreTech Books Articles Math Research Masters Projects SWDev WebDev News OtherLinks SiteDesign Graduates AllPages Office Hours Notices

CSE681-SWMAA CSE686-IP CSE687-OOD CSE775-DO CSE776-DP CSE778-AWP CSE784-SWS

Cncp #01 Cncp #02 Cncp #03 Cncp #04 Cncp #05 Cncp #06 Cncp #07 Cncp #08 Cncp #09 Cncp #10 Cncp #11
Note #01 Note #02 Note #03 Note #04 Note #05 Note #06 Note #07 Note #08
Lang #01 Lang #02 Lang #03 Lang #04

Syllabus SG - Design SG - Templates SG - Class Relationships

Design Note #5:

Display Information, not Data
image file not found

Example of Information put out by the Anal program we use to analyze your project code.
This is a small part of the complete output.


Conclusions for: Extract Function instead of Cut and Paste

Cut and paste makes lots of little islands of duplicated code. When you find a bug in one of those, you may have pasted that in, perhaps several, other forgotten places.
  1. If you partition carefully you probably won't often be tempted to cut and paste because the design has already been well factored.
  2. Since design foresight is not perfect, there will be times when you need the same functionality in two or more places. Don't cut and paste intending to go back later and fix. Chances are you won't.