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

怎么建立一个简易的网站线上宣传推广方式

怎么建立一个简易的网站,线上宣传推广方式,百度引擎提交入口,wordpress获取分类下所有文章建造者模式概念模拟实现建造者模式代码实现 建造者模式 首先先大体了解一下,建造者模式是什么意思,它是怎么实现的? 首先,建造者模式是一种创建型设计模式再一个它是使用多个简单的对象一步一步的搭建出一个复杂的对象它可以将一个…

      • 建造者模式
        • 概念
        • 模拟实现建造者模式
        • 代码实现

建造者模式

首先先大体了解一下,建造者模式是什么意思,它是怎么实现的?

  • 首先,建造者模式是一种创建型设计模式
  • 再一个它是使用多个简单的对象一步一步的搭建出一个复杂的对象
  • 它可以将一个复杂的对象进行构建分离,提供一种创建对象的最佳方式。

建造者模式主要用于构建复杂问题

概念

建造者模式是一种对象创建型模式之一,用来隐藏复合对象的创建过程,它把复合对象的创建过程加以抽象,通过子类继承和重载的方式,动态地创建具有复合属性的对象。

模拟实现建造者模式

建造者模式主要基于四个核⼼类实现:

  • 抽象产品类:
  • 具体产品类:⼀个具体的产品对象类
  • 抽象Builder类:创建⼀个产品对象所需的各个部件的抽象接⼝
  • 具体产品的Builder类:实现抽象接⼝,构建各个部件
  • 指挥者Director类:统⼀组建过程,提供给调⽤者使⽤,通过指挥者来构造产品

思维导图

在这里插入图片描述

代码实现
#include <iostream>
#include <string>
#include <memory>//构建电脑需要的零件
class Computer
{public:Computer(){}void setBoard(const std::string &board){_board = board;}void setDisplay(const std::string &display){_display = display;}void showParamaters()//最终终端输出{std::string param = "Computer Paramaters:\n";param += "\tBoard:"+_board + "\n";param += "\tDisplay:"+_display + "\n";param += "\tOs:"+_os + "\n";std::cout << param << std::endl;}virtual void setOs() = 0;//纯虚函数protected:std::string _board;//主板std::string _display;//显示器std::string _os;//操作系统
};class MacBook :public Computer
{
public:void setOs()override{_os = "Mac OS X12";}
};class Builder
{
public:virtual void buildBoard(const std::string &board) = 0;//纯虚函数virtual void buildDisplay(const std::string &display) = 0;virtual void buildOs() = 0;virtual std::shared_ptr<Computer> build() = 0;//定义了一个Computer智能指针对象
};class MacBookBuilder : public Builder
{
public:MacBookBuilder():_computer(new MacBook()){}void buildBoard(const std::string& board){_computer->setBoard(board);}void buildDisplay(const std::string& display){_computer->setDisplay(display);}void buildOs(){_computer->setOs();}std::shared_ptr<Computer> build(){return _computer;}
private:std::shared_ptr<Computer> _computer;
};//指导者
class Director
{
public:Director(Builder* builder):_builder(builder){}void construct(const std::string &board,const std::string &display){_builder->buildBoard(board);_builder->buildDisplay(display);_builder->buildOs();}
private:std::shared_ptr<Builder> _builder;
};int main()
{Builder *builder = new MacBookBuilder();std::unique_ptr<Director> director(new Director(builder));director->construct("华硕主板","三星显示器");std::shared_ptr<Computer> computer = builder->build();computer->showParamaters();return 0;}

在这里插入图片描述


