现在的位置: 首页 > 综合 > 正文

杂记:设计模式的适用性,设计模式与类库框的不同.各种理解误区.学习方法论..

2013年10月29日 ⁄ 综合 ⁄ 共 1920字 ⁄ 字号 评论关闭

经常有人死吹精通设计模式,确理不清什么是设计模式。个人感觉很多东西和下棋一样,几分钟学会,一辈子去精通。这里摘取几句,解释一下。

类库,框架与设计模式的适用性区分

1  libraries and frameworks go a long way towards a development model where we can just pick and choose components and plug them right in . bug .. they don't help us structure our own applications in ways that are easier to understand ,more maintainable and flexible that's where design patterns come in.

 

2 design patterns are higher level than libraies design patterns tell us how to structure classed and objects to solve certain problems and it is our job to adapt those designs to fit our particular application.

 

3 frameworks and libraries are not design paterns they provide specific implementations that we link into our code sometimes however libraries and frameworks make use of design patterns in their implementations that's great because once you understand design patterns ,you 'll quikly.understand APIs that are structured around design patterns

 

杂记:不要以为了解了oo 的基础就可以自动的building 灵活可重用,易维护的代码.remember knowing concepts like abstraction inheritance and polymorphism do not make you a good object oriented designer.

 

bullet points knowing the oo basics dose not make you a good oo designer.

good oo designs are reusable ,extensible and maintainable

patterns show you how to build systems with good oodesign qualities.

patterns are proven object oriedted experience

patterns don't give you code ,they give you general solutions to design problems you apply them to your specific application.

most patterns and priciples address issues of change in software

most patterns allow some part of a system to vary independently of all other parts

we often try to take what varies in a system and encapsulate it

patterns provide a shared language that can maximize the value of you communication with other developers

 

杂记: 方法。

don't miss out when something interstiong happens!

we 've got a pattern that keeps your objects in the know when something the might care about happens objects can even decide at runtime whether they want to be kept informed the observer pattern is one of the most heavily use patterns in the JDK and it's incredibly useful before we're down we 'll also look at one to many relationships and loose coupling with observer you 'll be the life of the patterns party..

抱歉!评论已关闭.