Section 1

Preview this deck

What is different between two way data binding and one way data flow

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (11)

Section 1

(11 cards)

What is different between two way data binding and one way data flow

Front

Two way data binding means that UI fields are bound to model data dynamically such that when a UI field changes, the model data changes with it and vice-versa. One way data flow means that the model is the single source of truth. Changes in the UI trigger messages that signal user intent to the model (or "store" in React). Only the model has the access to change the app's state. The effect is that data always flows in a single direction, which makes it easier to understand. One way data flows are deterministic, whereas two-way binding can cause side-effects which are harder to follow and understand.

Back

What is RESTful

Front

REST stands for Representational State Transfer, an architectural style that has largely been adopted as a best practice for building web and mobile applications. RESTful services are designed to be lightweight, easy to maintain, and scaleable. They are typically based on the HTTP protocol, make explicit use of HTTP methods (GET, POST, PUT, DELETE), are stateless, use intuitive URIs, and transfer XML/JSON data between the server and the client.

Back

What are the states of a promise

Front

Pending - the promise's outcome hasn't yet been determined, because the asynchronous operation that will produce its result hasn't completed yet. Fulfilled - the asynchronous operation has completed, and the promise has a value. Rejected - the asynchronous operation failed, and the promise will never be fulfilled. In the rejected state, a promise has a reason that indicates why the operation failed.

Back

Asynchronous vs synchronous

Front

Synchronous programming means that, barring conditionals and function calls, code is executed sequentially from top-to-bottom, blocking on long-running tasks such as network requests and disk I/O. Asynchronous programming means that the engine runs in an event loop. When a blocking operation is needed, the request is started, and the code keeps running without blocking for the result. When the response is ready, an interrupt is fired, which causes an event handler to be run, where the control flow continues. In this way, a single program thread can handle many concurrent operations.

Back

call(), apply(), bind()

Front

call - The first parameter in call() method sets the "this" value, which is the object, on which the function is invoked upon. apply - first parameter in apply() method sets the "this" value which is the object upon which the function is invoked. bind - In the above code sample for bind() we are returning a bound function with the context which will be invoked later.

Back

Callback

Front

Simply put: A callback is a function that is to be executed after another function has finished executing — hence the name 'call back'. More complexly put: In JavaScript, functions are objects. Because of this, functions can take functions as arguments, and can be returned by other functions. Functions that do this are called higher-order functions. Any function that is passed as an argument is called a callback function.

Back

HTTP Methods

Front

GET - The GET method is used to retrieve information from the given server using a given URI. Requests using GET should only retrieve data and should have no other effect on the data. POST - A POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms. PUT - Replaces all current representations of the target resource with the uploaded content. DELETE - Removes all current representations of the target resource given by a URI. HEAD - The HEAD method asks for a response identical to that of a GET request, but without the response body. CONNECT - The CONNECT method establishes a tunnel to the server identified by the target resource. OPTIONS - The OPTIONS method is used to describe the communication options for the target resource. TRACE - The TRACE method performs a message loop-back test along the path to the target resource. PATCH - The PATCH method is used to apply partial modifications to a resource.

Back

Disadvantages (AJAX)

Front

It can increase design and development time More complex than building classic web application Security is less in AJAX application as all files are downloaded at client side. Search Engine like Google cannot index AJAX pages. JavaScript disabled browsers cannot use the application. Due to security constraints, you can only use it to access information from the host that served the initial page. If you need to display information from another server, it is not possible within the AJAX.

Back

Advantages (AJAX)

Front

Reduce the traffic travels between the client and the server. Response time is faster so increases performance and speed. You can use JSON (JavaScript Object Notation) which is alternative to XML. JSON is key value pair and works like an array. You can use Firefox browser with an add-on called as Firebug to debug all Ajax calls. Ready Open source JavaScript libraries available for use - JQuery, Prototype, Scriptaculous, etc.. AJAX communicates over HTTP Protocol.

Back

Promise

Front

A promise represents the eventual result of an asynchronous operation. It is a placeholder into which the successful result value or reason for failure will materialize.

Back

AJAX

Front

AJAX is Asynchronous JavaScript And XML. The XmlHttpRequest is an actual object which works behind the scene. Ajax implementation uses JavaScript functions to call methods from a webservice, webpage request in response to get response. (Javascript talks to the server while the page you are currently viewing so you don't have to refresh. Like updating a shopping cart.) Response data is parsed using DOM. AJAX just uses a combination of: -A browser built-in XMLHttpRequest object (to request data from a web server) -JavaScript and HTML DOM (to display or use the data)

Back