- 博客(16)
- 资源 (3)
- 收藏
- 关注
原创 装饰模式
原型模式(Prototype Pattern)定义:Specify the kinds of objects to create using a prototypical instance,and create new objects by copying this prototype.(用原型实例指定创建对象的种类,并且通过拷贝这些原型创建新的对象。)...
2020-06-23 16:58:58 84
原创 sql优化
SELECT * 效率低一、效率低的原因1. 不需要的列会增加数据传输时间和网络开销2. 对于无用的大字段,如 varchar、blob、text,会增加 io 操作3. 失去MySQL优化器“覆盖索引”策略优化的可能性
2020-06-18 19:21:17 130
原创 centos7 httpd目录访问
首先,需要有一个http的服务器。在centos里面,我们只需要执行:yum install httpd看到安装完成之后,我们执行:httpd -version如果能看到输出的版本信息,则说明安装成功。这时,可以尝试启动一些服务器,service httpd start如果出现“address already in use”则我们需要修改我们的端口,进入:/etc/httpd/conf/httpd.conf可以修改服务器名称和端口:ServerName localhos...
2020-06-16 19:39:01 1455
原创 Centos 用户
1. 修改用户名usermod -l 新名 旧名id 旧用户名 # 不存在id 新用户名 # 显示用户名、组等信息2 . 修改组名groupmod -n 新组名 旧组名id 新用户名 # 显示用户名、组等信息3. 修改新用户在/home中的目录名usermod -d /home/目录名 -m 新用户名id 新用户名 # 显示用户名、组等信息...
2020-06-15 19:35:44 109
原创 责任链模式
责任链模式定义:Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request.Chain the receiving objects and pass the request along the chain until an object handles it.(使多个对象都有机会处理请求,从而避免了请求的发送者和接受者之间的耦合关系
2020-06-15 17:43:37 124
原创 命令模式
命令模式定义:Encapsulate a request as an object,thereby letting you parameterize clients with different requests,queue or log requests,and support undoable operations.(将一个请求封装成一个对象,从而让你使用不同的请求把客户端参数化,对请求排队或者记录请求日志,可以提供命令的撤销和恢复功能。)● Receive接收者角色该角色就是干活的角色,命
2020-06-15 15:48:28 106
原创 centos7启动iptables时报
centos7启动iptables时报Job for iptables.service failed because the control process exited with error cod service iptables start报错如下:Job for iptables.service failed because the control process exited with error code. See "systemctl status iptables.se.
2020-06-14 12:56:23 175
原创 中介者模式
中介者模式定义:Define an object that encapsulates how a set of objects interact.Mediator promotes loose coupling by keeping objects from referring to each other explicitly,and it lets you vary their interaction independently.(用一个中介对象封装一系列的对象交互,中介者使各对象不需要显示地相互作用
2020-06-12 14:45:56 104
原创 原型模式
原型模式(Prototype Pattern)定义:Specify the kinds of objects to create using a prototypical instance,and create new objects by copying this prototype.(用原型实例指定创建对象的种类,并且通过拷贝这些原型创建新的对象。)原型模式通用代码:public class PrototypeClass implements Cloneable{ //覆.
2020-06-12 09:35:20 82
原创 代理模式
代理模式(Proxy Pattern)定义:Provide a surrogate or placeholder for another object to control access to it.(为其他对象提供一种代理以控制对这个对象的访问。一个类代表另一个类的功能。这种类型的设计模式属于结构型模式)主要解决:在直接访问对象时带来的问题,比如说:要访问的对象在远程的机器上。在面向对象系统中,有些对象由于某些原因(比如对象创建开销很大,或者某些操作需要安全控制,或者需要进程外的访问),直接访问会
2020-06-11 16:46:44 148
原创 模板方法模式
模板方法模式(Template Method Pattern)定义:Define the skeleton of an algorithm in an operation,deferring some steps to subclasses.Template Method lets subclasses redefine certain steps of an algorithm withou...
2020-06-11 10:21:00 15
原创 建造者模式
建造者模式(Builder Pattern)定义:Separate the construction of a complex object from its representation so that the same construction process can create different representations.(将一个复杂对象的构建与它的表示分离,使得同样的构建过程可以创建不同的表示。)● Product产品类通常是实现了模板方法模式,也就是有模板方法和基本方法,例子
2020-06-09 19:56:54 108
原创 模板模式
模板方法模式(Template Method Pattern)定义:Define the skeleton of an algorithm in an operation,deferring some steps to subclasses.Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.(定义一个操作中的算法的框架,而将一些
2020-06-09 19:46:47 100
原创 抽象工厂模式
(Abstract Factory Pattern)定义:Provide an interface for creating families of related or dependent objects without specifying their concrete classes.(为创建一组相关或相互依赖的对象提供一个接口,而且无须指定它们的具体类。)抽象工厂模式通用类图:抽象工厂模式通用源码类图:抽象工厂类代码:(1)创建相关接口:public class Pro
2020-06-01 19:58:54 88
原创 工厂模式
工厂模式概述: 工厂模式具体包括了简单工厂、工厂方法、抽象工厂,它们是按照从简单到复杂的顺序排列的,属于设计模式中的创建型,其中简单工厂并不属于GOF的23中模式。但是它是理解其它的工厂模式的一个很好的基础,所以很多人在讲述设计模式的时候会提到简单工厂模式。创建型模式关注的是对象的创建,创建型模式将创建对象的过程进行了抽象,也可以理解为将创建对象的过程进行了封装,作为客户程序仅仅需要去使用对象,而不再关心创建对象过程中的逻辑。定义:定义一个用于创建对象的接口,让子类决定实例化哪一个类。..
2020-06-01 19:09:49 116
原创 单例模式
单例模式(Singleton Pattern)定义:确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例。模式要求:一个类有且仅有一个实例,并且提供了一个全局的访问点通用代码:(是线程安全的)1)饿汉式(线程安全,调用效率高。但是,不能延时加载。)public class Singleton { private static final Singleton singleton = new Singleton();//限制产生多个对象 private
2020-06-01 18:16:55 265
Introduction.rar
2020-08-20
ThreadTest.rar
2020-08-20
asp.net中导出Execl的方法
2011-04-28
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人