当前位置: 首页 > news >正文

石家庄网站建设案例网页编辑软件哪个好

石家庄网站建设案例,网页编辑软件哪个好,济南建设信用网,高端网站建设机构Gof23 设计模式,也叫Gang of Four(GoF)设计模式,是由四位设计模式大师(Erich Gamma、Richard Helm、Ralph Johnson 和 John Vlissides)撰写的一本书——《设计模式:可复用面向对象软件的基础》所…

Gof23 设计模式,也叫Gang of Four(GoF)设计模式,是由四位设计模式大师(Erich Gamma、Richard Helm、Ralph Johnson 和 John Vlissides)撰写的一本书——《设计模式:可复用面向对象软件的基础》所引起的热潮,它提出了23种软件设计模式,这些模式可以帮助开发人员更好地理解、设计和实现一个软件系统。

这23种模式分为三类:创建型模式(Creational Patterns)、结构型模式(Structural Patterns)和行为型模式(Behavioral Patterns)。

创建型模式:

1. 工厂方法模式(Factory Method)

2. 抽象工厂模式(Abstract Factory)

3. 单例模式(Singleton)

4. 建造者模式(Builder)

5. 原型模式(Prototype)

结构型模式:

1. 适配器模式(Adapter)

2. 桥接模式(Bridge)

3. 组合模式(Composite)

4. 装饰器模式(Decorator)

5. 外观模式(Facade)

6. 享元模式(Flyweight)

7. 代理模式(Proxy)

行为型模式:

1. 责任链模式(Chain of Responsibility)

2. 命令模式(Command)

3. 解释器模式(Interpreter)

4. 迭代器模式(Iterator)

5. 中介者模式(Mediator)

6. 备忘录模式(Memento)

7. 观察者模式(Observer)

8. 状态模式(State)

9. 策略模式(Strategy)

10. 模板方法模式(Template Method)

11. 访问者模式(Visitor)

以下是各个模式的代码 Demo:

工厂方法模式:

public interface FruitFactory {Fruit getFruit();
}public class AppleFactory implements FruitFactory {@Overridepublic Fruit getFruit() {return new Apple();}
}public class OrangeFactory implements FruitFactory {@Overridepublic Fruit getFruit() {return new Orange();}
}抽象工厂模式:public interface FruitFactory {Fruit getFruit();Juice getJuice();
}public class AppleFactory implements FruitFactory {@Overridepublic Fruit getFruit() {return new Apple();}@Overridepublic Juice getJuice() {return new AppleJuice();}
}public class OrangeFactory implements FruitFactory {@Overridepublic Fruit getFruit() {return new Orange();}@Overridepublic Juice getJuice() {return new OrangeJuice();}
}单例模式:public class Singleton {private static Singleton instance;private Singleton() {}public static Singleton getInstance() {if (instance == null) {instance = new Singleton();}return instance;}
}建造者模式:public class ComputerBuilder {private Computer computer;public ComputerBuilder() {this.computer = new Computer();}public ComputerBuilder setCpu(String cpu) {this.computer.setCpu(cpu);return this;}public ComputerBuilder setRam(String ram) {this.computer.setRam(ram);return this;}public ComputerBuilder setStorage(String storage) {this.computer.setStorage(storage);return this;}public Computer build() {return this.computer;}
}原型模式:public class Prototype implements Cloneable {private String name;public Prototype(String name) {this.name = name;}@Overridepublic Object clone() throws CloneNotSupportedException {return super.clone();}public String getName() {return name;}public void setName(String name) {this.name = name;}
}
http://www.yayakq.cn/news/518133/

相关文章:

  • 建设端午节网站的目的主题建网站 绑定域名 网址
  • 网站建设代理商电话免费下载的视频网站
  • 优化大师班级优化大师网站内部优化是什么意思
  • 性价比高的seo网站优化如何网络推广新产品
  • 心理网站建设策划书滕州本地网站建设
  • 给小企业做网站多少钱优化大师win7
  • 网站开发交易空间站对接
  • 网站做一个多少钱wordpress所有页面都显示不出来
  • 怎么检测网站是否安全wordpress图片放大
  • 烟台网站制作策划wordpress cdn 腾讯云
  • 网站建设费用预算表、wordpress编辑器媒体库
  • 百度最容易收录的网站在线制作头像文字图片
  • wordpress全站音乐地方门户网站的发展
  • 达州住房和城乡建设部网站重庆市建筑工程信息网官网
  • 河南省鹤壁市住房和城乡建设局网站wordpress dux主题会员中心
  • 搜狗整站优化网站建设参考网站的说明书
  • 好的国内网站建设公司久久建筑网图集下载
  • 视频网站怎样做永修建设局网站
  • 用哪个程序做网站收录好wordpress双语安装
  • 商场网站开发教程网站开发项目工作分解
  • 服务网站备案wordpress移动端显示图片
  • 北京建站公司推荐首推万维科技wap网站开发用什么语言
  • 柳州网站建设psn118东莞vi设计公司排名
  • 网站商品图片怎么做免费书画网站模板
  • seo关键词挖掘工具网站内页怎样做优化
  • 用什么软件做网站模板灌南县建设局网站
  • 建众智业公司简介优化营商环境 提升服务效能
  • 假的建设银行网站asp 课程教学网站开发
  • 网站建设的优势wordpress开发手册下载
  • 国外网站建设什么价格云南省建设厅官方网站证书