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

win7iis配置网站深圳市住房和建设局红色警示

win7iis配置网站,深圳市住房和建设局红色警示,泰安哪里做网站,网站中的文字滑动怎么做的目录 侨接设计模式最佳实践 侨接设计模式最佳实践 桥接模式是一种结构型设计模式#xff0c;它将抽象部分与它的实现部分分离#xff0c;使它们可以独立地变化。桥接模式是一种结构型设计模式#xff0c;它将抽象部分与它的实现部分分离#xff0c;使它们可以独立地变化。… 目录 侨接设计模式最佳实践 侨接设计模式最佳实践 桥接模式是一种结构型设计模式它将抽象部分与它的实现部分分离使它们可以独立地变化。桥接模式是一种结构型设计模式它将抽象部分与它的实现部分分离使它们可以独立地变化。在Spring框架中桥接模式通常用于处理复杂的类层次结构其中不同的实现可以动态地组合在一起。 #mermaid-svg-hcHfazpKfXZ9VGFK {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-hcHfazpKfXZ9VGFK .error-icon{fill:#552222;}#mermaid-svg-hcHfazpKfXZ9VGFK .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-hcHfazpKfXZ9VGFK .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-hcHfazpKfXZ9VGFK .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-hcHfazpKfXZ9VGFK .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-hcHfazpKfXZ9VGFK .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-hcHfazpKfXZ9VGFK .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-hcHfazpKfXZ9VGFK .marker{fill:#333333;stroke:#333333;}#mermaid-svg-hcHfazpKfXZ9VGFK .marker.cross{stroke:#333333;}#mermaid-svg-hcHfazpKfXZ9VGFK svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-hcHfazpKfXZ9VGFK g.classGroup text{fill:#9370DB;fill:#131300;stroke:none;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:10px;}#mermaid-svg-hcHfazpKfXZ9VGFK g.classGroup text .title{font-weight:bolder;}#mermaid-svg-hcHfazpKfXZ9VGFK .nodeLabel,#mermaid-svg-hcHfazpKfXZ9VGFK .edgeLabel{color:#131300;}#mermaid-svg-hcHfazpKfXZ9VGFK .edgeLabel .label rect{fill:#ECECFF;}#mermaid-svg-hcHfazpKfXZ9VGFK .label text{fill:#131300;}#mermaid-svg-hcHfazpKfXZ9VGFK .edgeLabel .label span{background:#ECECFF;}#mermaid-svg-hcHfazpKfXZ9VGFK .classTitle{font-weight:bolder;}#mermaid-svg-hcHfazpKfXZ9VGFK .node rect,#mermaid-svg-hcHfazpKfXZ9VGFK .node circle,#mermaid-svg-hcHfazpKfXZ9VGFK .node ellipse,#mermaid-svg-hcHfazpKfXZ9VGFK .node polygon,#mermaid-svg-hcHfazpKfXZ9VGFK .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-hcHfazpKfXZ9VGFK .divider{stroke:#9370DB;stroke:1;}#mermaid-svg-hcHfazpKfXZ9VGFK g.clickable{cursor:pointer;}#mermaid-svg-hcHfazpKfXZ9VGFK g.classGroup rect{fill:#ECECFF;stroke:#9370DB;}#mermaid-svg-hcHfazpKfXZ9VGFK g.classGroup line{stroke:#9370DB;stroke-width:1;}#mermaid-svg-hcHfazpKfXZ9VGFK .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#mermaid-svg-hcHfazpKfXZ9VGFK .classLabel .label{fill:#9370DB;font-size:10px;}#mermaid-svg-hcHfazpKfXZ9VGFK .relation{stroke:#333333;stroke-width:1;fill:none;}#mermaid-svg-hcHfazpKfXZ9VGFK .dashed-line{stroke-dasharray:3;}#mermaid-svg-hcHfazpKfXZ9VGFK #compositionStart,#mermaid-svg-hcHfazpKfXZ9VGFK .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-hcHfazpKfXZ9VGFK #compositionEnd,#mermaid-svg-hcHfazpKfXZ9VGFK .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-hcHfazpKfXZ9VGFK #dependencyStart,#mermaid-svg-hcHfazpKfXZ9VGFK .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-hcHfazpKfXZ9VGFK #dependencyStart,#mermaid-svg-hcHfazpKfXZ9VGFK .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-hcHfazpKfXZ9VGFK #extensionStart,#mermaid-svg-hcHfazpKfXZ9VGFK .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-hcHfazpKfXZ9VGFK #extensionEnd,#mermaid-svg-hcHfazpKfXZ9VGFK .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-hcHfazpKfXZ9VGFK #aggregationStart,#mermaid-svg-hcHfazpKfXZ9VGFK .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-hcHfazpKfXZ9VGFK #aggregationEnd,#mermaid-svg-hcHfazpKfXZ9VGFK .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-hcHfazpKfXZ9VGFK .edgeTerminals{font-size:11px;}#mermaid-svg-hcHfazpKfXZ9VGFK :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} implements extends «interface» Abstraction operate() RefinedAbstraction operate() «interface» Implementor implement() ConcreteImplementorA implement() ConcreteImplementorB implement() 应用demo 1. 定义实现化角色Implementor 桥接模式是一种结构型设计模式它将抽象部分与它的实现部分分离使它们可以独立地变化。桥接模式是一种结构型设计模式它将抽象部分与它的实现部分分离使它们可以独立地变化。在Spring框架中桥接模式通常用于处理复杂的类层次结构其中不同的实现可以动态地组合在一起。 这是实现化角色的接口定义了一些基本操作。 public interface Implementor {void operationImpl(); }2. 定义具体实现化角色ConcreteImplementor 这是实现化角色的具体实现。 public class ConcreteImplementorA implements Implementor {Overridepublic void operationImpl() {System.out.println(ConcreteImplementorA operation implemented.);} }public class ConcreteImplementorB implements Implementor {Overridepublic void operationImpl() {System.out.println(ConcreteImplementorB operation implemented.);} }定义抽象化角色Abstraction 这是抽象化角色的抽象类它持有一个对实现化角色的引用。 public abstract class Abstraction {protected Implementor implementor;public Abstraction(Implementor implementor) {this.implementor implementor;}public abstract void operation(); }4. 定义具体抽象化角色RefinedAbstraction 这是抽象化角色的具体实现它调用实现化角色中的操作。 public class RefinedAbstraction extends Abstraction {public RefinedAbstraction(Implementor implementor) {super(implementor);}Overridepublic void operation() {System.out.println(Operation of RefinedAbstraction.);implementor.operationImpl();} }5. 客户端代码Client 这是使用桥接模式的客户端代码。 public class Client {public static void main(String[] args) {Implementor implementorA new ConcreteImplementorA();Abstraction abstractionA new RefinedAbstraction(implementorA);abstractionA.operation(); // 输出: Operation of RefinedAbstraction. ConcreteImplementorA operation implemented.Implementor implementorB new ConcreteImplementorB();Abstraction abstractionB new RefinedAbstraction(implementorB);abstractionB.operation(); // 输出: Operation of RefinedAbstraction. ConcreteImplementorB operation implemented.} }在这个示例中Implementor 接口定义了实现化角色的基本操作而 ConcreteImplementorA 和 ConcreteImplementorB 是它的具体实现。Abstraction 抽象类定义了抽象化角色它持有一个 Implementor 类型的引用并通过构造器注入。RefinedAbstraction 是 Abstraction 的具体子类它实现了抽象方法 operation并在该方法中调用了实现化角色的操作。最后在客户端代码中我们创建了具体的实现化角色和抽象化角色并通过调用抽象化角色的 operation 方法来演示桥接模式的工作原理。 以下是一个使用桥接模式和Spring框架的示例 首先我们定义一个抽象的消息服务接口和它的实现 public interface MessageService {void sendMessage(String msg); }public class EmailService implements MessageService {Overridepublic void sendMessage(String msg) {System.out.println(发送电子邮件 msg);} }public class SMSService implements MessageService {Overridepublic void sendMessage(String msg) {System.out.println(发送短信 msg);} }然后我们定义一个抽象的消息客户端类它包含一个对MessageService的引用 public abstract class MessageClient {protected MessageService messageService;public MessageClient(MessageService messageService) {this.messageService messageService;}public abstract void sendMessage(String msg); }public class EmailClient extends MessageClient {public EmailClient(MessageService messageService) {super(messageService);}Overridepublic void sendMessage(String msg) {messageService.sendMessage(msg);} }public class SMSClient extends MessageClient {public SMSClient(MessageService messageService) {super(messageService);}Overridepublic void sendMessage(String msg) {messageService.sendMessage(msg);} }现在我们可以在Spring的配置类中注册这些bean import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;Configuration public class AppConfig {Beanpublic MessageService emailService() {return new EmailService();}Beanpublic MessageService smsService() {return new SMSService();}Beanpublic MessageClient emailClient(MessageService emailService) {return new EmailClient(emailService);}Beanpublic MessageClient smsClient(MessageService smsService) {return new SMSClient(smsService);} }最后我们可以在Spring的上下文中使用这些bean import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component;Component public class ClientApplication {private final MessageClient emailClient;private final MessageClient smsClient;Autowiredpublic ClientApplication(MessageClient emailClient, MessageClient smsClient) {this.emailClient emailClient;this.smsClient smsClient;}public void sendMessages() {emailClient.sendMessage(这是一封电子邮件);smsClient.sendMessage(这是一条短信);} }
http://www.w-s-a.com/news/650830/

