Thursday, April 4, 2019

RESTful Web services

Message oriented communication with resource oriented communication 

Message oriented communication
Asynchronous communication does not require both the sender and the receiver to execute simultaneously. So, the sender and recipient are loosely-coupled.The amount of time messages are stored determines whether the communication is transient or persistent.


follow this link additional
https://www.youtube.com/watch?v=hcvBDQUifHc


Discuss the resource based nature of the REST style

A URL a resource identifier that identifies/locates a resource in the server.Representational State Transfer (REST) is a style of software architecture for distributed systems such as the World Wide Web. REST-style architectures consist of clients and servers.

The fundamental concept in any Restful API is the resource. A resource is an object with a type, associated data, relationships to other resources, and a set of methods that operate on it. It is similar to an object instance in an object-oriented programming language, with the important difference that only a few standard methods are defined for the resource (corresponding to the standard HTTP GET,POST,PUT and DELETE methods),while an object instance typically has many methods.
Resources can be grouped into collections.Each collection is homogeneous so that it contains only one type of resource,and underscored.Resources can also exist outside any collection.In this case,we refer to these resources as singleton resources.Collections are themselves resources as well.
Collections can exist globally,at the top level of an API,but can also be contained inside a single resource. In the latter case,we refer to these collections as sub-collections.Sub-collections are usually used to express some kind of "contained in" relationship. We go into more detail on this in Relationships.

Explain the meaning of “representations” in REST style 

Representational State Transfer (REST) is a software architectural style that defines a set of constraints to be used for creating Web services Web resources were first defined on the World Wide Web as documents or files identified by their URLs.REST uses various representations to represent a resource where Text, J SON, XML. The most popular representations of resources are XML and J SON.

 REST, indicating their use in the domain of web 

REST (Representational State Transfer) is an architectural style for developing web services. REST is popular due to its simplicity and the fact that it builds upon existing systems and features of the internet's HTTP in order to achieve its objectives, as opposed to creating new standards, frameworks and technologies.
language-independent architectural style.REST-based applications can be written using any language, be it Java, Kotlin,NET, Angular or JavaScript. As long as a programming language can make web-based requests using HTTP, it is possible for that language to be used to invoke a Restful API or web service.On the server side,there are a variety of REST-based frameworks for helping developers create Restful web services,including Rest let and Apache CXF. From the client side,all of the new JavaScript frameworks,such as JQuery, Node.js,Angular and EmberJS,all have standard libraries built into their APIs that make invoking Restful web services and consuming the XML- or J SON-based data they return a relatively straightforward endeavour Similarly,Restful web services can be written using any language,so developers tasked with implementing such services can choose technologies that work best for their situation.

Identify contemporary examples of different types of implementations for the elements of REST style 

  • Client–server architecture.
  • Statelessness.
  • Cache ability.
  • Layered system.
  • Code on demand (optional)
  • Uniform interface.
  • Relationship between URI and HTTP methods.

The Representational State Transfer (REST) architectural style is a worldview that elevates information into a first-class element of architectures.REST allows us to achieve the architectural properties of performance,sociability,generality,simplicity,modifiable, and extensible.

Explain how to define the API of RESTful web services using RESTful URLs

Every system uses resources.These resources can be pictures,Video files,Web pages, business information, or anything that can be represented in a computer-based system.The purpose of a service is to provide a window to its clients so that they can access these resources. Service architects and developers want this service to be easy to implement, maintainable, extensible, and scalable. A Restful design promises that and more. In general, Restful services should have following properties and features, which I'll describe in detail:
  • Representations
  • Messages
  • URLs
  • Uniform interface
  • Stateless
  • Links between resources
  • Caching

pros and cons of using MVC for RESTful web service development, indicating the application of MVC in RESTful web service design 

The most common discussion I've seen regarding the pros and cons of REST tends to frame that discussion relative to SOAP.I have no experience in either.I am currently faced with a decision which my lack of experience is making hard for me to evaluate.I am beginning to develop an application that has several components - primarily an administrative aspect that allows the owner to administer several sites - and a public facing user interface that allows the user to interact with data held on the host.I need to evaluate the implications of allowing the latter part to be hosted anywhere and communicate with the former via a Restful architecture - or demanding that both components reside on the same host.What are the key implications of developing Restful architecture,particularly with regards to it's capacity in the following areas.

JAX-RS API and its implementations 

Developing Restful Web services that seamlessly support exposing your data in a variety of representation media types and abstract away the low-level details of the client-server communication is not an easy task without a good toolkit. In order to simplify development of Restful Web services and their clients in Java, a standard and portable JAX-RS API has been designed. Jersey Restful Web Services framework is open source,production quality,framework for developing Restful Web Services in Java that provides support for JAX-RS APIs and serves as a JAX-RS (JSR 311 & JSR 339) Reference Implementation.
Jersey framework is more than the JAX-RS Reference Implementation. Jersey provides it’s own API that extend the JAX-RS toolkit with additional features and utilities to further simplify Restful service and client development. Jersey also exposes numerous extension SPIs so that developers may extend Jersey to best suit their needs.
Goals of Jersey project can be summarised in the following points
  • Track the JAX-RS API and provide regular releases of production quality Reference Implementations that ships with Glass Fish;
  • Provide APIs to extend Jersey & Build a community of users and developers; and finally
  • Make it easy to build Restful Web services utilising Java and the Java Virtual Machine.
  • Apache CXF, an open source Web service framework
  • Jersey, the reference implementation from Sun (now Oracle)
  • Rest easy, J Boss's implementation
  • Rest let
  • WebSphere Application Server from IBM




Identify the annotations in JAX-RS, explaining their use 

Annotations in the JAX-RS API are used to provide meta-data around the web resource. A typical example is to use the @GET annotation with the @Path annotation to identify the method that should handle a GET request to the specified URI in the @Path annotation.
What follows is a very quick overview of the annotations available to mark the methods and classes used to construct web resources. This is not an exhaustive list, there are a few more annotations in the JAR-RS arsenal, however, as the majority of the work of JAX-RS is in configuration and handling web resources, this is where you will find the majority of the API's annotations put to use.
This is the first in a three-part series looking at JAX-RS annotations.

@GETimport javax.ws.rs.GET;
@Producesimport javax.ws.rs.Produces;
@Pathimport javax.ws.rs.Path;
@PathParamimport javax.ws.rs.PathParam;
@QueryParamimport javax.ws.rs.QueryParam;
@POSTimport javax.ws.rs.POST;
@Consumesimport javax.ws.rs.Consumes;
@FormParamimport javax.ws.rs.FormParam;
@PUTimport javax.ws.rs.PUT;
@DELETEimport javax.ws.rs.DELETE;









No comments:

Post a Comment