Data from API Flashcards

1
Q

Distributed Computing

A

It allows 2 diff apps running on 2 diff machines to share info. it also allows 2 diff objects running in 2 diff process on same machine to share info.
Distributed technologies
- CORBA - Common Request Broker Architecture (14 languages)
- DCOM - Distributed Component Object Model - VB
- RMI - Remote Method Invocation - J2EE
- EJB - Enterprise Java Beans - Java
- Web Service - All technologies
- Remoting - .Net

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Computing Architecture

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Web Service Specification

A
  1. SOAP
  2. REST
  3. JSON
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

SOAP

A

Service Oriented Architecture Protocol
- Consumer sends XML request
- Provicer sends XML response

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

REST

A

Representational State Transfer
- Consumer sends a query request
- Provider sends XML response, optionally JSON
-?category=electronics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

JSON

A

JavaScript Object Notation
Consumer and provider use JSON

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

API

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

JavaScript API

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

XMLHttpRequest

A

JS object used to communicate with an end point. it provides props and methods to handle communication.
var http = new XMLHttpRequest(); (BOM object)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

XMLHttpRequest - open()

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

XMLHttpRequest - send()

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

XMLHttpRequest - Life Cycle Methods

A

onreadystatechange - f()
It executes the AJAX function and identifies the result. It defines actions to perform when response is ready.
It depends on “readystate” status, which includes
0: Initial
1:Pending
2:Processing
3:Completed
4:Ready [Response Ready]

responseText : returns string response
responseXML : returns XML response
responseHTML : returns HTML response

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

XMLHttpRequest - Drawbacks

A

XMLHttpRequest object doesn’t offer native support for synchronous requests, leading to potential blocking of the UI while waiting for a synchronous response.
No Built-in Support for Promises: XMLHttpRequest doesn’t natively support modern features like Promises, which can make code harder to read and maintain, especially when dealing with multiple asynchronous operations.
Explicit async config is required
the response is not directly in JSON format
It requires explicit parsing methods [JSON.parse()]
It is poor in error handling (cant track client and server side errors implicitly)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

JavaScript Fetch Promise

A

Fetch is JS window object method
It is a promise.
It is implicitly Async
It provides implicit catch method, but cant catch the issues
It requires an explicit “throw”
It returns daat in binary format
Explit data parsing is required

fetch(“url”).then().catch().finally()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

JQuery Ajax

A

Syntax:
$.ajax({
method:””,
url:””,
data:{},
success: (),
error: ()
})

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

axios

A

An external library to make API calls and has rich error handling

17
Q

How can you know about the keys in any unknown object ?

A
  1. Object.keys() => returns the array of all keys in a object
    Object.keys(objName).map(function(key) {
    typeof objName[key]
    })
  2. for .. in iterator
    for(var prop in object)
    {}
18
Q
A