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

永久免费crm都有什么谷歌seo网站优化

永久免费crm都有什么,谷歌seo网站优化,阿里巴巴国际站运营教程,目录型搜索引擎有哪些1 组合模式: 整体-部分模式,它是一种将对象组合成树状层次结构的模式,用来表示整体和部分的关系,使用户对单个对象和组合对象具有一致的访问性,属于结构型设计模式 1.1 特点: 组合模式使得客户端代码可以一致的处理单个对象和组合对象更容易在组合体内加入新的对象,客户端不…

1 组合模式:

整体-部分模式,它是一种将对象组合成树状层次结构的模式,用来表示整体和部分的关系,使用户对单个对象和组合对象具有一致的访问性,属于结构型设计模式

1.1 特点:

  1. 组合模式使得客户端代码可以一致的处理单个对象和组合对象
  2. 更容易在组合体内加入新的对象,客户端不会因为加入新的对象而改变原代码,满足''开闭原则''

1.2 缺点:

  1. 设计较复杂,客户端需要花更多的时间理清类之间的关系
  2. 不容易限制容器中的构建
  3. 不容易用继承的方法来增加构件的新功能 

1.3 结构:

  1. 抽象构件角色:
  2. 树叶构件角色:
  3. 树枝构件角色/中间构件: 

1.4 组合模式分为透明式的组合模式和安全式的组合模式。 

  1. 透明式:抽象构件声明了所有子类中的全部方法,客户端无需区别树叶对象和树枝对象
  2. 安全式:将管理子构件的方法移到树枝构件中,抽象构件和树叶构件没有对子对象的管理方法

1.5 代码实现

透明模式

public class CompositePattern {public static void main(String[] args) {Component c0 = new Composite();Component c1 = new Composite();Component leaf1 = new Leaf("1");Component leaf2 = new Leaf("2");Component leaf3 = new Leaf("3");c0.add(leaf1);c0.add(c1);c1.add(leaf2);c1.add(leaf3);c0.operation();}
}
//抽象构件
interface Component {public void add(Component c);public void remove(Component c);public Component getChild(int i);public void operation();
}
//树叶构件
class Leaf implements Component {private String name;public Leaf(String name) {this.name = name;}public void add(Component c) {}public void remove(Component c) {}public Component getChild(int i) {return null;}public void operation() {System.out.println("树叶" + name + ":被访问!");}
}
//树枝构件
class Composite implements Component {private ArrayList<Component> children = new ArrayList<Component>();public void add(Component c) {children.add(c);}public void remove(Component c) {children.remove(c);}public Component getChild(int i) {return children.get(i);}public void operation() {for (Object obj : children) {((Component) obj).operation();}}
}
树叶1:被访问!
树叶2:被访问!
树叶3:被访问!

安全模式

interface Component {public void operation();
}
public class CompositePattern {public static void main(String[] args) {Composite c0 = new Composite();Composite c1 = new Composite();Component leaf1 = new Leaf("1");Component leaf2 = new Leaf("2");Component leaf3 = new Leaf("3");c0.add(leaf1);c0.add(c1);c1.add(leaf2);c1.add(leaf3);c0.operation();}
}

http://www.zhongyajixie.com/news/63441.html

相关文章:

  • 去哪个网站做农产品推广太原seo推广
  • 企业类网站有哪些百度竞价关键词质量度怎么提升
  • 东营网站建设制作seo快速排名软件平台
  • 个体做敦煌网站怎么样什么软件可以发布广告信息
  • 南京网站设计公司兴田德润放心网站网络推广公司
  • 建筑公司做网站的好处上海优化外包
  • 盐城做网站哪家最好大连网站搜索排名
  • 徐州网站开发哪个好薇2021小说排行榜百度风云榜
  • 龙华建设局网站自己如何制作一个小程序
  • 备案做电影网站吗百度广告开户
  • 宜春网站建设公司哪家好推广产品引流的最佳方法
  • 广东河源疫情通报网站的优化与推广分析
  • 做网站该注意哪些基本要素怎么制作网站教程
  • 网络公关团队最新seo视频教程
  • 如何快速写一个网站台州百度推广优化
  • 做电子书网站 赚钱seo综合查询站长工具关键词
  • 家装设计一般用什么软件潮州seo建站
  • 网站老提示有风险网络整合营销公司
  • 郴州网站建设的公司杭州做网站的公司排行
  • 网站建设基本知识怎么让关键词快速排名首页
  • 厦门大型网站设计公司网络优化工程师前景如何
  • 阅读分享网站模板咸宁网站seo
  • 武汉做网站需要多少钱搜索竞价
  • 一个主机可以放几个网站太原做网站推广的公司
  • php综合网站建设论文google搜索引擎入口
  • 建设学院实验网站的作用阿里指数数据分析平台官网
  • 分类信息网站发布标题网络营销知名企业
  • 雅安市建设局网站seo服务外包报价
  • wordpress怎么可以出现表格张家口网站seo
  • 莲花网站网站信息组织优化