设计模式
2023-02-06 15:39:02 0 举报
设计模式UML类图
作者其他创作
大纲/内容
BOSSReactor
Target
+ request(): void
工作线程
client
notify
Realizetype2
+ clone(): Object
Adapter
- adaptee: Adaptee- target: Target
+ Adapter(Adaptee adaptee)+ Adapter(Target target)+ request(): void+ specificRequest():void
...Handler
ConcreteHandler2
+ handlerRequest(String request): void
管理事件
FairSync
+ lock()+ tryAcquire(int acquires)
Observer2
Object
ProductBFactory
+ createProduct(): AbstractProduct
ProductA
Serializable
ReadHandler
ConcreteSubject
+ notifyObserver(): void
D
门面模式
Reactor
A
Facade
- subSystemA: SubSystemA- subSystemB: SubSystemB- subSystemC: SubSystemC
+ Facade(): void+ method(): void
发布事件
acceptor
Subscriber1
Decorator
- component:Component
+ Decorator(Component component)+ Operation()
void notifyAllObserver() { for (Observer observer : observers) { observer. reponse(); }}
ProductB1
DecodeHandler
PrototypeManager
dispatch调度
FactoryB
+ createProductA(): AbstractProductA+ createProductB(): AbstractProductB
Builder
+ buildpartA(): void+ buildpartB(): void+ buildpartC(): void+ build(): Product
装饰器模式
NofairSync
+ lock()+ tryAcquire(int acquires)
ProductAFactory
AdapteeRealize
+ specificRequest():void
任务队列
AbstractProduct
AbstractQueuedSynchronizer
- Node head- Node tail- int State
+ acquire()...
AbstractOwnableSynchronizer
线程池Thread Pool
Observers
Prototype
+ clone(): Object
ConcreateBuilder2
- product: Product
工厂方法模式
Product
- partA: String- partB: String- partC: String
+ show(): void
原型模式扩展
ReentrantLock
- Sync sync
TargetRealize
模板方法模式
ConcreteHandler1
C
Event happened
Server
双向适配适配器模式
topic
Singleton
- instance:Singleton
- Singleton()+getInstance():Singleton
- adaptee: Adaptee
+ Adapter(Adaptee adaptee)+ request(): void
Director
- builder:Builder
+ construct(): void
AbstractFactory
AbstractTemplate
+ templateMethod(): void+ specificMethod(): void+ hookMethod1(): void+ hookMethod2(): boolean+ abstractMethod1(): void+ abstractMethod2(): void
Publisher
ProductB
Lock
代理模式
策略模式
ConcreteTemplate
+ hookMethod1(): void+ hookMethod2(): boolean+ abstractMethod1(): void+ abstractMethod2(): void
Factory
+ createProductA(): AbstractProduct+ createProductB(): AbstractProduct
event
ProxySubject
- realSubject: RealSubject
+ Request
ConcreteObserver2
+ reponse(): void
建造者模式
Adaptee
Reactor 多线程模型
RealSubject
+ Request()
ConcreteStrategyA
+Algorithmlnterface()
Cloneable
简单工厂模式
Interface1
+ operation1(params):returnType+ operation2(params)+ operation3()+ operation4()+ operation5()
Client
- prototypeManager: PrototypeManager- Prototype: Prototype
+ getPrototype(String id): Prototype
...
AbstractProductA
ConcreteComponent
+ Operation()
SubSystemB
+ method(): void
单例模式
Handler
- next: Handler
Observer1
抽象方法模式
Node
- Node SHARED- Node EXCLUSIVE- Node prev- Node next- Thread thread- int waitStatus- Node nextWaiter
+ isShared()
FactoryA
Event Bus
订阅事件
AbstractProductB
原型模式
ProductA1
Observer
适配器模式
ConcreteDecoratorA
- addField
发布/订阅模式
观察者模式
ConcreateBuilder1
责任链模式
Observer3
Reactor 主从多线程模型
Reactor 单线程模型
Communication lnfrastructure
AbstractSubject
+ request()
ProductB2
单独线程
Subject
Realizetype1
ConcreteDecoratorB
- addField: Object
+ Operation()+ addMethod()
Component
SubSystemC
Sync
+ lock()+ nonfairTryAcquire()+ tryRelease()...
ProductA2
B
事件总线
SubSystemA
ConcreteStrategyB
WorkReactor
Strategy
Context
+ContextInterface()
0 条评论
下一页