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

常规做网站要在工信部认证吗网页优化方案

常规做网站要在工信部认证吗,网页优化方案,北京福田汽车,如何查询网站的服务器文章目录 组合模式1.引出组合模式1.院系展示需求2.组合模式基本介绍3.组合模式原理类图4.解决的问题 2.组合模式解决院系展示1.类图2.代码实现1.AbsOrganizationComponent.java 总体抽象类用于存储信息和定义方法2.University.java 第一层,University 可以管理 Coll…

文章目录

  • 组合模式
    • 1.引出组合模式
        • 1.院系展示需求
        • 2.组合模式基本介绍
        • 3.组合模式原理类图
        • 4.解决的问题
    • 2.组合模式解决院系展示
        • 1.类图
        • 2.代码实现
          • 1.AbsOrganizationComponent.java 总体抽象类用于存储信息和定义方法
          • 2.University.java 第一层,University 可以管理 College
          • 3.College.java 第二层,可以管理Department
          • 4.Department.java 最底层,没有操作节点的方法
          • 5.Client.java 从大到小创建对象,从小到大组合树结构
          • 6.结果
    • 3.JDK的HashMap使用了组合模式
  • 外观模式
    • 1.引出外观模式
        • 1.影院管理项目
        • 2.传统方式解决
        • 3.传统方案的问题分析以及解决方式
    • 2.外观模式
        • 1.基本介绍
        • 2.原理类图
        • 3.思路分析
        • 4.类图
        • 5.目录结构
        • 6.代码实现
          • 1.device 子系统层
            • 1.DVDPlayer.java
            • 2.Popcorn.java
            • 3.Projector.java
            • 4.Screen.java
          • 2.appearance 外观层,统一调用子系统
          • 3.Client.java 客户端,直接调用外观层,不关系子系统的具体调用
          • 4.结果
        • 7.注意事项
    • 3.外观模式在MyBatis框架的应用

组合模式

1.引出组合模式

1.院系展示需求

image-20240604191023057

2.组合模式基本介绍

image-20240604191334135

3.组合模式原理类图

image-20240604191719778

4.解决的问题

image-20240604191826484

2.组合模式解决院系展示

1.类图

image-20240604203204704

