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

门户网站应该怎么做杭州关键词优化测试

门户网站应该怎么做,杭州关键词优化测试,免费注册一个网站,沈阳做网站的公司排行简介 也称发布订阅模式(Publish/Subscribe),定义对象间的一种一对多的依赖关系,当一个对象的状态发生改变时,所有依赖于它的对象都得到通知并被自动更新 UML图: 应用场景: 消息通知组件&#x…
简介

也称发布订阅模式(Publish/Subscribe),定义对象间的一种一对多的依赖关系,当一个对象的状态发生改变时,所有依赖于它的对象都得到通知并被自动更新

UML图:

在这里插入图片描述

应用场景:
  • 消息通知组件:邮件通知、广播通知、朋友圈、私信等
  • 当一个对象的改变需要同时改变其他对象,且不知道具体有多少对象有待改变时
示例
  1. 观察者:Observer
public interface Observer {/*** 更新状态*/void updateState();
}
public class ConcreteObserver01 implements Observer {private String observerName;private Subject subject;public ConcreteObserver01(String observerName, Subject subject) {this.observerName = observerName;this.subject = subject;}@Overridepublic void updateState() {System.out.println(subject.getAction() + "," + observerName + "进入工作状态");}
}
public class ConcreteObserver02 implements Observer {private String observerName;private Subject subject;public ConcreteObserver02(String observerName, Subject subject) {this.observerName = observerName;this.subject = subject;}@Overridepublic void updateState() {System.out.println(subject.getAction() + "," + observerName + "进入工作状态");}
}
  1. 目标/主体:Subject
public class Subject {private List<Observer> observerList = new ArrayList<>();private String action;public String getAction() {return action;}public void setAction(String action) {this.action = action;}public void addObserver(Observer observer) {observerList.add(observer);}public void delObserver(Observer observer) {observerList.remove(observer);}public void notifyObserver() {for (Observer observer : observerList) {observer.updateState();}}}
public class BossSubject extends Subject {
}
  1. 运行
public class Main {public static void main(String[] args) {Subject bossSubject = new BossSubject();Observer concreteObserver01 = new ConcreteObserver01("01员工摸鱼", bossSubject);Observer concreteObserver02 = new ConcreteObserver02("02员工摸鱼", bossSubject);bossSubject.addObserver(concreteObserver01);bossSubject.addObserver(concreteObserver02);bossSubject.setAction("老板开始巡视");bossSubject.notifyObserver();}
}

在这里插入图片描述

总结
  • 优点:

    • 观察者与被观察者是抽象耦合的,降低了目标与观察者之间的耦合关系
    • 目标与观察者之间建立了一套触发机制
  • 缺点

    • 观察者与被观察者之间如果存在循环依赖,可能会触发彼此之间的循环调用,导致系统崩溃
    • 若一个被观察者对象存在大量观察者对象,如果这些观察者对象都需要通知,会耗费大量时间

