Rest Api
Rest Api
Abstract-
In this paper the paper's approach is illustrated using a typical
scenario to highlight the benefits of their composition method.
Furthermore, they implemented a prototype to demonstrate the
applicability of their proposal, conducted experiments, and discussed
the obtained results.
Evolution of Web Services: Over the past decade, web services have
emerged as a significant success factor in enabling interoperability on the
web. These services allow users to find solutions for various tasks easily.
Additionally, service composition or mashups have enabled the combination
of multiple services to address complex user needs, thereby adding value to
the processes.
function is of two type first is named function and second is anonymous
function for name function we will pass named of callback function as a
argument of parent function and and for anonymous function we will pass
whole function as a argument of parent function.
in modern JavaScript we we can replace anonymous function by Arrow
function.
1. Growth of Web Services and APIs: The success of web services is
evident from the exponential growth in available APIs. For instance, the
reference to ProgrammableWeb highlights the increase in the number of
APIs available on the web. In 2005, ProgrammableWeb referenced 105
APIs, while by 2014, the number had skyrocketed to more than 10,000
APIs, not even including mashups. This indicates the rapid expansion of
available web services during this period.
Synchronous code-
synchronous code is the execution of code sequently what does it mean there
is n line of code then each code will execute one after another code, initially
our JavaScript is totally synchronous type language but there is a lots of
problem in synchronous code when we deal with event function, server
response, input-output response, in this condition our whole application will
get freeze and stuck if we use synchronous code so that's why all event listner
is a asynchronous type in nature.
Eg. Console.log(‘hello’);
Console.log(‘bolo to ’);
Console.log(‘kaise o’);
Console.log(‘hii’);
This is synchronous code so each code is dependent to their previous code
and run one after another.
If any code is not running then whole code will not run. So this is
disadvantage of this concept if we are dealing with event listner or any server
respose task like api call by backend or server it will get freez to whole
application. So we will use Asynchronous code for this type of problems
Asynchronous code-
eg. console.log('abcd');
let content=document.querySelector('.wrapper');
content.addEventListener('click',function(event)
{
console.log('this is para'+event.target.textContent);
});
console.log('1234');
in this code first abcd will print and if user has clicked on wrapper then also
1234 will print then after this “'this is para” it will print.
so here this is happening console.log ABCD will goes to call stack and it will
print and then listener goes to call stack and then to Browser Handler it will
wait till user is clicked on specific tag and then third code is console.log 1234
will execute and if user clicked specific tag then it will go to event queue then it
will check that call stack is empty or not if call stack is empty then event
listener function will execute that is it will print this is para 1
for asynchronous code event listener there is three component call stack
Browser Handler event queue every asynchronous code will go through these
three component and this will execute by loop and this actually synchronous
code there is no need of event loop only event loop is required for
asynchronous for their execution it is very important point is that after
synchronous code our event listener has executed instead of this it will not
execute till call stack is not empty so, for running asynchronous code it is very
important that call stack is empty.