gpt4 book ai didi

design-patterns - 解释 "Active-object"模式

转载 作者:行者123 更新时间:2023-12-04 03:14:38 24 4
gpt4 key购买 nike

主动对象模式的目标是什么?
你能告诉我任何抽象的例子来容易理解吗?

最佳答案

The patern's static object diagram

事件对象模式的目标是将方法调用与方法执行分开。这就像餐厅里的服务员,只是把顾客的订单交给厨师。

当顾客向服务员点菜时

the customer is the Client, the waiter is the Proxy



他把它写在纸上(显然没有开始煮),

the paper is the MethodRequest, the table's number on the paper is the Future object



将纸交给厨师,由厨师决定应由哪个厨师准备(谁有时间)。

the chef is the Scheduler who has a list of papers (ActivationList) and the cooks are the Servant-s



饭菜做好后,厨师将其放在服务吧台上,服务员将其带到顾客餐 table 上。

Client reads the method's result, from the Result object.

关于design-patterns - 解释 "Active-object"模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41676343/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com