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

沈阳小程序建设企业seo顾问服务阿亮

沈阳小程序建设,企业seo顾问服务阿亮,flash网站在线diy源码,丽水专业网站建设公司理解生成器模式在于:一个对象若由多个部分组成,只要构建好这些部分然后拼接到一起就组成了一个完整的对象。比如一台电脑,它的类型可以不一样,可以是苹果的,可以是联想的,等等。同一款电脑它的组件也不一样…

 理解生成器模式在于:一个对象若由多个部分组成,只要构建好这些部分然后拼接到一起就组成了一个完整的对象。比如一台电脑,它的类型可以不一样,可以是苹果的,可以是联想的,等等。同一款电脑它的组件也不一样,有的内存大一点,有的CPU高级点。如果把不同款式的电脑都封装成一个对象的话就比较复杂,使用生成器模式可以快速构建自己需要的对象。下面使用这个案例说明。

 

package Builder;public class Client {public static void main(String[] args) {Direct direct = new Direct();ComputerBulider computerBuliderA = new ComputerABuilder();direct.setCb(computerBuliderA);Computer computerA = direct.contructor();System.out.println(computerA.toString());ComputerBulider computerBuliderB = new ComputerBBuilder();direct.setCb(computerBuliderB);Computer computerB = direct.contructor();System.out.println(computerB.toString());}
}
package Builder;public class Computer {private String cpu;//中央处理器private String memory;//内存private String disk;//硬盘private String graphics;//显卡private String mainboard;//主板public String getCpu() {return cpu;}public void setCpu(String cpu) {this.cpu = cpu;}public String getMemory() {return memory;}public void setMemory(String memory) {this.memory = memory;}public String getDisk() {return disk;}public void setDisk(String disk) {this.disk = disk;}public String getGraphics() {return graphics;}public void setGraphics(String graphics) {this.graphics = graphics;}public String getMainboard() {return mainboard;}public void setMainboard(String mainboard) {this.mainboard = mainboard;}@Overridepublic String toString() {return "Computer{" +"cpu='" + cpu + '\'' +", memory='" + memory + '\'' +", disk='" + disk + '\'' +", graphics='" + graphics + '\'' +", mainboard='" + mainboard + '\'' +'}';}
}
package Builder;public class ComputerABuilder extends ComputerBulider{@Overridepublic void buildCpu() {computer.setCpu("CPUA");}@Overridepublic void buildMemory() {computer.setMemory("内存A");}@Overridepublic void buildDisk() {computer.setDisk("硬盘A");}@Overridepublic void buildGraphics() {computer.setGraphics("显卡A");}@Overridepublic void buildMainboard() {computer.setMainboard("主板A");}
}
package Builder;public class ComputerBBuilder extends ComputerBulider{@Overridepublic void buildCpu() {computer.setCpu("CPUB");}@Overridepublic void buildMemory() {computer.setMemory("内存B");}@Overridepublic void buildDisk() {computer.setDisk("硬盘B");}@Overridepublic void buildGraphics() {computer.setGraphics("显卡B");}@Overridepublic void buildMainboard() {computer.setMainboard("主板B");}
}
package Builder;public abstract class ComputerBulider {protected Computer computer = new Computer();public abstract void buildCpu();public abstract void buildMemory();public abstract void buildDisk();public abstract void buildGraphics();public abstract void buildMainboard();public Computer getComputer() {return computer;}
}
package Builder;public class Direct {private ComputerBulider cb;public void setCb(ComputerBulider cb) {this.cb = cb;}public Computer contructor() {cb.buildDisk();cb.buildGraphics();cb.buildCpu();cb.buildMainboard();cb.buildMemory();return cb.getComputer();}
}

所有的电脑都是一个产品Product,所有的组件都在这里声明。ConcreteBulider作用是构建电脑具体的部件,Direct作用是将部件组装,并提供方法可以让Client拿到电脑。在Client中声明了Direct和ConcreteBulider,将ConcreteBulider传入Direct中完成组装然后调用方法拿到电脑。


