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

贷款网站织梦模板源码网站重构方案

贷款网站织梦模板源码,网站重构方案,wordpress导入error 500,中国联通网站备案及ip地址备案管理要求1 组合模式: 整体-部分模式,它是一种将对象组合成树状层次结构的模式,用来表示整体和部分的关系,使用户对单个对象和组合对象具有一致的访问性,属于结构型设计模式 1.1 特点: 组合模式使得客户端代码可以一致的处理单个对象和组合对象更容易在组合体内加入新的对象,客户端不…1 组合模式: 整体-部分模式,它是一种将对象组合成树状层次结构的模式,用来表示整体和部分的关系,使用户对单个对象和组合对象具有一致的访问性,属于结构型设计模式 1.1 特点: 组合模式使得客户端代码可以一致的处理单个对象和组合对象更容易在组合体内加入新的对象,客户端不会因为加入新的对象而改变原代码,满足开闭原则 1.2 缺点: 设计较复杂,客户端需要花更多的时间理清类之间的关系不容易限制容器中的构建不容易用继承的方法来增加构件的新功能  1.3 结构: 抽象构件角色:树叶构件角色:树枝构件角色/中间构件:  1.4 组合模式分为透明式的组合模式和安全式的组合模式。  透明式:抽象构件声明了所有子类中的全部方法,客户端无需区别树叶对象和树枝对象安全式:将管理子构件的方法移到树枝构件中,抽象构件和树叶构件没有对子对象的管理方法 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 ArrayListComponent children new ArrayListComponent();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.hkea.cn/news/14280907/

相关文章:

  • 网络文学网站开发黄埔区建设局网站
  • 怎样做电商惠州网站关键字优化
  • 网站制作难吗wordpress导航栏制作教程
  • 免费聊天软件不收费网站优化 保定
  • h56wcom什么网站网站建设公司如何规避风险
  • 做网站服务器在哪买wordpress 安装主题 无法创建目录
  • 石家庄专业网站设计印刷 网站源码
  • seo网站建设 大时代一级a做爰片手机电影网站
  • 郑州网站建设html5痘痘怎么去除有效果
  • 特卖网站怎么做网站建设公司yu
  • 儿童教育网站源码外链兔
  • 福田网站网页设计wordpress谷歌加速插件
  • 企查查企业在线查询纯静态网站seo
  • 乐清网站制作电话动漫制作专业学校排名
  • 福田企业网站优化有用吗建筑设计网站大全网站
  • 网站开发 与 网页设计的区别网站怎么维护更新
  • 网站建设汇编资料wordpress 精致博客
  • 做礼品贸易好的网站黄页网络的推广软件下载
  • 做招聘网站做服务器多少钱外贸网站如何建设
  • 建设部网站电话唯品会网站建设的目标
  • 股票做空网站wordpress 用svn checkout
  • 免费门户网站模板图书馆建设网站
  • 网站制作设计机构中国最新消息新闻
  • 长春汽开区建设局网站360怎么做网站
  • 学校网站 模板济南企业自助建站
  • 体育用品网站模板网站里面的视频功能怎么做
  • 珠海市官网网站建设平台免费网络验证
  • 做网站大概一个月多少工资中国建设交易信息网站
  • 服务器运行一段时间网站打不开四川住房建设厅网站首页
  • 住房城乡建设部门户网站主页公司注册网上核名官网