您的位置:首页 > 其它

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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