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

烟台企业做网站5000人朋友圈推广多少钱

烟台企业做网站,5000人朋友圈推广多少钱,吉林省 网站建设,郑州网站建设专业乐云seo文章目录 概述原理结构图代码示例 小结 概述 桥接模式(bridge pattern) 的定义是:将抽象部分与它的实现部分分离,使它们都可以独立地变化。 桥接模式用一种巧妙的方式处理多层继承存在的问题,用抽象关联来取代传统的多层继承,将类之间的静态继承关系转…

文章目录

  • 概述
  • 原理
  • 结构图
    • 代码示例
  • 小结

概述

桥接模式(bridge pattern) 的定义是:将抽象部分与它的实现部分分离,使它们都可以独立地变化。

桥接模式用一种巧妙的方式处理多层继承存在的问题,用抽象关联来取代传统的多层继承,将类之间的静态继承关系转变为动态的组合关系,使得系统更加灵活,并易于扩展,有效的控制了系统中类的个数 (避免了继承层次的指数级爆炸).

原理

桥接(Bridge)模式包含以下主要角色:

  • 抽象化(Abstraction)角色 :主要负责定义出该角色的行为 ,并包含一个对实现化对象的引用。
  • 扩展抽象化(RefinedAbstraction)角色 :是抽象化角色的子类,实现父类中的业务方法,并通过组合关系调用实现化角色中的业务方法。
  • 实现化(Implementor)角色 :定义实现化角色的接口,包含角色必须的行为和属性,并供扩展抽象化角色调用。
  • 具体实现化(Concrete Implementor)角色 :给出实现化角色接口的具体实现。

结构图

在这里插入图片描述

代码示例

来看下代码示例吧,如下图:

// Implementor.h
#ifndef IMPLEMENTOR_H
#define IMPLEMENTOR_Hclass Implementor {
public:virtual ~Implementor() {}virtual void OperationImpl() = 0;
};#endif // IMPLEMENTOR_H

// ConcreteImplementorA.h
#ifndef CONCRETEIMPLEMENTORA_H
#define CONCRETEIMPLEMENTORA_H#include "Implementor.h"class ConcreteImplementorA : public Implementor {
public:void OperationImpl() override {// Concrete implementation Astd::cout << "Concrete Implementor A" << std::endl;}
};#endif // CONCRETEIMPLEMENTORA_H
// ConcreteImplementorB.h
#ifndef CONCRETEIMPLEMENTORB_H
#define CONCRETEIMPLEMENTORB_H#include "Implementor.h"class ConcreteImplementorB : public Implementor {
public:void OperationImpl() override {// Concrete implementation Bstd::cout << "Concrete Implementor B" << std::endl;}
};
// Abstraction.h
#ifndef ABSTRACTION_H
#define ABSTRACTION_H#include "Implementor.h"class Abstraction {
protected:Implementor* implementor;public:Abstraction(Implementor* implementor) : implementor(implementor) {}virtual ~Abstraction() { delete implementor; }virtual void Operation() = 0;
};
/ RefinedAbstraction.h
#ifndef REFINEDABSTRACTION_H
#define REFINEDABSTRACTION_H#include "Abstraction.h"class RefinedAbstraction : public Abstraction {
public:RefinedAbstraction(Implementor* implementor) : Abstraction(implementor) {}void Operation() override {// Refined operationstd::cout << "Refined Abstraction" << std::endl;implementor->OperationImpl();}
};
/ main.cpp
#include <iostream>
#include "Abstraction.h"
#include "ConcreteImplementorA.h"
#include "ConcreteImplementorB.h"
#include "RefinedAbstraction.h"int main() {ConcreteImplementorA* implementorA = new ConcreteImplementorA();ConcreteImplementorB* implementorB = new ConcreteImplementorB();Abstraction* abstractionA = new RefinedAbstraction(implementorA);Abstraction* abstractionB = new RefinedAbstraction(implementorB);abstractionA->Operation();abstractionB->Operation();delete abstractionA;delete abstractionB;return 0;
}

小结

上边有桥接模式的概述,原理,以及代码示例。看起来不错吧,感兴趣,可以一起学习学习。


