您如何向非程序员解释演员? [英] How would you explain actors to a non-programmer?

查看:91
本文介绍了您如何向非程序员解释演员?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,标题差不多了:如果我坐在您面前的是一个非技术人员/妈妈/十二岁的男孩/可卡犬,并请您解释一下。 wikipedia.org/wiki/Actor_%28programming%29 rel = nofollow noreferrer>演员,从哪里开始?我之所以问是因为我的大师的项目在很大程度上涉及了他们,每隔一天,有人要我告诉他们我在做什么。当我在课程中与其他人交谈时,情况还不错(通常是陌生的概念,但可以理解),但是最近我的室友,化学家要求我向她解释,并且说我挣扎会是一个很大的笨拙。

Well, the title's pretty much it: if I sat a non-techie/my mum/twelve-year old boy/cocker spaniel in front of you and asked you to explain actors to them, where would you start? I ask because my master's project involves them to a pretty large degree, and every other day someone asks me to tell them what I'm doing. When I'm talking to other people on my course it's not so bad—usually the concept is foreign but understandable—but recently my flatmate, a chemist, asked me to explain it to her, and to say I struggled would be a pretty humongous understatement.

我正在寻找某种传达想法的解释,而不是技术上的基础。这可以是一个隐喻,也不必很精确-我只是想让他们了解我对他们正在做什么。有想法吗?

I'm looking for some sort of explanation that conveys the idea, rather than the technical underpinnings. It can be a metaphor, and it doesn't have to be precise—I just want to make them understand what I'm doing with them. Any ideas?

推荐答案


  • 可以有很多演员。所有演员都同时行动。并发是该模型的关键部分。

    • There can be many actors. All actors act "at the same time". The concurrency is a key part of this model.

      Actor无法知道其他Actor在想什么。传递信息的唯一方法是使用消息。 (无共享状态)

      Actors cannot know what other Actors are thinking. The only way to move information is with a message. (no shared state)

      演员可以接收消息,并通过以下方式对其执行操作:

      Actors can receive messages, and act on them by:


      • 使用其中的数据进行计算

      • doing computation with the data in them

      向其他参与者发送消息

      创建其他参与者。

      忽略/丢弃消息。

      这基本上使演员像...人们。人们不知道彼此在想什么,他们必须发送消息来传达信息,他们可以选择忽略传入消息,考虑消息或与其他人交流。人们会偶然发生坏事。很多人都在同一时间做事。要处理更多的负载,请增加更多的人。

      This basically makes actors just like... People. People don't know what each other are thinking, they must send messages to convey information, they have the choice of ignoring incoming messages, considering them, or communicating with other people. Random bad things can happen to people. Lots of people all do things at the same time. To handle more load, add more people.

      关于您的master项目,我建议您了解Erlang Web框架。编程语言 Erlang 是基于Actor模型的,并且效果很好在包括电话交换机在内的可扩展系统中...和 Facebook邮件系统

      Regarding your masters project, I suggest finding out about the Erlang Web framework. The programming language Erlang is based on the Actor model, and is used to great effect in scalable systems including phone switches... and the Facebook messaging system.

      这篇关于您如何向非程序员解释演员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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