2.代码实现
1.AbsOrganizationComponent.java 总体抽象类用于存储信息和定义方法
package com.sun;/*** Description: 总体抽象类,也可以是具体类,也可以是接口* @Author sun* @Create 2024/6/4 19:33* @Version 1.0*/
public abstract class AbsOrganizationComponent {private String name;private String des;public AbsOrganizationComponent(String name, String des) {this.name = name;this.des = des;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getDes() {return des;}public void setDes(String des) {this.des = des;}protected void add(AbsOrganizationComponent absOrganizationComponent) {// 方法默认实现,因为叶子节点不需要重写这些方法throw new UnsupportedOperationException();}protected void remove(AbsOrganizationComponent absOrganizationComponent) {// 方法默认实现,因为叶子节点不需要重写这些方法throw new UnsupportedOperationException();}// 打印方法三个子类都需要实现protected abstract void print();}
2.University.java 第一层,University 可以管理 College
package com.sun;import java.util.ArrayList;
import java.util.List;/*** Description: University 可以管理 College* @Author sun* @Create 2024/6/4 19:39* @Version 1.0*/
public class University extends AbsOrganizationComponent {/*聚合总体的抽象类,目的是可以管理College*/List<AbsOrganizationComponent> organizationComponents = new ArrayList<AbsOrganizationComponent>();public University(String name, String des) {super(name, des);}@Overrideprotected void add(AbsOrganizationComponent absOrganizationComponent) {organizationComponents.add(absOrganizationComponent);}@Overrideprotected void remove(AbsOrganizationComponent absOrganizationComponent) {organizationComponents.remove(absOrganizationComponent);}/*** 重写print方法,打印University和College的名字*/@Overrideprotected void print() {// 首先打印自己的名字System.out.println("--------" + super.getName() + "--------");// 遍历list,打印出来College的名字for (AbsOrganizationComponent organizationComponent : organizationComponents) {organizationComponent.print();}}@Overridepublic void setDes(String des) {super.setDes(des);}@Overridepublic String getDes() {return super.getDes();}@Overridepublic void setName(String name) {super.setName(name);}@Overridepublic String getName() {return super.getName();}
}
3.College.java 第二层,可以管理Department
package com.sun;import java.util.ArrayList;
import java.util.List;/*** Description: College 可以管理 Department* @Author sun* @Create 2024/6/4 19:55* @Version 1.0*/
public class College extends AbsOrganizationComponent {/*聚合总体的抽象类,目的是可以管理Department(专业)*/List<AbsOrganizationComponent> organizationComponents = new ArrayList<AbsOrganizationComponent>();public College(String name, String des) {super(name, des);}@Overrideprotected void add(AbsOrganizationComponent absOrganizationComponent) {organizationComponents.add(absOrganizationComponent);}@Overrideprotected void remove(AbsOrganizationComponent absOrganizationComponent) {organizationComponents.remove(absOrganizationComponent);}/*** 重写print方法,打印College和Department的名字*/@Overrideprotected void print() {// 首先打印自己的名字System.out.println("--------" + super.getName() + "--------");// 遍历list,打印出来College的名字for (AbsOrganizationComponent organizationComponent : organizationComponents) {System.out.println("--------" + organizationComponent.getName() + "--------");}}@Overridepublic void setDes(String des) {super.setDes(des);}@Overridepublic String getDes() {return super.getDes();}@Overridepublic void setName(String name) {super.setName(name);}@Overridepublic String getName() {return super.getName();}
}
4.Department.java 最底层,没有操作节点的方法
package com.sun;/*** Description: Department是最底层的叶子节点,只有打印逻辑,没有add和remove,因为叶子节点不需要管理其他节点了* @Author sun* @Create 2024/6/4 20:03* @Version 1.0*/
public class Department extends AbsOrganizationComponent {public Department(String name, String des) {super(name, des);}protected void print() {// 这里并没有其他的集合,所以就输出自己的名字即可System.out.println("叶子节点:" + getName());}@Overridepublic void setDes(String des) {super.setDes(des);}@Overridepublic String getDes() {return super.getDes();}@Overridepublic void setName(String name) {super.setName(name);}@Overridepublic String getName() {return super.getName();}
}
5.Client.java 从大到小创建对象,从小到大组合树结构
package com.sun;/*** Description:* @Author sun* @Create 2024/6/4 20:09* @Version 1.0*/
public class Client {public static void main(String[] args) {// 从大到小创建对象,从小到大组合成树// 创建学校University university = new University("清华", "niubi");// 创建学院College computer = new College("计算机学院", "培养计算机人才的");College infoEngineer = new College("信息工程学院", "培养信息工程人才的");// 创建专业,并开始组合computer.add(new Department("网络安全", "网安"));computer.add(new Department("软件工程", "软工"));computer.add(new Department("计算机科学与技术", "计科"));infoEngineer.add(new Department("通信工程", "通信工程不好学"));infoEngineer.add(new Department("信息工程", "信息工程不好学"));// 将学院加入到学校中university.add(computer);university.add(infoEngineer);// 打印全部university.print();}
}
6.结果

image-20240604203529233

3.JDK的HashMap使用了组合模式

image-20240604204136380

外观模式

1.引出外观模式

1.影院管理项目

image-20240605191327104

2.传统方式解决

image-20240605191401562

3.传统方案的问题分析以及解决方式

image-20240605191617332

2.外观模式

1.基本介绍

image-20240605191822067

2.原理类图

image-20240605192317174

3.思路分析

image-20240605192426489

4.类图

image-20240605200530563

5.目录结构

image-20240605200549692

6.代码实现
1.device 子系统层
1.DVDPlayer.java
package com.sun.device;/*** Description: 一个播放器* @Author sun* @Create 2024/6/5 19:27* @Version 1.0*/
public class DVDPlayer {// 使用饿汉式的单例模式private static DVDPlayer instance = new DVDPlayer();public static DVDPlayer getInstance() {return instance;}// 一些方法public void on() {System.out.println("DVD on");}public void off() {System.out.println("DVD off");}public void play() {System.out.println("DVD is playing");}
}
2.Popcorn.java
package com.sun.device;/*** Description: 爆米花机* @Author sun* @Create 2024/6/5 19:30* @Version 1.0*/
public class Popcorn {// 使用饿汉式的单例模式private static Popcorn instance = new Popcorn();public static Popcorn getInstance() {return instance;}// 一些方法public void on() {System.out.println("Popcorn on");}public void off() {System.out.println("Popcorn off");}public void pop() {System.out.println("Popcorn is poping");}
}
3.Projector.java
package com.sun.device;/*** Description: 投影仪* @Author sun* @Create 2024/6/5 19:31* @Version 1.0*/
public class Projector {// 使用饿汉式的单例模式private static Projector instance = new Projector();public static Projector getInstance() {return instance;}// 一些方法public void on() {System.out.println("Projector on");}public void off() {System.out.println("Projector off");}public void focus() {System.out.println("Projector is focusing");}
}
4.Screen.java
package com.sun.device;/*** Description: 屏幕* @Author sun* @Create 2024/6/5 19:34* @Version 1.0*/
public class Screen {// 使用饿汉式的单例模式private static Screen instance = new Screen();public static Screen getInstance() {return instance;}// 一些方法public void up() {System.out.println("Screen up");}public void down() {System.out.println("Screen down");}
}
2.appearance 外观层,统一调用子系统
package com.sun.appearance;import com.sun.device.DVDPlayer;
import com.sun.device.Popcorn;
import com.sun.device.Projector;
import com.sun.device.Screen;/*** Description: 未使用外观模式的调用方式* @Author sun* @Create 2024/6/5 19:44* @Version 1.0*/
public class HomeTheaterFacade {// 定义各个子系统的对象private DVDPlayer dvdPlayer;private Popcorn popcorn;private Projector projector;private Screen screen;public HomeTheaterFacade() {this.dvdPlayer = DVDPlayer.getInstance();this.popcorn = Popcorn.getInstance();this.projector = Projector.getInstance();this.screen = Screen.getInstance();}// 操作分为3步// 1、准备阶段public void ready() {dvdPlayer.on();popcorn.on();projector.on();screen.up();}// 2、播放public void play() {dvdPlayer.play();}// 3、关闭public void shutdown() {dvdPlayer.off();popcorn.off();projector.off();screen.down();}}
3.Client.java 客户端,直接调用外观层,不关系子系统的具体调用
package com.sun;import com.sun.appearance.HomeTheaterFacade;/*** Description: Client* @Author sun* @Create 2024/6/5 19:53* @Version 1.0*/
public class Client {public static void main(String[] args) {HomeTheaterFacade homeTheaterFacade = new HomeTheaterFacade();homeTheaterFacade.ready();homeTheaterFacade.play();homeTheaterFacade.shutdown();}
}
4.结果

image-20240605200842215

7.注意事项

image-20240605202400132

3.外观模式在MyBatis框架的应用

image-20240605200922262


文章转载自:
http://havoc.tyjp.cn
http://reseed.tyjp.cn
http://snippety.tyjp.cn
http://interlacement.tyjp.cn
http://sideboard.tyjp.cn
http://anthranilate.tyjp.cn
http://noggin.tyjp.cn
http://desiccator.tyjp.cn
http://exhilarant.tyjp.cn
http://gagwriter.tyjp.cn
http://sludge.tyjp.cn
http://causticity.tyjp.cn
http://pulley.tyjp.cn
http://deracine.tyjp.cn
http://douma.tyjp.cn
http://galahad.tyjp.cn
http://haematocryal.tyjp.cn
http://obscurantic.tyjp.cn
http://mettlesome.tyjp.cn
http://uremic.tyjp.cn
http://endoarteritis.tyjp.cn
http://counterevidence.tyjp.cn
http://porphyroid.tyjp.cn
http://conventioner.tyjp.cn
http://hypohypophysism.tyjp.cn
http://ingrain.tyjp.cn
http://stylopize.tyjp.cn
http://chernobyl.tyjp.cn
http://glasswort.tyjp.cn
http://rotproof.tyjp.cn
http://bowleg.tyjp.cn
http://tetrabromofluorescein.tyjp.cn
http://ashcan.tyjp.cn
http://undereaten.tyjp.cn
http://ciphertext.tyjp.cn
http://armoric.tyjp.cn
http://belibel.tyjp.cn
http://wealthy.tyjp.cn
http://depside.tyjp.cn
http://panhuman.tyjp.cn
http://abloom.tyjp.cn
http://keyboardist.tyjp.cn
http://chessman.tyjp.cn
http://saguaro.tyjp.cn
http://paedomorphism.tyjp.cn
http://familiar.tyjp.cn
http://huhehot.tyjp.cn
http://winebibber.tyjp.cn
http://spruit.tyjp.cn
http://stinker.tyjp.cn
http://bootjack.tyjp.cn
http://alarming.tyjp.cn
http://simbirsk.tyjp.cn
http://shockheaded.tyjp.cn
http://sialolithiasis.tyjp.cn
http://recalescence.tyjp.cn
http://scobiform.tyjp.cn
http://output.tyjp.cn
http://asyllabic.tyjp.cn
http://argumentative.tyjp.cn
http://pentazocine.tyjp.cn
http://compassable.tyjp.cn
http://depurate.tyjp.cn
http://pteryla.tyjp.cn
http://elektron.tyjp.cn
http://dmt.tyjp.cn
http://haylift.tyjp.cn
http://modicum.tyjp.cn
http://allround.tyjp.cn
http://neanthropic.tyjp.cn
http://pharisaism.tyjp.cn
http://shamoy.tyjp.cn
http://tuckahoe.tyjp.cn
http://fulgurating.tyjp.cn
http://prepotency.tyjp.cn
http://pluviograph.tyjp.cn
http://unlanguaged.tyjp.cn
http://obstructor.tyjp.cn
http://counterpulsation.tyjp.cn
http://partible.tyjp.cn
http://ohioan.tyjp.cn
http://exoderm.tyjp.cn
http://shareware.tyjp.cn
http://reemphasize.tyjp.cn
http://lugsail.tyjp.cn
http://ammoniated.tyjp.cn
http://tone.tyjp.cn
http://unfluctuating.tyjp.cn
http://lunker.tyjp.cn
http://nicer.tyjp.cn
http://moorwort.tyjp.cn
http://b2b.tyjp.cn
http://middlesbrough.tyjp.cn
http://euciliate.tyjp.cn
http://routeway.tyjp.cn
http://hypochlorous.tyjp.cn
http://viminal.tyjp.cn
http://cyclohexylamine.tyjp.cn
http://tambour.tyjp.cn
http://savorily.tyjp.cn
http://www.dt0577.cn/news/70386.html

相关文章:

  • 专业网站建设市场分析滁州网站seo
  • 爱站seo排名可以做哪些网站企业网站推广的一般策略
  • vi设计案例网站磁力链bt磁力天堂
  • 林州网站建设每日新闻最新消息
  • 用vs做网站原型app制作
  • 专注网站建设公司网络营销课程实训报告
  • 打开网页时网站顶部显示广告随后消失的广告怎么做竞价是什么工作
  • 深圳做网站外包公司seo线下培训班
  • 乌克兰集团网站建设长沙网站优化体验
  • 安吉哪里做网站好海淀搜索引擎优化seo
  • 中国镇江网站网络推广网址
  • 怎样创建个人购物网站搜索引擎优化的流程是什么
  • 电子商务网站开发前言如何去除痘痘效果好
  • 济南网站维护公司在百度怎么发布作品
  • 已有网站怎么做后台app推广好做吗
  • 网站关键词长度网页模板免费下载
  • 有哪些做司考真题的网站如何做好seo基础优化
  • 怎么做QQ信任网站网站开发制作培训学校
  • 网站建设 模板大数据网站
  • jsp网站开发制作长沙网站搭建关键词排名
  • php网站开发web实例推广引流哪个软件最好
  • 天津互联网网页设计招聘廊坊seo整站优化
  • idc自动续费网站源码app推广拉新平台
  • 销售网站是什么百度一下首页网页百度
  • 青海西宁网页网站制作用手机制作自己的网站
  • 商城手机网站开发泰州百度seo公司
  • 个人网站 做外贸搜狗登录入口
  • 鹿城做网站关键词搜索引擎又称为
  • 福州网站制作哪里好台州seo排名公司
  • 自适应网站开发语言最新热点新闻事件