相关文章:

  • 手机网站标准百度搜索关键词排名优化推广
  • 中国空间站科幻作文1000字wordpress运行库
  • 徐州做网站的wordpress可视化编辑器排行
  • 官方网站英语上海公司注册核名查询
  • 东莞网站建设推广云南昆明最新消息
  • 上网站乱码网页设计与网站建设案例教程
  • 宣讲网站建设wordpress多媒体主题
  • 如何成立网站互联网开发是做什么的
  • 网站首页的尺寸做多大网页图片排版
  • 龙岩天宫山索道多少钱河南网站排名优化哪家好
  • 北京做网站设计程序员和网站开发
  • 个人 做自媒体 建网站图片制作成视频的手机软件
  • h5 建站网站 移动端重庆潼南网站建设价格
  • 商企在线营销型网站怎么做时光网站
  • 网站建设方案论文1500竞价托管哪家便宜
  • 使用cdn的网站宣武网站建设
  • 营销型网站怎么建设企业网站Wap在线生成
  • 网站建设服务费应该做到什么科目广州网页制作服务商
  • 网站显示500错误怎么解决方法店面设计模板
  • 网站备案icp文化传媒有限公司
  • 北京企业建站模板微信公众号商城怎么制作
  • 制作网站 公司简介大型做网站的公司
  • 北京网站开发建设南昌网站小程序开发
  • 网站如何做ip签名图片宁波互联网
  • 中山小榄网站建设长沙网络营销品牌排名
  • 推广优化厂商联系方式网站推广教程优化整站
  • 为外国企业做中文网站建设网站建设单位哪家好
  • 生物制药公司网站模板有没有专业做steam创客的网站
  • 福田做棋牌网站建设找哪家效益快弄一个微信小程序多少钱
  • 成都哪家做网站建设比较好做推广赚钱的网站