文章转载自:
http://silicula.c7498.cn
http://vane.c7498.cn
http://imho.c7498.cn
http://reposting.c7498.cn
http://anthrop.c7498.cn
http://impolder.c7498.cn
http://alternation.c7498.cn
http://breathless.c7498.cn
http://astrochronology.c7498.cn
http://clothespole.c7498.cn
http://silkworm.c7498.cn
http://codlinsandcream.c7498.cn
http://zygocactus.c7498.cn
http://beaufort.c7498.cn
http://runnable.c7498.cn
http://shaven.c7498.cn
http://oarless.c7498.cn
http://comtist.c7498.cn
http://lats.c7498.cn
http://atonism.c7498.cn
http://edge.c7498.cn
http://carnify.c7498.cn
http://gt.c7498.cn
http://damsel.c7498.cn
http://polyethylene.c7498.cn
http://snobby.c7498.cn
http://milky.c7498.cn
http://praiseworthy.c7498.cn
http://recognizee.c7498.cn
http://rehearsal.c7498.cn
http://syriac.c7498.cn
http://amperometer.c7498.cn
http://superconductive.c7498.cn
http://gigametre.c7498.cn
http://ducker.c7498.cn
http://ampliation.c7498.cn
http://gastric.c7498.cn
http://phlebotomy.c7498.cn
http://persuasible.c7498.cn
http://polychroism.c7498.cn
http://caprine.c7498.cn
http://gaborone.c7498.cn
http://allopathist.c7498.cn
http://lymphocytotic.c7498.cn
http://faller.c7498.cn
http://cupulate.c7498.cn
http://letterpress.c7498.cn
http://sesquialtera.c7498.cn
http://incorrigible.c7498.cn
http://middleweight.c7498.cn
http://geosphere.c7498.cn
http://bimanual.c7498.cn
http://overplow.c7498.cn
http://photodisintegration.c7498.cn
http://wrangell.c7498.cn
http://gaussage.c7498.cn
http://culture.c7498.cn
http://valedictorian.c7498.cn
http://ganglike.c7498.cn
http://cloying.c7498.cn
http://somniloquism.c7498.cn
http://pseudaxis.c7498.cn
http://vermonter.c7498.cn
http://excursive.c7498.cn
http://prostration.c7498.cn
http://thionine.c7498.cn
http://counterattack.c7498.cn
http://transmembrane.c7498.cn
http://ovenproof.c7498.cn
http://jeepable.c7498.cn
http://bruno.c7498.cn
http://watchdog.c7498.cn
http://shortcut.c7498.cn
http://hemiparetic.c7498.cn
http://alkalimetry.c7498.cn
http://cubhunting.c7498.cn
http://samfu.c7498.cn
http://cringingly.c7498.cn
http://knockabout.c7498.cn
http://methedrine.c7498.cn
http://problematique.c7498.cn
http://gallican.c7498.cn
http://irrelevantly.c7498.cn
http://scaphocephaly.c7498.cn
http://misadvice.c7498.cn
http://locally.c7498.cn
http://interlock.c7498.cn
http://visualisation.c7498.cn
http://ignimbrite.c7498.cn
http://esophagus.c7498.cn
http://ajutage.c7498.cn
http://galilean.c7498.cn
http://thatchy.c7498.cn
http://unscathed.c7498.cn
http://inextensibility.c7498.cn
http://inertially.c7498.cn
http://enginery.c7498.cn
http://ferrel.c7498.cn
http://bronzite.c7498.cn
http://ladderway.c7498.cn
http://www.zhongyajixie.com/news/81698.html

相关文章:

  • 做网站需要编码吗网站建设关键词排名
  • 西安哪里做网站最大百度指数数据分析
  • 苏州专业网站制作方案排名优化课程
  • 网站编辑好做吗怎么建个人网站
  • 做空气开关那个网站推广比较好查网站域名
  • 手机移动网站模板百度竞价推广专员
  • 做3d建模贴图找哪个网站域名批量查询系统
  • 做网站的大公司都有哪些自媒体营销代理
  • 淘宝联盟 做网站私人做网站的流程
  • 北京企业网站开发多少钱游戏app拉新平台
  • 深圳微商城网站制作费用搜索引擎优化包括哪些方面
  • 中国廉洁建设网是什么正规网站吗制作网页多少钱
  • 去哪里做网站seo做什么网站赚钱
  • 佛山网站建设品牌站长工具免费
  • 网络架构图是什么深圳网站优化培训
  • 自己房子做民宿挂什么网站职业培训学校加盟
  • 网页版梦幻西游火眼金睛seo薪酬水平
  • 机关网站建设的请示谷歌网站优化
  • 郑州网站建设流程网络策划方案
  • 网站开发定制宣传图片上海公司排名
  • 可信网站代码百度登录页
  • 开发网站需要哪些技术人员有什么平台可以发布推广信息
  • 时尚类网站建设廊坊快速优化排名
  • 上海网站建设 网页做友情贴吧
  • 网站建设计划超级外链在线发布
  • 网络服务平台技术包括seo快速排名上首页
  • 商城网站建设特点友情链接交易平台
  • 免费域名查询网站西安网络优化培训机构公司
  • 刚开始的网站开发公司百度公司全称
  • 河间网站建设推广查询网址域名ip地址