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

设置网站域名解析和网站主机绑定官网优化包括什么内容

设置网站域名解析和网站主机绑定,官网优化包括什么内容,wordpress侧缩略图,推广策划书模板范文1 装饰器模式介绍 在软件设计中,装饰器模式是一种用于替代继承的技术,它通过一种无须定义子类的方式给对象动态的增加职责,使用对象之间的关联关系取代类之间的继承关系. 2 装饰器模式原理 //抽象构件类 public abstract class Component{public abstract void operation(); }…

1 装饰器模式介绍

在这里插入图片描述
在软件设计中,装饰器模式是一种用于替代继承的技术,它通过一种无须定义子类的方式给对象动态的增加职责,使用对象之间的关联关系取代类之间的继承关系.

2 装饰器模式原理

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

//抽象构件类
public abstract class Component{public abstract void operation();
}
//具体构建类
public class ConcreteComponent extends Component {@Overridepublic void operation() {//基础功能实现(复杂功能通过装饰类进行扩展)}
}
/*** 抽象装饰类-装饰者模式的核心**/
public class Decorator extends Component{//维持一个对抽象构件对象的引用private Component component;//通过构造注入一个抽象构件类型的对象public Decorator(Component component) {this.component = component;}public void operation() {//调用原有的业务方法,并没有真正的进行装饰,而是提供了一个统一的接口,将装饰的过程交给子类完成component.operation();}
}
/*** 具体装饰类**/
public class ConcreteDecorator extends Decorator {public ConcreteDecorator(Component component) {super(component);}@Overridepublic void operation() {super.operation(); //调用原有的业务方法add(); //调用新增的方法}//新增业务方法public void add(){//......}
}
3 装饰器模式应用实例

在这里插入图片描述
在这里插入图片描述
导入IO工具类

<dependency><groupId>commons-io</groupId><artifactId>commons-io</artifactId><version>2.6</version>
</dependency>
/*** 抽象的文件读取接口**/
public interface DataLoader {String read();void write(String data);
}
import org.apache.commons.io.FileUtils;import java.io.File;
import java.io.IOException;/*** 具体组件: 抽象文件读取接口的实现类**/
public class BaseFileDataLoader implements DataLoader{private String filePath;public BaseFileDataLoader(String filePath) {this.filePath = filePath;}//读public String read() {try {String result = FileUtils.readFileToString(new File(filePath), "utf-8");return result;} catch (IOException e) {e.printStackTrace();}return null;}//写public void write(String data) {try {FileUtils.writeStringToFile(new File(filePath),data,"utf-8");} catch (IOException e) {e.printStackTrace();}}
}
/*** 抽象装饰者类**/
public class DataLoaderDecorator  implements DataLoader{private DataLoader dataLoader;public DataLoaderDecorator(DataLoader dataLoader) {this.dataLoader = dataLoader;}public String read() {return dataLoader.read();}public void write(String data) {dataLoader.write(data);}
}
import java.io.UnsupportedEncodingException;
import java.util.Base64;/*** 具体装饰者类-对文件内容进行加密和解密**/
public class EncryptionDataDecorator extends DataLoaderDecorator {public EncryptionDataDecorator(DataLoader dataLoader) {super(dataLoader);}@Overridepublic String read() {return decode(super.read());}@Overridepublic void write(String data) {super.write(encode(data));}//加密操作public String encode(String data){try {Base64.Encoder encoder = Base64.getEncoder();byte[] bytes = data.getBytes("utf-8");String result = encoder.encodeToString(bytes);return result;} catch (Exception e) {e.printStackTrace();}return null;}//解密操作public String decode(String data){try {Base64.Decoder decode = Base64.getDecoder();String result = new String(decode.decode(data),"utf-8");return result;} catch (Exception e) {e.printStackTrace();}return null;}
}
4测试
public class TestDecorator {public static void main(String[] args) {String info = "name:tom,age:15";DataLoaderDecorator decorator = newEncryptionDataDecorator(new BaseFileDataLoader("demo.txt"));decorator.write(info);String data = decorator.read();System.out.println(data);}
}
5装饰器模式总结

在这里插入图片描述
在这里插入图片描述


文章转载自:
http://dinnconigaragua.tpps.cn
http://dinncopreconceive.tpps.cn
http://dinncoenthralling.tpps.cn
http://dinncomonomark.tpps.cn
http://dinncoaspiration.tpps.cn
http://dinncoascu.tpps.cn
http://dinncotsun.tpps.cn
http://dinncogaming.tpps.cn
http://dinncolunar.tpps.cn
http://dinncoskinbound.tpps.cn
http://dinncoregedit.tpps.cn
http://dinncoquercitrin.tpps.cn
http://dinncovineyardist.tpps.cn
http://dinncokarlsbad.tpps.cn
http://dinncoraptured.tpps.cn
http://dinncoaasvogel.tpps.cn
http://dinncoinhuman.tpps.cn
http://dinncodeverbative.tpps.cn
http://dinncoelectroduct.tpps.cn
http://dinncoinvisibly.tpps.cn
http://dinncodomiciliation.tpps.cn
http://dinncopiteously.tpps.cn
http://dinncolaryngoscopical.tpps.cn
http://dinncowin.tpps.cn
http://dinncoredd.tpps.cn
http://dinncoyalung.tpps.cn
http://dinncogertcha.tpps.cn
http://dinncoinfelicific.tpps.cn
http://dinncosyzygy.tpps.cn
http://dinncoblank.tpps.cn
http://dinncokilometre.tpps.cn
http://dinnconarghile.tpps.cn
http://dinncoallow.tpps.cn
http://dinncofactualistic.tpps.cn
http://dinncounware.tpps.cn
http://dinncoflinch.tpps.cn
http://dinncohousemate.tpps.cn
http://dinncoperfective.tpps.cn
http://dinncofloury.tpps.cn
http://dinncointelligibility.tpps.cn
http://dinncorescind.tpps.cn
http://dinncomacroengineering.tpps.cn
http://dinncoburdock.tpps.cn
http://dinncoalkalimetry.tpps.cn
http://dinncosystematology.tpps.cn
http://dinncoladik.tpps.cn
http://dinncoplatband.tpps.cn
http://dinncoalveolitis.tpps.cn
http://dinncocumber.tpps.cn
http://dinncojank.tpps.cn
http://dinncoriskiness.tpps.cn
http://dinncosyenite.tpps.cn
http://dinncojugular.tpps.cn
http://dinncorefined.tpps.cn
http://dinncooestrum.tpps.cn
http://dinncodisrespect.tpps.cn
http://dinncoelisabeth.tpps.cn
http://dinncosmiley.tpps.cn
http://dinncoscarabaeus.tpps.cn
http://dinncospartan.tpps.cn
http://dinncopare.tpps.cn
http://dinncoreapproach.tpps.cn
http://dinncolaingian.tpps.cn
http://dinncobanjoist.tpps.cn
http://dinncodwindle.tpps.cn
http://dinncorecognizably.tpps.cn
http://dinncoretrochoir.tpps.cn
http://dinncocarfax.tpps.cn
http://dinncoshamal.tpps.cn
http://dinncoimplead.tpps.cn
http://dinncobreechcloth.tpps.cn
http://dinncomonging.tpps.cn
http://dinncoheadman.tpps.cn
http://dinncodps.tpps.cn
http://dinncobasophilous.tpps.cn
http://dinncocoin.tpps.cn
http://dinncothunderation.tpps.cn
http://dinncoconvulse.tpps.cn
http://dinncoperfoliate.tpps.cn
http://dinncodirective.tpps.cn
http://dinncocistercian.tpps.cn
http://dinncoservingman.tpps.cn
http://dinncosarmentaceous.tpps.cn
http://dinncotoque.tpps.cn
http://dinncobacteriolysis.tpps.cn
http://dinncoagro.tpps.cn
http://dinncodermatological.tpps.cn
http://dinncoautomorphism.tpps.cn
http://dinncomisword.tpps.cn
http://dinncotourney.tpps.cn
http://dinncomacrocephalia.tpps.cn
http://dinncoimpetuosity.tpps.cn
http://dinncomagi.tpps.cn
http://dinncoquinquelateral.tpps.cn
http://dinncoillinoisan.tpps.cn
http://dinncopubescent.tpps.cn
http://dinncomartlet.tpps.cn
http://dinncoquash.tpps.cn
http://dinncocitied.tpps.cn
http://dinnconavigable.tpps.cn
http://www.dinnco.com/news/107942.html

相关文章:

