是否有可能建立使用非功能性的语言反应应用? [英] Is it possible to build a Reactive Application using a non-Functional language?

查看:167
本文介绍了是否有可能建立使用非功能性的语言反应应用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如果无功申请宣言背后的原理可以使用的非功能性的语言来实现

I would like to understand if the principles behind the Reactive Application manifesto can be achieved using a non-functional language.

有人说,既然FP使用一成不变的状态和无副作用的函数,它们更容易实现同步,分布式和有弹性的系统。

Some people say that since FP use immutable states and free side-effects functions, they are easier to implement concurrent, distributed and resilient systems.

但是,我们如何才能做到这一点使用Java例如?

But how can we achieve that using Java for example?

有一些框架,如Apache的骆驼,有一些组件的工作,例如骆驼RX 骆驼SEDA

There are some frameworks like Apache Camel, that have some components to work with, like Camel RX, and Camel SEDA.

这些是不够的框架?

我会尽力澄清我的问题:

我觉得反应式编程的新的编程范式,和一个新的编程范式,需要新的工具和框架。

I think of reactive programming as new programming paradigm, and a new programming paradigm requires new tools and frameworks.

函数式语言处理与不同的对象,这就是为什么有很多关于FRP与基于事件的事情工作的文章和异步。

Functional languages deals with objects differently, that's why there's a lot of articles about FRP working with things event-based and asynchronously.

但现在,支持到Java或其他面向对象的语言,让我们觉得在一个Web应用程序:

But now, backing to Java, or other Object Oriented language, let's think in a Web Application:


  1. 我们如何创建一个Java Web应用程序,使利用好
    基于事件的前端。

  2. 这些事件则比较顺利地到后台异步传递信息。

  3. 后端可以轻松扩展,并有弹性为好。

我知道这是可以创建完成用java这些要求和servlet的应用程序,和EJB,但我的问题是,我们能做到不同?
越靠近反应的方法吗?

I know that is possible to create an application that accomplish these requirements using java, and servlets, and EJBs, but my question is, can we do it differently? More close to a reactive approach?

我觉得是这样的:


  • 在前端一个不错的Ajax框架,这使得传递信息与后端的顺利进行。

  • 在后端使用的框架或库的方式(SEDA骆驼骆驼鸥RX)并行执行的事情。

你觉得这是一个很好的方法吗?

Do you think this is a good approach?

推荐答案

无编程是不是新的,但它是新的大多数人。这是一个简单的数据流的另一个名字已经出现自20世纪60年代。无功宣言是描述数据流和反应式编程的最优秀的品质公正的方式。

Reactive Programming is not new, but it is new to most people. It is simply another name for dataflow that has been around since the 1960's. The Reactive Manifesto is just way to describe the best qualities of Dataflow and Reactive Programming.

当然不是需要一个功能性的语言,也不是一个巨大的图书馆。我实现了很多数据流系统。他们大多是更多比大多数会调用辅助函数的集合的图书馆。这真的取决于你在系统中想要什么类型的特征。

A functional language is certainly not needed nor is a huge library. I've implemented many dataflow systems. Most of them are more of a collection of helper functions than what most would call a "library." It really depends what type of features you want in the system.

数据流是一个非常宽主题。该系统的可能的有许多不错的到了功能,或者可能只是具备了基础知识。数据流的核心是数据控制的执行。这是相反的,你告诉计算机控逆变流(像C#和Java所有的主流语言中使用)何时,何地以及如何处理这些数据。数据流的最常见的形式是在管道模型...一系列框(或节点)连接顺序与链接(又名管道,电线或弧)彼此

Dataflow is a very "wide" topic. The system could include many nice-to-have features or it could just have the basics. The core of dataflow is that the data controls execution. This is in contrast to "contol-flow" (used in all mainstream languages like C# and Java) where you tell the computer when, where and how to process the data. The most common form of dataflow is the Pipeline model... a series of boxes (or nodes) connected sequentially to one another with links (aka pipes, wires or arcs).

我刚开始研究可用于Java流编程库,所以我不能给你一个明确的答案现在。如此看来,RxJava是当前的名牌的数据流在Java中,所以我会从那里开始。在我即将出版的新书( http://DataflowBook​​.com )我将致力于全断面中常用的语言的可用数据流库,包括Java。

I have just started to examine the libraries available for Java dataflow programming so I can't give you a specific answer right now. It seems that RxJava is current "name-brand" for dataflow in Java so I would start there. In my upcoming book (http://DataflowBook.com) I will devote a whole section to the available dataflow libraries in common languages, including Java.

这篇关于是否有可能建立使用非功能性的语言反应应用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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