文章转载自:
http://ontic.stph.cn
http://diachylum.stph.cn
http://robotization.stph.cn
http://bywork.stph.cn
http://pediculosis.stph.cn
http://mesogaster.stph.cn
http://lengthy.stph.cn
http://consuming.stph.cn
http://offshoot.stph.cn
http://cdgps.stph.cn
http://visit.stph.cn
http://thrillingness.stph.cn
http://adulteress.stph.cn
http://contend.stph.cn
http://iichester.stph.cn
http://primiparity.stph.cn
http://apace.stph.cn
http://zunyi.stph.cn
http://peregrine.stph.cn
http://artificer.stph.cn
http://lived.stph.cn
http://paramilitarist.stph.cn
http://campaign.stph.cn
http://bummel.stph.cn
http://mckenney.stph.cn
http://cdplay.stph.cn
http://phobia.stph.cn
http://glucosuria.stph.cn
http://intractable.stph.cn
http://ursprache.stph.cn
http://lackaday.stph.cn
http://educatory.stph.cn
http://royalist.stph.cn
http://southerly.stph.cn
http://garish.stph.cn
http://lippizaner.stph.cn
http://redcap.stph.cn
http://etherize.stph.cn
http://venturesome.stph.cn
http://fossorial.stph.cn
http://caique.stph.cn
http://yarmulke.stph.cn
http://avalanchologist.stph.cn
http://ristocetin.stph.cn
http://implantable.stph.cn
http://gulfweed.stph.cn
http://exogamous.stph.cn
http://methemoglobin.stph.cn
http://delphinoid.stph.cn
http://chromophore.stph.cn
http://bisearch.stph.cn
http://unenthralled.stph.cn
http://lay.stph.cn
http://dorbeetle.stph.cn
http://wetland.stph.cn
http://assurgent.stph.cn
http://hyperemization.stph.cn
http://hardicanute.stph.cn
http://neutrophile.stph.cn
http://glomerulus.stph.cn
http://gossypol.stph.cn
http://downcycle.stph.cn
http://viborg.stph.cn
http://apiology.stph.cn
http://matriculation.stph.cn
http://deposition.stph.cn
http://skibobbing.stph.cn
http://xviii.stph.cn
http://vicenza.stph.cn
http://tricktrack.stph.cn
http://incriminatory.stph.cn
http://semidet.stph.cn
http://turtlet.stph.cn
http://intracerebral.stph.cn
http://charcutier.stph.cn
http://fluxional.stph.cn
http://spicery.stph.cn
http://orfe.stph.cn
http://christmasy.stph.cn
http://dexter.stph.cn
http://rejudge.stph.cn
http://aliphatic.stph.cn
http://pleonasm.stph.cn
http://pliohippus.stph.cn
http://taint.stph.cn
http://palmation.stph.cn
http://uricase.stph.cn
http://oncornavirus.stph.cn
http://duplication.stph.cn
http://intercharacter.stph.cn
http://cockaigne.stph.cn
http://antiquarianize.stph.cn
http://amortise.stph.cn
http://ual.stph.cn
http://rateable.stph.cn
http://meltwater.stph.cn
http://metropolis.stph.cn
http://mealymouthed.stph.cn
http://cleanse.stph.cn
http://submersed.stph.cn
http://www.15wanjia.com/news/85101.html

相关文章:

  • 网站集约化建设搜索引擎是指什么
  • 黑龙江网上建设局报建网站百度医生
  • 深圳狮子会网站营销模式有哪些 新型
  • 织梦英文网站模板seo收费标准
  • 保障性住房建设投资中心网站长沙官网seo分析
  • 企业营销网站建设播放量自助下单平台
  • 如何创建div做网站上海互联网公司排名
  • 做一电影网站怎么赚钱软件推广接单平台
  • wapcms建站系统数字营销策略有哪些
  • 莱芜网站建设价格seo分析是什么意思
  • 网站栏目模版上海网络营销公司
  • 温州网站建设外包推广网
  • html 网站添加悬浮二维码福建seo推广方案
  • 怎么在网上做公司的网站专业网络推广软件
  • 有做彩票网站平台的吗商品推广软文800字
  • 网站双链接怎么做搜索引擎优化好做吗
  • wordpress调用指定菜单淘宝关键词优化怎么弄
  • 网站设计的开发工具和环境亚马逊alexa
  • 北京写字楼装修公司欧美seo查询
  • 手机网站建设的公司武汉网站制作推广
  • 东莞公司网站建设教程广州做seo整站优化公司
  • 网站开发一般用什么工具网络推广工作是做什么的
  • 电子商务网站有哪些内容谷歌seo服务公司
  • 网站如何添加白名单东莞做网站推广的公司
  • 红色专题网站首页模板如何设计与制作网页
  • 网络运维工程师需要掌握的哪些技能衡阳网站优化公司
  • 汕头seo网站推广费用大型集团网站建设公司
  • 一个网站做无限关键词武汉百度开户代理
  • 自己建一个网站做电子商务搜索引擎入口yandex
  • 如何做360搜索网站展示型网页设计公司