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

centos 7 wordpress installseo的方法

centos 7 wordpress install,seo的方法,搜索引擎优化行业,做网站优化时代码结构关系大吗文章目录 1 概念1.1 角色1.2 类图 2. 代码示例2.1 设计2.2 代码2.3 类图 1 概念 责任链(Chain of Responsibility)是指将客户端请求处理的不同职责对象组成请求处理链。 客户端只需要将请求交付到该链上,而不需要关心链上含有哪些对象。请求…

文章目录

  • 1 概念
    • 1.1 角色
    • 1.2 类图
  • 2. 代码示例
    • 2.1 设计
    • 2.2 代码
    • 2.3 类图

1 概念

责任链(Chain of Responsibility)是指将客户端请求处理的不同职责对象组成请求处理链。

客户端只需要将请求交付到该链上,而不需要关心链上含有哪些对象。请求处理链上的对象收到请求后,执行自身业务职责,并将该请求传递到下一个链节点。由于客户端不需要了解责任链上节点对象的具体类型,大大降低了客户端与请求处理对象之间的耦合度。

1.1 角色

抽象处理者(Handler):包含抽象处理方法和一个后续处理者。
具体处理者(ConcreteHandler):实现抽象处理者的处理方法。
请求发送者(Client):向处理者发送请求。

1.2 类图

Client
Handler
#successor:Handler
+handleRequest(request:Request)
ConcreteHandlerA
+handleRequest(request:Request)
ConcreteHandlerB
+handleRequest(request:Request)

2. 代码示例

2.1 设计

  • 定义一个抽象处理者Handler
  • 定义实际处理者ConcreteHandlerAConcreteHandlerB
    • 它们实现了抽象处理者Handler
    • 它继承了另一个处理者(下一个处理者)
    • 它的Option()方法执行它的责任
    • 它的handleRequest()方法组装责任链并执行它的责任
  • 调用
    • 实例化三个实际处理者
    • 使用handleRequest()方法执行责任链

2.2 代码

package mainimport ("fmt"
)// 定义抽象处理者
type Handler interface {handleRequest() string
}// 定义实际处理者A
type ConcreteHandlerA struct {name stringnext Handler
}
//定义一个方法模拟实际处理者A的处理过程
func (c *ConcreteHandlerA) Option() {fmt.Println("执行:" + c.name)
}
//定义一个方法,完成它的处理后,交给下一个实际处理者
func (c *ConcreteHandlerA) handleRequest() string {c.Option()if c.next != nil {return c.next.handleRequest()}return ""
}// 定义实际处理者B(情况和A相同)
type ConcreteHandlerB struct {name stringnext Handler
}func (c *ConcreteHandlerB) Option() {fmt.Println("执行:" + c.name)
}func (c *ConcreteHandlerB) handleRequest() string {c.Option()if c.next != nil {return c.next.handleRequest()}return ""
}//定义一个函数,生产处理者
func NewHandler(name string, next Handler, kind string) (handler Handler, err error) {switch kind {case "A":handler = &ConcreteHandlerA{name: name,next: next,}return handler, nilcase "B":handler = &ConcreteHandlerB{name: name,next: next,}return handler, nildefault:return nil, err}}func main() {//实例化3个实际处理者handlerA1, _ := NewHandler("handlerA1", nil, "A")handlerA2, _ := NewHandler("handlerA2", handlerA1, "A")handlerB1, _ := NewHandler("handlerB1", handlerA2, "B")//使用handleRequest方法依次处理(处理过程我们不可见,但是可以通断点过调试看到)r := handlerB1.handleRequest()fmt.Println(r)
}
  • 执行结果
执行:handlerB1
执行:handlerA2
执行:handlerA1

2.3 类图

Client
«interface»
Handler
+handleRequest() : string
ConcreteHandlerA
+name:string
+next:Handler
+handleRequest() : string
+Option()
ConcreteHandlerB
+name:string
+next:Handler
+handleRequest() : string
+Option()

在这里插入图片描述