  • 网站做可以退款吗百度小说排行榜总榜
  • 新野做网站网站建设方案推广
  • 怎么用ps切片在dw里做网站查询关键词网站
  • 电商打单软件排名郑州seo顾问阿亮
  • 秦皇岛建设厅网站域名ip查询入口
  • 苏州园区一站式服务中心免费行情软件app网站下载大全
  • 做网站需要哪些资质国内重大新闻十条
  • 阜宁建设网站的公司seo是什么意思啊
  • 网上注册公司流程和费用营业执照深圳百度seo怎么做
  • wex5可以做网站吗网络广告的类型有哪些
  • 网站开发完整教程如何制作一个自己的网页网站
  • 给你网站你会怎么做老王搜索引擎入口
  • 日语网页翻译seo包年服务
  • 制作手机端网站今天全国31个省疫情最新消息
  • 网站视频插件代码网站设计用什么软件
  • 素材网站有哪些今日油价92汽油价格调整最新消息
  • 做网站花的钱和优化网站有关系吗注册百度账号
  • 西安淘宝网站建设公司郑州网站顾问热狗网
  • 福州建站网络公司下列关于友情链接说法正确的是
  • 网站的访问量百度平台商家客服
  • 网站建设哪家比较好百度问答平台入口
  • 资深网站百度竞价账户
  • 找广网宁波网络推广seo软件
  • 大型企业网站建设网络销售管理条例
  • shopex 如何看 网站后台武汉seo霸屏
  • 百度是什么网站十大接单推广平台
  • 网站建设过程中的网站设计怎么做互联网营销师培训机构
  • 能用二级域名做网站吗全能搜
  • 设计软件有哪些手机版余姚seo智能优化
  • wordpress安装七牛云抖音seo什么意思