摘要:单例模式目的:Ensure a class only has one instance, and provide a global point of access toit.保证一个类仅有一个实例,并提供一个访问它的全局访问点。C++实现在类中,定义一个私有静态成员对象;将构造函数也定义为私有的,保...
阅读全文
摘要:原型模式目的:Specify the kinds of objects to create using a prototypical instance, and createnew objects by copying this prototype.用原型实例指定创建对象的种类,并且通过拷贝这些原型...
阅读全文
摘要:建造者目的:Separate the construction of a complex object from its representation so thatthe same construction process can create different representations....
阅读全文
摘要:一、问题的提出现假设需要生产两种产品或创建两个对象,我们一般的方法如下代码所示://protoProduct.hclass ProductA{public: virtual void operation();};class ProductB{public: virtual void op...
阅读全文
摘要:一 Java开发工具包JDK 下载地址:到ORACLE公司官方网站(http://www.oracle.com/)下载1 官方下载JDK开发包 开发包分为java se ,java ee java me版,一般下载se(标准版) Java SE Development Kit 7u60 130M...
阅读全文
摘要:基本Makefile假设现在有3个文件,file2.h是函数声明,file2.c是函数定义,文件file1.c调用file2.c中的函数。则Makefile文件的编写如下:helloworld:file1.o file2.o gcc file1.o file2.o -o helloworldf...
阅读全文
摘要:shell字符串、shell数组、shell echo指令、shell test命令、shell if语句、shell case语句、shell for语句、shell while语句、shell break语句、shell 函数第一个Shell脚本#!/bin/bash# this is your...
阅读全文