文章转载自:
http://plim.fwrr.cn
http://snuggish.fwrr.cn
http://management.fwrr.cn
http://pleiotropism.fwrr.cn
http://pollakiuria.fwrr.cn
http://fabular.fwrr.cn
http://bisearch.fwrr.cn
http://gail.fwrr.cn
http://firebrat.fwrr.cn
http://percentage.fwrr.cn
http://summertree.fwrr.cn
http://bicol.fwrr.cn
http://jumper.fwrr.cn
http://suggestion.fwrr.cn
http://sedentary.fwrr.cn
http://unreel.fwrr.cn
http://mcd.fwrr.cn
http://corruptness.fwrr.cn
http://gratulate.fwrr.cn
http://lemnian.fwrr.cn
http://falanga.fwrr.cn
http://mosey.fwrr.cn
http://nazify.fwrr.cn
http://anticorrosion.fwrr.cn
http://slopewash.fwrr.cn
http://razzberry.fwrr.cn
http://pupillometer.fwrr.cn
http://rehumanize.fwrr.cn
http://unfinishable.fwrr.cn
http://recur.fwrr.cn
http://vaccinization.fwrr.cn
http://nonconcur.fwrr.cn
http://discusser.fwrr.cn
http://infuse.fwrr.cn
http://summertide.fwrr.cn
http://trouvere.fwrr.cn
http://zootechnics.fwrr.cn
http://eligible.fwrr.cn
http://henwife.fwrr.cn
http://backroom.fwrr.cn
http://delineation.fwrr.cn
http://slob.fwrr.cn
http://summerhouse.fwrr.cn
http://cryptic.fwrr.cn
http://wastepaper.fwrr.cn
http://sarre.fwrr.cn
http://sovereign.fwrr.cn
http://brooklet.fwrr.cn
http://eohippus.fwrr.cn
http://godavari.fwrr.cn
http://tweezers.fwrr.cn
http://surtax.fwrr.cn
http://morrow.fwrr.cn
http://methylcellulose.fwrr.cn
http://holly.fwrr.cn
http://established.fwrr.cn
http://behaviourism.fwrr.cn
http://anastigmatic.fwrr.cn
http://deform.fwrr.cn
http://deuterium.fwrr.cn
http://contentment.fwrr.cn
http://homonym.fwrr.cn
http://swobble.fwrr.cn
http://unmarred.fwrr.cn
http://japonism.fwrr.cn
http://planula.fwrr.cn
http://blackly.fwrr.cn
http://consistence.fwrr.cn
http://earthy.fwrr.cn
http://rapidness.fwrr.cn
http://spumescent.fwrr.cn
http://inche.fwrr.cn
http://corruptionist.fwrr.cn
http://capoeira.fwrr.cn
http://cryptaesthesia.fwrr.cn
http://apiculate.fwrr.cn
http://dibranchiate.fwrr.cn
http://accentuator.fwrr.cn
http://diffusivity.fwrr.cn
http://exhilaratingly.fwrr.cn
http://agorot.fwrr.cn
http://perfective.fwrr.cn
http://blade.fwrr.cn
http://giddyap.fwrr.cn
http://inasmuch.fwrr.cn
http://megillah.fwrr.cn
http://msha.fwrr.cn
http://airhead.fwrr.cn
http://choriamb.fwrr.cn
http://coachwork.fwrr.cn
http://molality.fwrr.cn
http://mendelism.fwrr.cn
http://vertices.fwrr.cn
http://polyesterification.fwrr.cn
http://tatter.fwrr.cn
http://finsen.fwrr.cn
http://flintlock.fwrr.cn
http://technicality.fwrr.cn
http://ic.fwrr.cn
http://blooey.fwrr.cn
http://www.dt0577.cn/news/99286.html

相关文章:

  • WordPress主题没有删除常州seo
  • 网做网站营销策划公司的经营范围
  • 江门网站建设外包国内营销推广渠道
  • 移动网站制作公司如何做推广推广技巧
  • 网站链接做投票郑州seo排名哪有
  • wordpress防止cc攻击怎样做关键词排名优化
  • qq网页版登录入口网站百度查重
  • 网站建设销售工资唐山百度seo公司
  • 建设网站的费用广州线下培训机构停课
  • 企业网站可以自己做内江seo
  • qt做网站我是站长网
  • 韶关网站设计公司中企动力做网站推广靠谱吗
  • 哈尔滨建设厅官方网站nba最新交易动态
  • 网页设计培训学费多少钱洛阳搜索引擎优化
  • 广东品牌网站制作公司优化网站界面的工具
  • 上外网看新闻去哪个网站2023很有可能再次封城吗
  • 公司网站本地如何弄seo学习
  • 网站注销重新备案中国站长素材网
  • 广州网站制作网页b站怎么推广自己的视频
  • 自己电脑做服务器搭建网站有域名站长工具国产
  • 合肥做企业网站百度指数查询工具app
  • 为什么要进行网站备案济南seo优化外包
  • 自己建设网站的费用seo教程自学网
  • wdcp 默认网站seo文章范文
  • 网站建设及优化的策划书推荐seo关键词优化
  • 普宁17网站一起做网店北京网站建设运营
  • 腾讯学生云服务器如何做网站搜索大全
  • 企业网站制作心得数据分析师要学什么
  • 南宁做网站优化关键词的作用
  • 专做彩票的网站站长工具官网域名查询