IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

三、设计模式 – 四大类型

IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

文章永久连接:https://tech.souyunku.com/?p=2657

设计模式(Design pattern)是重构解决方案

根据书 Design Patterns – Elements of Reusable Object-Oriented Software(中文译名:设计模式 – 可复用的面向对象软件元素) 中和 J2EE 所提到的,总共有 23 +8 种设计模式

这些模式可以分为四大类:创建型模式(Creational Patterns)、结构型模式(Structural Patterns)、行为型模式(Behavioral Patterns)、J2EE 设计模式

1、创建型模式

这些设计模式提供了一种在创建对象的同时隐藏创建逻辑的方式,而不是使用 new 运算符直接实例化对象

这使得程序在判断针对某个给定实例需要创建哪些对象时更加灵活

包括

1、工厂模式(Factory Pattern)
2、抽象工厂模式(Abstract Factory Pattern)
3、单例模式(Singleton Pattern)
4、建造者模式(Builder Pattern
5、原型模式(Prototype Pattern)

2、结构型模式

这些设计模式关注类和对象的组合

继承的概念被用来组合接口和定义组合对象获得新功能的方式

包括

1、适配器模式(Adapter Pattern)
2、桥接模式(Bridge Pattern)
3、过滤器模式(Filter、Criteria Pattern)
4、组合模式(Composite Pattern)
5、装饰器模式(Decorator Pattern)
6、外观模式(Facade Pattern)
7、享元模式(Flyweight Pattern)
8、代理模式(Proxy Pattern)

3、行为型模式

这些设计模式特别关注对象之间的通信

包括

1、责任链模式(Chain of Responsibility Pattern)
2、命令模式(Command Pattern)
3、解释器模式(Interpreter Pattern)
4、迭代器模式(Iterator Pattern)
5、中介者模式(Mediator Pattern)
6、备忘录模式(Memento Pattern)
7、观察者模式(Observer Pattern)
8、状态模式(State Pattern)
9、空对象模式(Null Object Pattern)
10. 策略模式(Strategy Pattern)
11. 模板模式(Template Pattern)
12. 访问者模式(Visitor Pattern)

4、J2EE 模式

这些设计模式特别关注表示层

这些模式是由 Sun Java Center 鉴定的

包括:

1、MVC 模式(MVC Pattern)
2、业务代表模式(Business Delegate Pattern)
3、组合实体模式(Composite Entity Pattern)
4、数据访问对象模式(Data Access Object Pattern)
5、前端控制器模式(Front Controller Pattern)
6、拦截过滤器模式(Intercepting Filter Pattern)
7、服务定位器模式(Service Locator Pattern)
8、传输对象模式(Transfer Object Pattern)

下面用一个图片来整体描述一下设计模式之间的关系:

img_1.png

干货推荐

本站推荐:精选优质专栏

附录:设计模式:系列文章


Warning: A non-numeric value encountered in /data/wangzhan/tech.souyunku.com.wp/wp-content/themes/dux/functions-theme.php on line 1154
赞(88) 打赏



未经允许不得转载:搜云库技术团队 » 三、设计模式 – 四大类型

IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码
IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

评论 抢沙发

大前端WP主题 更专业 更方便

联系我们联系我们

觉得文章有用就打赏一下文章作者

微信扫一扫打赏

微信扫一扫打赏


Fatal error: Uncaught Exception: Cache directory not writable. Comet Cache needs this directory please: `/data/wangzhan/tech.souyunku.com.wp/wp-content/cache/comet-cache/cache/https/tech-souyunku-com/index.q`. Set permissions to `755` or higher; `777` might be needed in some cases. in /data/wangzhan/tech.souyunku.com.wp/wp-content/plugins/comet-cache/src/includes/traits/Ac/ObUtils.php:367 Stack trace: #0 [internal function]: WebSharks\CometCache\Classes\AdvancedCache->outputBufferCallbackHandler() #1 /data/wangzhan/tech.souyunku.com.wp/wp-includes/functions.php(5109): ob_end_flush() #2 /data/wangzhan/tech.souyunku.com.wp/wp-includes/class-wp-hook.php(303): wp_ob_end_flush_all() #3 /data/wangzhan/tech.souyunku.com.wp/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #4 /data/wangzhan/tech.souyunku.com.wp/wp-includes/plugin.php(470): WP_Hook->do_action() #5 /data/wangzhan/tech.souyunku.com.wp/wp-includes/load.php(1097): do_action() #6 [internal function]: shutdown_action_hook() #7 {main} thrown in /data/wangzhan/tech.souyunku.com.wp/wp-content/plugins/comet-cache/src/includes/traits/Ac/ObUtils.php on line 367