Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Design Pattern & UML  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:GOF<<design patterns>>读后感,请各位评 [Re:zyzhang]
haibo



CJSDN高级会员


发贴: 322
积分: 71
于 2004-05-26 10:35 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
zyzhang wrote:
The benefit i got from the design patterns is that they are encourage me to be aware and respect the OO principals on the design of the complex product. The ideas behind the design patterns are related to the design consideration of extensibility, resuability, and etc. These design elements are important when you build complex product from scratch.

Refactoring is XP term, and integrate in the daily development cycle of software process. Good refactoring can result in design patterns(if you can recognize them). This is XP way to compliment the lack of design consideration when you directly go into the coding. So, Refactoring and design patterns are related, and they all are derived from the OO Principles.

Most of the current development environment are built on the high levle of well-known framework. Generally, you give little consideration on the low level design consideration, all you effort are focus on the understanding of the framework and implementing business logic. So, in this case, few design patterns are fall into the developers' eyes.

Design patterns actually help me a lot in the past year. They help me be more sensitive on the problem context and consider using pattern to build the structure of related objects, even though sometime, it's better to make your own variation on the design pattern, but the idea is essentially the same. Also, design patterns are good communication method for the team.

I can imagine, one can ignore the design patterns if you have strong and deep understanding on the OO Principals, also you have good abstract ability and some best practices in your mind.but most of us are not, design patterns instead give us good description on the solution of the common problems.

......

昨晚花了我较长时间,读了你的这篇回复和你以前的一篇和floater的交流--“design patterns and refactoring"。 首先,我对您严谨的发帖原则表示尊敬,这确实是当前cjd论坛法帖典范,对一个问题的充足说明足见作者的郑重。

回去后,我重新细读了第一个模式abstract factory,作者确实给出了一个demo和详细地说明, 我只是觉得如果让我来解决这个MazeGame的problem的话,我可能有我自己的解法,也许用到了这个所谓的“abstract factory" 模式的"半条腿”,但是这样的解法却也遵循OO princple,当然随着extend这个解法,可能会形成一个完整的"abstract factory". 如果从来没有可能去用到这“半条腿”,突然去接受这个“整个家伙”,却觉得不自然,没有经历的问题,没有深刻理解他的巧妙 之处的人,也不可能在实际开发中实践应用它的“机会”。
所以我说这本书的“推理过程”不够好。

再一个就是我说的“先出现接口,后出现实现责任的对象”之说。 面对一个新的project,我们首先可能想象到的就是我们的“目标应用”--程序,要为我们作些什么, so 我们定义一些接口,随之在一步一步的细化时,我们可能寻找一个对象来充当这个责任,继儿也就出现了对象,随后定义这个对象需要完成这些操作而需要持有的数据,相应的在细化完整个系统之后,完整的BMD(Business Module Diagrame) 就随之浮现。这是个由最高级的抽象到最底层的实现的过程。

题外话:这种想法很符合现实,举个例子:想开个公司,你需要一个经理人,你定义个“接口”,凡是 满足这个接口的人就可以来应聘,这个对象也就出现了,他所有的“知识”就相当于类的“数据成员”,继而也就确定了,同样经理人再去聘人来组织一个公司,当然,你不用关心这些细节,你--“总裁”(软件中相当于客户)只要关心一个人做的事,那就是--“经理”。你不应该直接去找公关小姐,秘书,职员,主任,这些“现实”的人,你找来了也未必会适合“经理”的要求,经理也就未必会做出你期望的事情,而此时,你连你希望的事情是什么都不全面--多么可怕


话说回来,MazeGame确是不同的,wall,door,room实体类一开始就冒出来了,显然已经hardcode了好多东东。 这就是我说它的“颠倒”的思维方法。

但是,总体而言,并不因为这些小缺点而影响它正部书的不错。我觉得整部书的模式一上去对一个经验不多的人像我,就取读,去接受,会束缚思想,认识不到它的巧妙之处, 也就形不成“自己的东东”。在你思考了好久之后,突然的看看它,会觉得灵机突现,会认识到它的精深,这样才会“挥洒自如,游刃有余”。





话题树型展开
人气 标题 作者 字数 发贴时间
12580 GOF<<design patterns>>读后感,请各位评 haibo 336 2004-05-24 10:54
10503 Re:GOF<<design patterns>>读后感,请各位评 wes109 15 2004-05-24 11:17
10650 Re:GOF<<design patterns>>读后感,请各位评 ConnorLv 29 2004-05-24 15:38
10900 Re:GOF<<design patterns>>读后感,请各位评 haibo 54 2004-05-24 18:00
10551 Re:GOF<<design patterns>>读后感,请各位评 wes109 552 2004-05-25 08:56
10806 Re:GOF<<design patterns>>读后感,请各位评 haibo 1069 2004-05-25 09:46
10476 Re:GOF<<design patterns>>读后感,请各位评 wes109 594 2004-05-25 10:34
10481 Re:GOF<<design patterns>>读后感,请各位评 floater 479 2004-05-24 23:31
10821 Re:GOF<<design patterns>>读后感,请各位评 haibo 288 2004-05-25 11:17
10414 Re:GOF<<design patterns>>读后感,请各位评 wes109 174 2004-05-25 12:53
10486 Re:GOF<<design patterns>>读后感,请各位评 zyzhang 1757 2004-05-25 17:56
10777 Re:GOF<<design patterns>>读后感,请各位评 haibo 2996 2004-05-26 10:35
11061 Re:GOF<<design patterns>>读后感,请各位评 sankxuan 101 2004-05-26 21:24

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923