logo 有点笨有点猪
  • 关于
  • Base Knowledge
    • Artificial Intelligence
      • Generative AI
      • Reinforcement Learning
    • Compilation Principle
      • 1 Overview
      • 2 Lexical Analysis
      • 3 Syntax Analysis
      • 4 Syntax-Directed Translation
      • 5 Intermediate Code Generation
    • Computer Graphics
      • Animation
        • 刚体
        • 柔体
        • 流体
        • 质点-弹簧系统
      • Geometry
      • Rendering
        • 实时光线追踪
        • 实时全局光照
        • 实时抗锯齿与超采样
        • 实时渲染中的工业界技术
        • 实时环境光照
        • 实时阴影
        • 实时高质量着色
    • Computer Network
      • 1 Overview
      • 2 Application Layer
      • 3 Transport Layer
      • 4 Network Layer
      • 5 Link Layer
    • Computer Organization
    • Data Structures & Algorithm
      • Basic Algorithm
        • Binary Lifting
        • Binary Search
        • Enumerate
        • Greedy
        • Recursion & Divide and Conquer
        • Sort
        • 前缀和 & 差分
      • Dynamic Programming
        • 动态规划
      • Graph
        • Traverse
      • Hash
      • Linear
      • Misc
      • String
      • Tree
        • Traverse
    • Operating system
      • 1 Overview
      • 2 并发
      • 3 虚拟化
      • 4 内核
      • 5 持久化
    • Z Reference Link
  • Programing
    • C&C++
      • C++对象模型
      • 实现双端队列
    • C#
    • Code Style
    • Cuda
    • Design Pattern
      • 1 Creational
        • 1 Factory Method 工厂方法
        • 2 Abstract Factory
        • 3 Builder
        • 4 Prototype
        • 5 Singleton
        • 6 Summary
      • 2 Structural
        • 1 Adapter
        • 2 Bridge
        • 3 Composite
        • 4 Decorator
        • 5 Facade
        • 6 Flyweight
        • 7 Proxy
        • 8 Summary
      • 3 Behavioral
        • 1 Chain of Responsibility
        • 10 Visitor
        • 11 Interpreter
        • 12 Summary
        • 2 Command
        • 3 Iterator
        • 4 Mediator
        • 5 Memento
        • 6 Observer
        • 7 State
        • 8 Strategy
        • 9 Template Method
    • Lua
      • 1 Overview
      • 2 Lua 5.x精要总结
      • 3 Lua GC
      • 4 Lua 虚拟机
      • 5 Lua 面向对象
    • Python
      • 1 Overview
    • Rust
      • 1 基础
    • Shell
      • 1 Overview
    • TypeScript
      • 1 Overview
    • Z Reference Link
  • Unreal Engine
    • AI
      • BehaviorTree
      • EnvironmentQuery
      • NavMesh
    • Animation
      • 动画状态机
    • Asset&Pak&Patch
    • Core
      • UObject
    • Debug
    • Editor Extension
    • GamePlay
      • Framwork
        • AGameModeBase
        • AGameStateBase
      • Game Ability System
        • AGameplayCueNotify_Actor
        • FGameplayTag
        • UAbilitySystemComponent
        • UAbilityTask
        • UAttributeSet
        • UGameplayAbility
        • UGameplayEffect
      • Replication
        • Optimization
        • Replication Graph
        • Significance Manager
    • Physics
    • Platform
      • Java Native Interface
      • Unreal Plugin Language
    • Profile
      • UE性能优化工具
      • Unity性能优化方向
    • Rendering
    • Sounds
    • UI
    • UnLua
      • Unlua指南
      • Unlua源码解析
    • Z Reference Link
  • Work Experience
    • Efficiency
      • UE Project Git Pull&Build
    • Security
      • 哈希函数
    • Serialization
      • Json
      • Protobuf
    • Z Reference Link
  • README

12 Summary

行为模式负责对象间的高效沟通和职责委派。 ...
2025-08-10 Programing > Design Pattern > 3 Behavioral

11 Interpreter

解释器模式:特定领域的问题复杂,类似的结构重复出现。将问题表达为 某种语法规则 下的句子,构建解释器来解释这样的句子。给定一个语言,定义它的文法的一种表示,并定义一种解释器,这个解释器使用该表示来解释语言中的句子。(最常见的是实现一个 console ,复杂情况其实就是实现一个动态语言) 伪代码不想写了,好累。。。详见Lua源码吧。 ...
2025-08-10 Programing > Design Pattern > 3 Behavioral

10 Visitor

访问器模式: 由于需求改变,类层次结构常需要增加新的行为,直接修改基类会增加子类负担。在 不改变类层次结构 的前提下,运行时为各个类动态添加新的操作。子类是需要先预知的。能够修改的操作是有限的。 class Visitor;class Abstract {public: virtual void AcceptVisitor(Visitor* visitor) = 0; virtual ~ ...
2025-08-10 Programing > Design Pattern > 3 Behavioral

9 Template Method

模板方法: 定义 算法/流程 的骨架(公共部分),将可变的部分延迟到子类中实现。(非常常见的做法,一般基类都会这么干) public: // 公共部分 void TemplateMethod() { // 定义 流程、骨架 }protected: // 可变部分 virtual void HookMethod();private: void InternalMeth ...
2025-08-10 Programing > Design Pattern > 3 Behavioral

8 Summary

结构型模式介绍如何将对象和类组装成较大的结构,并同时保持结构的灵活和高效。 ...
2025-08-10 Programing > Design Pattern > 2 Structural

8 Strategy

策略模式: 将相似的 行为 进行抽象,使之可以在运行时动态自由切换其中任意一个。(一般与 if else / switch case 逻辑的 改造 紧密结合,重点是看业务是否足够相似,一般会拆分的比较小) // 一系列相似行为的抽象基类class IStategy {public: virtual ~IStategy() {} // 相似行为 virtual ...
2025-08-10 Programing > Design Pattern > 3 Behavioral

7 Proxy

代理模式: 有些对象由于一些原因(创建开销大、需要控制安全操作、需要进程外的访问),直接访问会给访问者造成麻烦。为其他对象提供一种代理,以控制对这个对象的访问(隔离、权限控制)。(如 UE 的渲染 proxy )设计非常自由,主要就是通过中间层,达到访问隔离的效果。 class Abstract { virtual void DoSomething(); Abstract ~Abstra ...
2025-08-10 Programing > Design Pattern > 2 Structural

7 State

状态模式:某些对象的状态变化,行为也会随之变化。运行时根据对象的状态来更改行为。将所有与特定状态相关的行为,都放入一个State子对象,在对象状态切换时,切换为对应的子对象,同时维持对外接口,以达到状态与行为的解耦。 class AbstractState {protected: AbstractState* m_Next;public: virtual void DoSomething ...
2025-08-10 Programing > Design Pattern > 3 Behavioral

6 Summary

创建型模式提供了创建对象的机制,能够提升已有代码的灵活性和可复用性。 通过对象创建模式,绕开new,以避免紧耦合,支持对象创建的稳定。 ...
2025-08-10 Programing > Design Pattern > 1 Creational

6 Flyweight

享元模式: 大量 细粒度 的对象,有很高的运行时代价(主要指内存)。运用 共享 技术,有效地支持大量 细粒度 的对象。(例如 字符串、线程池) class Small {public: std::string key; Small(const std::string& key){}}class SmallFactory {private: ...
2025-08-10 Programing > Design Pattern > 2 Structural
123>
©2024-2025 Davids 总访问量 总访客数
Theme Node-Tree Powered by Hexo