基于并发设计的Agent / Actor的设计模式 [英] Design patterns for Agent / Actor based concurrent design

查看:463
本文介绍了基于并发设计的Agent / Actor的设计模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我一直在使用替代语言来支持一个演员/代理/共享的架构 - 即。 scala,clojure等(clojure也支持共享状态)。



到目前为止,我读过的大多数文档都围绕着介绍级别。我正在寻找的是四个帮派的更高级的文档,而不是基于任何东西。



为什么?它有助于思考设计思维的变化。简单的例子很简单,但在现实世界的java应用程序(单线程)中,您可以拥有具有复杂关系的1000个成员的对象图。但是通过基于代理的并发开发,它引入了一整套思路来理解设计大型系统时的意义。即。代理粒度 - 一个代理管理多少状态 - 对性能等的影响,或者是将共享状态对象图映射到基于代理的系统的良好模式。关于映射域模型设计的提示。讨论不是关于技术,而是更多地关于如何使用设计中的技术(现实世界中复杂的例子将是巨大的)。

解决方案

即使我无法想出任何可以直接向您提供设计
模式的好的现实世界示例,有几个地方可以开始。



第一个是让你的头包裹正确的概念。一本帮助您执行此操作的书籍是在存在软件错误的情况下使可靠的分布式系统
由Erlang Guru Joe Armstrong撰写,以一种非常方便的方式解释并行导向编程
。实际上是博士学位。论文,但不要让那个吓到你。
比大多数普通的教科书更容易阅读和讨价还价。



看实际系统通常意味着你必须学习太多关于实际的
语言,它也只是评估事情的意义。对于Erlang,文档
提供了设计方法和行为(Erlang speek for设计模式库)。
这将说明此设置中最常用的设计模式。这些
已被证明是有效地构建大规模系统,即数百万行代码(与其他语言(如Java)相当于4到10个因素)和在分布式集群中的一台机器上运行的并发进程的milloins的机器。
最近的一个真实系统的例子是 Facebook聊天



对于其他框架,我不能真正帮助你,我害怕。


Recently i have been getting into alternative languages that support an actor/agent/shared nothing architecture - ie. scala, clojure etc (clojure also supports shared state).

So far most of the documentation that I have read focus around the intro level. What I am looking for is more advanced documentation along the gang of four but instead shared nothing based.

Why ? It helps to grok the change in design thinking. Simple examples are easy, but in a real world java application (single threaded) you can have object graphs with 1000's of members with complex relationships. But with agent based concurrency development it introduces a whole new set of ideas to comprehend when designing large systems. ie. Agent granularity - how much state should one agent manage - implications on performance etc or are their good patterns for mapping shared state object graphs to agent based system. tips on mapping domain models to design. Discussions not on the technology but more on how to BEST use the technology in design (real world "complex" examples would be great).

解决方案

Even if I cannot come up with any good real world examples that provide you with design patterns straight up, there are a few places to start.

The first is getting your head wrapped properly round the concepts. One book helping you do this is Making reliable distributed systems in the presence of software errors written by an Erlang Guru Joe Armstrong where explains Concurrency Oriented Programming in a very accessible way. It is in fact a Ph.D. thesis, but do not let that scare you. It is by far easier to read, and pleasant into the bargain, than most common text books.

Looking at actual systems normally means that you have to learn too much about the actual language for it too make sense just to evaluate things. For Erlang the documentation provides design methodology and behaviours(Erlang speek for design pattern libraries). This will illustrate the design patterns most commonly used in this setting. And these have proved to be effective in building large scale systems, i.e. millions of lines of code (comparable to a factor 4 to 10 of other languages such as Java) and milloins of concurrent processes running on one machine in distributed clusters of machines. A recent example of a real live system is Facebook Chat.

For the other frameworks I cannot really help you I am afraid.

这篇关于基于并发设计的Agent / Actor的设计模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