您的位置:首页 > 其它

框架和设计模式之间的区别

2016-10-31 21:15 218 查看
<div class="zm-editable-content clearfix" style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">框架、设计模式这两个概念总容易被混淆,其实它们之间还是有区别的。框架通常是代码重用,而设计模式是设计重用,架构则介于两者之间,部分代码重用,部分设计重用,有时分析也可重用。在软件生产中有三种级别的重用:内部重用,即在同一应用中能公共使用的抽象块;代码重用,即将通用模块组合成库或工具集,以便在多个应用和领域都能使用;应用框架的重用,即为专用领域提供通用的或现成的基础结构,以获得最高级别的重用性。</div><div class="zm-editable-content clearfix" style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">
    框架与设计模式虽然相似,但却有着根本的不同。设计模式是对在某种环境中反复出现的问题以及解决该问题的方案的描述,它比框架更抽象;框架可以用代码表示,也能直接执行或复用,而对模式而言只有实例才能用代码表示;设计模式是比框架更小的元素,一个框架中往往含有一个或多个设计模式,框架总是针对某一特定应用领域,但同一模式却可适用于各种应用。可以说,框架是软件,而设计模式是软件的知识。</div><div class="zm-editable-content clearfix" style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">
框架模式有哪些?
MVC、<a target=_blank target="_blank" href="http://blog.csdn.net/wang15061955806/article/details/52932237" class=" wrap external" rel="nofollow noreferrer" style="color: rgb(51, 102, 153); text-decoration: none;">MTV<span class="icon-external" style="font-family: FontAwesome; font-style: italic; text-decoration: inherit; -webkit-font-smoothing: antialiased;"></span></a>、<a target=_blank target="_blank" href="http://blog.csdn.net/wang15061955806/article/details/52932237" class=" wrap external" rel="nofollow noreferrer" style="color: rgb(51, 102, 153); text-decoration: none;">MVP<span class="icon-external" style="font-family: FontAwesome; font-style: italic; text-decoration: inherit; -webkit-font-smoothing: antialiased;"></span></a>、<a target=_blank target="_blank" href="http://blog.csdn.net/wang15061955806/article/details/52932237" class=" wrap external" rel="nofollow noreferrer" style="color: rgb(51, 102, 153); text-decoration: none;">CBD<span class="icon-external" style="font-family: FontAwesome; font-style: italic; text-decoration: inherit; -webkit-font-smoothing: antialiased;"></span></a>、<a target=_blank target="_blank" href="http://blog.csdn.net/wang15061955806/article/details/52932237" class=" wrap external" rel="nofollow noreferrer" style="color: rgb(51, 102, 153); text-decoration: none;">ORM<span class="icon-external" style="font-family: FontAwesome; font-style: italic; text-decoration: inherit; -webkit-font-smoothing: antialiased;"></span></a>等等;</div><div class="zm-editable-content clearfix" style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">
框架有哪些?
<a target=_blank target="_blank" href="http://blog.cs
4000
dn.net/wang15061955806/article/details/52932237" class=" wrap external" rel="nofollow noreferrer" style="color: rgb(51, 102, 153); text-decoration: none;">C++<span class="icon-external" style="font-family: FontAwesome; font-style: italic; text-decoration: inherit; -webkit-font-smoothing: antialiased;"></span></a>语言的QT、MFC、gtk,<a target=_blank target="_blank" href="http://blog.csdn.net/wang15061955806/article/details/52932237" class=" wrap external" rel="nofollow noreferrer" style="color: rgb(51, 102, 153); text-decoration: none;">Java<span class="icon-external" style="font-family: FontAwesome; font-style: italic; text-decoration: inherit; -webkit-font-smoothing: antialiased;"></span></a>语言的<a target=_blank target="_blank" href="http://blog.csdn.net/wang15061955806/article/details/52932237" class=" wrap external" rel="nofollow noreferrer" style="color: rgb(51, 102, 153); text-decoration: none;">SSH<span class="icon-external" style="font-family: FontAwesome; font-style: italic; text-decoration: inherit; -webkit-font-smoothing: antialiased;"></span></a> 、<a target=_blank target="_blank" href="http://blog.csdn.net/wang15061955806/article/details/52932237" class=" wrap external" rel="nofollow noreferrer" style="color: rgb(51, 102, 153); text-decoration: none;">SSI<span class="icon-external" style="font-family: FontAwesome; font-style: italic; text-decoration: inherit; -webkit-font-smoothing: antialiased;"></span></a>,<a target=_blank target="_blank" href="http://blog.csdn.net/wang15061955806/article/details/52932237" class=" wrap external" rel="nofollow noreferrer" style="color: rgb(51, 102, 153); text-decoration: none;">php<span class="icon-external" style="font-family: FontAwesome; font-style: italic; text-decoration: inherit; -webkit-font-smoothing: antialiased;"></span></a>语言的 smarty(MVC模式),<a target=_blank target="_blank" href="http://blog.csdn.net/wang15061955806/article/details/52932237" class=" wrap external" rel="nofollow noreferrer" style="color: rgb(51, 102, 153); text-decoration: none;">python<span class="icon-external" style="font-family: FontAwesome; font-style: italic; text-decoration: inherit; -webkit-font-smoothing: antialiased;"></span></a>语言的django(MTV模式)等等</div><div class="zm-editable-content clearfix" style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">
设计模式有哪些?
<a target=_blank target="_blank" href="http://blog.csdn.net/wang15061955806/article/details/52932237" class=" wrap external" rel="nofollow noreferrer" style="color: rgb(51, 102, 153); text-decoration: none;">工厂模式<span class="icon-external" style="font-family: FontAwesome; font-style: italic; text-decoration: inherit; -webkit-font-smoothing: antialiased;"></span></a>、适配器模式、策略模式等等</div><div class="zm-editable-content clearfix" style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">
简而言之:框架是大智慧,用来对软件设计进行分工;设计模式是小技巧,对具体问题提出解决方案,以提高代码复用率,降低耦合度。</div>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: