A new idea of real-time interactive application development in functional reactive-type programming (FRP)

Source: Internet
Author: User

One, reactive?

Please look at a very simple small application, which allows users to enter a keyword in a search input box, and then in the result area below the real-time display from the flicker site to search for the image, when the user input keyword changes, the display of the picture will then change.

This is actually a reactive ability. and similar to the system that automatically responds to changes in the external environment we call the reactive systems (reactive system). Typical external environment changes include the change of external input signals, the occurrence of events, and the response of the system is usually real-time. Interactive system is the most important reactive system, it can not only respond to the changes in the external environment, but also its own internal state in some way feedback to the external observer.

Second, how to build reactive System?

If you want to develop the above flicker real-time search for small applications, what should be done?

Don't be busy, programmers should first make the software as clear as possible before they begin to develop. Although this is a small application, we can still do things with a simple but clearer flowchart:

Users in the input box type a variety of keywords to the flicker to send a search request, they are like a constant flow to the Flicker server "request Flow", the server processing the request to the client back to the search results, formed a "response flow", the client will "reply stream" to "picture Flow" Injected into the result area of the Web page. As soon as the user's input changes, the content in these streams changes as well, and the images displayed in the Web page change.

function is not complex, try to turn it into a program.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.