关闭

★Object Oriented Design Tips

624人阅读 评论(0) 收藏 举报

Object Oriented Design Tips

(http://www.eventhelix.com/RealtimeMantra/Object%5FOriented/object_design_tips.htm)

 

  1. Stay close to problem domain
  2. Object discovery vs. object invention
  3. Pick nouns or noun phrases as classes
  4. Method names should contain a verb
  5. Prefix adjectives when naming inheriting classes
  6. Do not add suffixes to class names
  7. Avoid one-to-one mapping from structured design
  8. Replace multiple get-set methods with operations
  9. Model classes that handle messages as state machines
  10. Use const whenever possible
  11. Restrict header file level dependency
  12. Don't reinvent the wheel; use STL

 

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:158535次
    • 积分:2762
    • 等级:
    • 排名:第12993名
    • 原创:117篇
    • 转载:30篇
    • 译文:0篇
    • 评论:8条
    文章分类
    最新评论