Why and how to design routines of class
2008-04-23 20:01
423 查看
Why to design routines? The most improtant reason is reducing complexity. When you create a routine, you don't need to know the implementation. When you want to change another algorithm, you just modify this routine. Also, there are some other reasons to create routines:
(1). improve class readable.
(2). avoid duplicate code.
etc.
The cohesion conpect shows that class is well designed or not. Cohesion is at the routine level. So, we should design routines as cohesion as possible. The important is that one routine should has one function/operation.
(1). improve class readable.
(2). avoid duplicate code.
etc.
The cohesion conpect shows that class is well designed or not. Cohesion is at the routine level. So, we should design routines as cohesion as possible. The important is that one routine should has one function/operation.
相关文章推荐
- (Page 1 of 3 )A walking tour of JavaBeans What JavaBeans is, how it works, and why you want to use it
- How to design DL model(2):Inception(v4)-ResNet and the Impact of Residual Connections on Learning
- How to inspect who is caller of func and who is the class of instance
- (Page 2 of 3 )A walking tour of JavaBeans 2 :What JavaBeans is, how it works, and why you want to use it
- how to design a good api and why it matters
- (Page 3 of 3 )A walking tour of JavaBeans What JavaBeans is, how it works, and why you want to use it
- How to Design a Good API and Why it Matters(转)
- The Defining Decade-Why Your Twenties Matter--And How to Make the Most of Them Now
- How to Design a Good API and Why it Matters
- How to Design a Good API and Why it Matters
- How to subclass CListBox and CEdit inside of CComboBox
- 为何以及如何使用Netlink Socket ( Why and How to Use Netlink Socket)
- how to get Class of primitive datatypes array . Class.forName(int[]) throws exception
- How to hide my site and my document link in the right-top corner of sharepoint 2010
- How to SUM and GROUP BY of JSON data?
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)--ch05
- How to optimize memory usage and bundle size of a Cocos2D app
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)—ch07-I
- How to check firmware and drivers of a VMware ESXi host
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)--ch09