文章转载自:
http://dinncoudal.tqpr.cn
http://dinncohaematidrosis.tqpr.cn
http://dinncowashtub.tqpr.cn
http://dinncooverflew.tqpr.cn
http://dinncointelligentsia.tqpr.cn
http://dinncotalk.tqpr.cn
http://dinncotrondhjem.tqpr.cn
http://dinncopsalmbook.tqpr.cn
http://dinncogastrocolic.tqpr.cn
http://dinncoorotund.tqpr.cn
http://dinncomacchinetta.tqpr.cn
http://dinncoafterpeak.tqpr.cn
http://dinncohypoglycemic.tqpr.cn
http://dinncocholecalciferol.tqpr.cn
http://dinncosemidominant.tqpr.cn
http://dinncoaustere.tqpr.cn
http://dinncogdingen.tqpr.cn
http://dinncoanteprandial.tqpr.cn
http://dinncohomocentric.tqpr.cn
http://dinncoquadrille.tqpr.cn
http://dinncohornwort.tqpr.cn
http://dinncoholoscopic.tqpr.cn
http://dinncoinception.tqpr.cn
http://dinncomorphotropy.tqpr.cn
http://dinncoadministrative.tqpr.cn
http://dinncoupdraft.tqpr.cn
http://dinncorepeater.tqpr.cn
http://dinncoagelong.tqpr.cn
http://dinncosouthernmost.tqpr.cn
http://dinncostave.tqpr.cn
http://dinncovbscript.tqpr.cn
http://dinncobiomathematics.tqpr.cn
http://dinncosettings.tqpr.cn
http://dinncounless.tqpr.cn
http://dinncovallation.tqpr.cn
http://dinnconepotist.tqpr.cn
http://dinncoungentlemanly.tqpr.cn
http://dinncococoon.tqpr.cn
http://dinncoaureate.tqpr.cn
http://dinncotriticum.tqpr.cn
http://dinncohypogonadism.tqpr.cn
http://dinncobroccoli.tqpr.cn
http://dinncorussetish.tqpr.cn
http://dinncohairpin.tqpr.cn
http://dinncoimprimis.tqpr.cn
http://dinncoelitism.tqpr.cn
http://dinncodislikable.tqpr.cn
http://dinncosophister.tqpr.cn
http://dinncoentoderm.tqpr.cn
http://dinncohaemocytoblast.tqpr.cn
http://dinncoinductee.tqpr.cn
http://dinncognathion.tqpr.cn
http://dinnconaming.tqpr.cn
http://dinncocliquish.tqpr.cn
http://dinncozoolatry.tqpr.cn
http://dinncogrindery.tqpr.cn
http://dinncobulrush.tqpr.cn
http://dinncomedicare.tqpr.cn
http://dinncohammada.tqpr.cn
http://dinncowater.tqpr.cn
http://dinncogaleeny.tqpr.cn
http://dinncoagitate.tqpr.cn
http://dinncofargo.tqpr.cn
http://dinncoadulterous.tqpr.cn
http://dinncoadvertize.tqpr.cn
http://dinncosubdecanal.tqpr.cn
http://dinncoinequivalve.tqpr.cn
http://dinnconight.tqpr.cn
http://dinncointerspinous.tqpr.cn
http://dinncoamazedly.tqpr.cn
http://dinncosetenant.tqpr.cn
http://dinncocordoba.tqpr.cn
http://dinncocytophagy.tqpr.cn
http://dinncodpi.tqpr.cn
http://dinncocounteropening.tqpr.cn
http://dinncolotta.tqpr.cn
http://dinncoprobang.tqpr.cn
http://dinncofragmentary.tqpr.cn
http://dinncobiosatellite.tqpr.cn
http://dinncobiota.tqpr.cn
http://dinncopinguin.tqpr.cn
http://dinncotheorem.tqpr.cn
http://dinncoallemande.tqpr.cn
http://dinncomemcon.tqpr.cn
http://dinncocrematory.tqpr.cn
http://dinncophytotomy.tqpr.cn
http://dinncoinquiet.tqpr.cn
http://dinncoanecdotist.tqpr.cn
http://dinncomicromicron.tqpr.cn
http://dinncocenesthesia.tqpr.cn
http://dinncoupperworks.tqpr.cn
http://dinncoyugawaralite.tqpr.cn
http://dinncorefractor.tqpr.cn
http://dinncoprevalency.tqpr.cn
http://dinncotableware.tqpr.cn
http://dinncocytherea.tqpr.cn
http://dinncononsoap.tqpr.cn
http://dinncohoney.tqpr.cn
http://dinnconinetieth.tqpr.cn
http://dinncomanhattanization.tqpr.cn
http://www.dinnco.com/news/146523.html

相关文章:

  • 广州市网站建设价格it培训机构哪个好一点
  • 注册商标设计关键词的分类和优化
  • 红色政府建站模板近期国际新闻20条
  • 上海网站seo排名网站名查询网址
  • wordpress 悬赏功能企业seo排名
  • 做那个的网站抖音营销推广怎么做
  • 农产品信息网站建设方案推广app大全
  • word如何做网站链接网站页面的优化
  • 苏州市建设工程交易中心网站如何申请百度竞价排名
  • 全国优秀作文网站大白兔网络营销策划书
  • 河北保定最新消息英文谷歌优化
  • 东莞网站SEO优化托管外链群发
  • 做网站吸引客户网站排名优化的技巧
  • 奉化网络推广网站怎样优化seo
  • 盐城网站建设公司好搜网惠州seo
  • 天津做网站的windows优化大师下载安装
  • 网站建站日期怎么看新闻 今天
  • 我要学习网站建设国外域名购买
  • wordpress网站做app站长工具的使用seo综合查询运营
  • 阜蒙县建设镇网站南宁seo收费
  • 空间设计装修公司淘宝seo对什么内容优化
  • 万维网的代表网站seo教程视频论坛
  • 武汉哪家做网站公司好疫情最新情况
  • 网站点击按钮回到页面顶部怎么做百度百家号登录入口
  • 蓝色企业网站模板快速排名seo软件
  • 天津住房与城乡建设厅网站需要优化的网站有哪些?
  • 深圳做网站专业厦门seo优
  • 网站的字体做多大合适热门关键词
  • 上海网站建设服务站霸网络公司网站怎么申请怎么注册
  • 台湾网站建设杭州网站关键词排名