- 博客(11)
- 资源 (4)
- 收藏
- 关注
转载 c++ 设计模式9 (Abstract Factory 抽象工厂模式)
转自http://www.cnblogs.com/wangxiaobao/p/5222863.html5.2 抽象工厂模式动机:在软件系统中,经常面临着“一系列相互依赖的对象”的创建工作;同时,由于需求的变化,往往存在更多系列对象的创建工作。 代码示例:实现利用数据库的业务逻辑,支持多数据库(Sql,Oracle等),有连接、命令、读取等功能。其中命令,连接功能之间有相互联系。方法一(使用工厂方法...
2018-03-30 17:11:05 135
转载 c++ 设计模式8 (Factory Method 工厂方法)
转自http://www.cnblogs.com/wangxiaobao/p/5211414.html5. “对象创建”类模式通过“对象创建”类模式绕开new,来避免对象创建(new)过程中所导致的紧耦合(依赖具体类),从而支持对象创建的稳定。它是接口抽象之后的第一步工作。5.1 工厂方法动机:在软件系统中,经常面临着创建对象的工作;由于需求的变化,需要创建的对象的具体类型经常变化。如何应对这种变...
2018-03-30 17:08:57 142
转载 c++ 设计模式7 (Bridge 桥模式)
转自http://www.cnblogs.com/wangxiaobao/p/5208448.html4.2 Bridge 桥模式动机: 由于某些类型的固有的实现逻辑,使得它们具有两个变化的维度,乃至多个变化的维度。 代码示例:实现一个Messager,含有基本功能PlaySound,Connect等,并有PC、Mobile不同的平台实现 和 精简、完美等不同业务功能的版本实现方法1:Bridge...
2018-03-30 17:07:13 235
转载 c++ 设计模式6 (Decorator 装饰模式)
转自http://www.cnblogs.com/wangxiaobao/p/5203010.html4. “单一职责”类模式在软件组件的设计中,如果责任划分的不清晰,使用继承得到的结果往往是随着需求的变化,子类急剧膨胀,同时充斥着重复代码,这时候的关键是划清责任。典型模式代表: Decorator,Bridge 4.1 Decorator 装饰模式 代码示例:不同的流操作(文件流,网络流,内存流...
2018-03-30 17:06:04 135
转载 c++ 设计模式5 (Observer / Event 观察者模式)
转自http://www.cnblogs.com/wangxiaobao/p/5201820.html3.3 观察者模式 (Observer)/发布-订阅模式动机:在软件构建过程中,我们需要为某些对象建立一种“通知依赖关系”——一个对象(目标对象)的状态发生改变,所有的依赖对象(观察者对象)都能得到通知。如果这样的依赖关系过于紧密,将使得软件不能很好地抵御变化。使用面向对象技术,可以将这种依赖关系...
2018-03-30 17:03:49 142
转载 c++ 设计模式4 (Strategy)
转自http://www.cnblogs.com/wangxiaobao/p/5200021.html3.2 Strategy (策略模式)动机:在软件构建过程中,某些对象使用的算法可能多种多样,经常改变,如果将这些算法都编码到对象中,将会使对象变得异常复杂,而且有时候支持不使用或不常使用的算法也是一个性能负担。如何在运行时根据需要透明地改变对象的算法?将算法和对象本身解耦,从而避免上述问题? 代...
2018-03-30 17:02:28 108
转载 c++ 设计模式3 (重构技法 Template Method)
转自http://www.cnblogs.com/wangxiaobao/p/5153261.html1. 重构面向对象设计模式是“好的面向对象设计”,所谓“好的面向对象设计”指的是那些可以满足“应对变化,提高复用”的设计。 设计模式的要点是“寻找变化点,然后在变化点处应用设计模式,从而更好地理解需求的变化”“什么时候、什么地点应设计模式”比“理解设计模式结构本身”更为重要。 设计模式的应用不宜先...
2018-03-30 17:01:07 195
转载 C++ 设计模式2 (面向对象设计原则)
转自http://www.cnblogs.com/wangxiaobao/p/5142331.html1. 变化是复用的天敌! 面向对象设计的最大优势在于 : 抵御变化 2. 重新认识面向对象理解隔离变化:从宏观层面来看,面向对象的构建方式更能适应软件的变化,能将变化所带来的影响减为最小。 各司其职:从微观层面来看,面向对象的方式更强调各个类的”责任“(代码示例中,各个类型图形,各自实现自己...
2018-03-30 16:58:58 146
转载 c++ 设计模式1
原创链接:http://www.cnblogs.com/wangxiaobao/p/5141710.html从面向对象谈起1)底层思维:向下,如何把握及其底层,从微观理解对象构造 (语言构造、编译转换、内存模型、运行时机制)抽象思维: 向上,如何将我们的周围世界抽象为程序代码 (面向对象、组件封装、设计模式、架构模式) 2)深入理解面向对象 向下: 深入理解三大面...
2018-03-30 16:57:07 113
转载 GCC静态编译
GCC文章转自:https://www.cnblogs.com/tianyajuanke/p/3359100.html一、简介:gcc 最初是 "GNU C Compiler" 的简称,只是当作一个 C 语言的编译器,现在已经变成了 "GNU Compiler Collection",可以编译多种语言。 二、编译的四个阶段:在使
2018-01-05 17:54:22 15329
转载 error: start and/or end address not on sector boundary解决
error: start and/or end address not on sector boundary解决norflash一般分成几个sector:环境变量,自举,内核,应用软件出现这个问题的原因是,在uboot中定义了flash的sector,而flash的擦除是按照sector来进行的,定义的sector不对。可以用flinfo这个命令查看flash的sect
2014-12-18 16:15:59 1419
spcaview-20071224.tar.gz
2016-02-03
gperf-3.0.4.tar.gz
2013-12-23
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人