为什么使用OTP与erlang

为什么使用OTP与erlang

本文介绍了为什么使用OTP与erlang?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题是:使用OTP设计原则在使用erlang开发时带来什么好处?



(我正在开发一个只接收命令并发送响应的服务器)

解决方案

OTP是一种经过艰苦努力的设计元素和惯用语,用于创建,正如Jonas所说,容忍系统等(如灵活性,实时更新等)。简单来说,您希望将其用于这些环境或可能扩展到这些环境中的环境中,因为在Erlang中创建可靠,稳定的系统的大量血液,汗水和泪水被烘焙到OTP行为和体系结构中。如果您不使用它们,您将不具备容错,灵活的系统,或者您将重新创建所有的决策,一次一个流感和错误,最终创建一个克隆的数量的OTP。



所以问题的确是在不要你想使用OTP吗?如果您没有执行长时间运行的软件,而不会中断,您不需要OTP。如果您已经有一个框架来完成您更熟悉的工作,那么您不需要OTP。你不需要OTP,如果你想学习(难道,也许)OTP的设计背后的决定。如果学习它的成本(并且有一定的成本)超出了您的软件的系统停机时间,您不需要OTP。



最好的方式熟悉OTP的人物和OTP的哪些地方是。在没有直接陈述推理的地方,您可以经常在线之间阅读以发现每个组件的理由。


As the question said: What benefits brings using the OTP design principles when developing with erlang?

(I am developing a server which will just receive commands and send responses)

解决方案

OTP is a battle-hardened set of design elements and idioms used in the creation of, as Jonas said, fault-tolerant systems among other things (like flexibility, live updates, etc.). In brief you want to use it for these environments, or environments that may grow into these, because a lot of the blood, sweat and tears of creating reliable, stable systems in Erlang is baked into the OTP behaviours and architecture. If you don't use them you'll either not have a fault-tolerant, flexible system or you'll recreate all of the decisions, one flub and error at a time, to create, in the end, what amounts to a clone of OTP.

So the question really is when don't you want to use OTP? You don't need OTP if you're not doing software that's intended to run for a long time with minimal interruption. You don't need OTP if you already have a framework that does its work that you're more familiar with. You don't need OTP if you want to learn (the hard way, perhaps) what decisions are behind OTP's designs. You don't need OTP if the cost of learning it (and there is a cost there!) exceeds the cost of system downtime for your software.

The best way to become familiar with the whys and wherefores of OTP is the OTP Design Principles User's Guide. Where the reasoning isn't directly stated, you can often read between the lines to discover the rationale for each component.

这篇关于为什么使用OTP与erlang?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 01:11