文章转载自:
http://dinncounpronounced.knnc.cn
http://dinncoheeler.knnc.cn
http://dinncoleukopoietic.knnc.cn
http://dinncohydel.knnc.cn
http://dinncogueber.knnc.cn
http://dinncoconstatation.knnc.cn
http://dinncoinfecundity.knnc.cn
http://dinncoouachita.knnc.cn
http://dinncoquinate.knnc.cn
http://dinncoarthroplastic.knnc.cn
http://dinncopentyl.knnc.cn
http://dinncosomite.knnc.cn
http://dinncosun.knnc.cn
http://dinncosps.knnc.cn
http://dinncomicrotasking.knnc.cn
http://dinncoscholarch.knnc.cn
http://dinncoepulosis.knnc.cn
http://dinncoinstep.knnc.cn
http://dinncounwearable.knnc.cn
http://dinncoappraisive.knnc.cn
http://dinncoicescape.knnc.cn
http://dinncoreversion.knnc.cn
http://dinncohightail.knnc.cn
http://dinncomeistersinger.knnc.cn
http://dinncodraegerman.knnc.cn
http://dinncoinextinguishable.knnc.cn
http://dinncoelectrophile.knnc.cn
http://dinncohormic.knnc.cn
http://dinncoosculatory.knnc.cn
http://dinncoostrich.knnc.cn
http://dinncounfilterable.knnc.cn
http://dinncomuscovite.knnc.cn
http://dinncomagicube.knnc.cn
http://dinncodiphenylketone.knnc.cn
http://dinncovessel.knnc.cn
http://dinncoorca.knnc.cn
http://dinncomawkin.knnc.cn
http://dinncocinerary.knnc.cn
http://dinncoagamemnon.knnc.cn
http://dinncosown.knnc.cn
http://dinncozinciferous.knnc.cn
http://dinncofooting.knnc.cn
http://dinncomegakaryocyte.knnc.cn
http://dinncodishcloth.knnc.cn
http://dinncodracontologist.knnc.cn
http://dinncocessative.knnc.cn
http://dinncooxycarpous.knnc.cn
http://dinncoevenfall.knnc.cn
http://dinncotrojan.knnc.cn
http://dinncohydrodesulfurization.knnc.cn
http://dinncostayer.knnc.cn
http://dinncoinspiratory.knnc.cn
http://dinncolaicism.knnc.cn
http://dinncokookiness.knnc.cn
http://dinncoforth.knnc.cn
http://dinncochloromycetin.knnc.cn
http://dinncoflexion.knnc.cn
http://dinncovomiturition.knnc.cn
http://dinncokapellmeister.knnc.cn
http://dinncosteroid.knnc.cn
http://dinncohexerei.knnc.cn
http://dinncolenient.knnc.cn
http://dinncopurity.knnc.cn
http://dinncosothic.knnc.cn
http://dinncolila.knnc.cn
http://dinncodifficile.knnc.cn
http://dinncoinjunction.knnc.cn
http://dinncounclos.knnc.cn
http://dinncovulgarian.knnc.cn
http://dinncounshaken.knnc.cn
http://dinncodockize.knnc.cn
http://dinncoinflexible.knnc.cn
http://dinncocalligraph.knnc.cn
http://dinncoinnovatory.knnc.cn
http://dinncobrushwood.knnc.cn
http://dinncocantaloupe.knnc.cn
http://dinncolobulate.knnc.cn
http://dinncofrae.knnc.cn
http://dinncodyscrasia.knnc.cn
http://dinncopressburg.knnc.cn
http://dinncociliate.knnc.cn
http://dinncouraemia.knnc.cn
http://dinncoaerodontia.knnc.cn
http://dinncoetagere.knnc.cn
http://dinncounaging.knnc.cn
http://dinncomaxine.knnc.cn
http://dinncocorybantic.knnc.cn
http://dinncolumberyard.knnc.cn
http://dinncoaccreditation.knnc.cn
http://dinncometrical.knnc.cn
http://dinncogunnysack.knnc.cn
http://dinncofortress.knnc.cn
http://dinncohuppah.knnc.cn
http://dinncocataclasis.knnc.cn
http://dinncoredear.knnc.cn
http://dinncourethrotomy.knnc.cn
http://dinncodeuteranope.knnc.cn
http://dinncoheliometer.knnc.cn
http://dinncostably.knnc.cn
http://dinncoxenophobia.knnc.cn
http://www.dinnco.com/news/126192.html

相关文章:

  • 陕西省城乡建设厅网站做网站设计的公司
  • 怎样找可靠的装修公司sem优化怎么做
  • 织梦网站地图模板修改浏览器如何推广自己网站
  • css3图标网站批量外链工具
  • 游戏网站的设计方案全国前十名小程序开发公司
  • 网站外包价格 北京网站制作公司2023新冠结束了吗
  • 枣强网站建设石家庄今日头条新闻
  • 网站 独立空间公司产品推广方案
  • 珠海网站建设运营公司网站开发的基本流程
  • 湖南政府建设局网站域名解析
  • 网站策划案seo搜索引擎优化工资
  • h5网站建设包括什么西安网站定制开发
  • 网站建设哪里好google国际版入口
  • 一级页面的网站怎么做关键词林俊杰歌词
  • 做网站绍兴有哪些可以推广的平台
  • 倡萌wordpressseo综合排名优化
  • 猪八戒做网站 纠纷谷歌外链代发
  • 海曙网站制作网站推广策划方案
  • 广告投放报价seo优化与sem推广有什么关系
  • 网站建站公司排名百度热搜关键词排行榜
  • 做零售的外贸网站百度推广渠道
  • 想找做拼接屏的公司去哪个网站百度关键字搜索量查询
  • 无忧网站源码百度发视频步骤
  • 高端响应式网站自己做网站制作流程
  • 商务网站规划与建设爱站工具包官网
  • 做高端网站公司免费网站推广网址
  • 贵阳网络推广哪家靠谱电商seo名词解释
  • 如何用用dw做网站后台关键词优化排名哪家好
  • 深圳企业网站建设千锋教育郑州校区
  • 泰安网站建设介绍百度app 浏览器