Message oriented communication
Message-oriented communication is a way of communicating between processes. Messages, which correspond to events, are the basic units of data delivered. Tanenbaum and Steen classified message-oriented communication according to two factors---
synchronous/asynchronous communication
transient or persistent communication.
resource oriented communication
A resource-oriented architecture (ROA) is the structural design supporting the inter-networking of resources. A resource, in this context, is any entity that can be identified and assigned a uniform resource identifier
Discuss the resource based nature of the REST style
Representational State Transfer (REST) is an architectural
style for the service of web .
The REST is used as a basis for HTTP 1.1 development
REST is
•Resource-based
•Focuses on Representations
•How resources get manipulated and presented
•Part of the resource state is transferred between client and server
•Typically JSON or XML
•Or even can be a web page, file, image, etc…
•E.g. The state of a student (as per the database) can be represented by a resource of webpage, XML dataset, etc…
Discuss the constraints of REST, indicating their use in the domain of web
1)Client-server
•The REST is for explicitly for networked distributed systems, which are based on the client-server style
2) Layered System
•A client doesn’t need to know whether it is connected directly to the end server, or to an intermediary along the way.
•Intermediary servers may improve system scalability by enabling load-balancing and by providing shared caches. •Layers may also enforce security policies.
3) Stateless
•One client can send multiple requests to the server
•each request is independent
•every request must contain all the necessary information so that the server can understand it and process it accordingly. •the server must not hold any information about the client state.
•Any state information must stay on client –such as sessions.
4) Cacheable
•As many clients access the same server, often they may request the same resources
•it is necessary that these responses might be cached, avoiding unnecessary processing, which may affect performance
5) Code-On-Demand (Optional)
•This allows the customer to run some code on demand, that is, extend part of server logic to the client, either through an applet or scripts.
6) Uniform Interface
•defines the interface between clients and servers.
•It simplifies and decouples the architecture, which enables each part to evolve independently
➤Identification of resources
•Based on the web’s Request-Response model
•Request = URL + HTTP Verbs (GET,POST,PUT,DELETE)
•Response = HTML, XML, JSON, TXT, etc…
Identify contemporary examples of different types of implementations for the
elements of REST style
Components
•Software that interacts with one another
•Communicate by transferring representations of resources through a standard interface rather than operating directly upon there source itself
•Used to access, provide access to, or mediate access to resource
Connector
•represent activities involved in accessing resources and transferring representations.
•REST encapsulates different activities of accessing and transferring representations into different connector types •connectors are abstract interfaces for component communication, enhancing simplicity by hiding the underlying implementation of resources and communication mechanisms
Data
•key aspect of REST is the state of the data elements, its components communicate by transferring representations of the current or desired state of data elements
Explain how to define the API of RESTful web services using RESTful URLs
Request = URL + HTTP Verbs (GET,POST,PUT,DELETE)
•URL is the key technique in RESTful communication
•The API of the RESTful service is a set of URLs
•The resource is determined by the URL segments
•The CRUD operations are determined by the HTTP verb
Discuss the pros and cons of using MVC for RESTful web service development, indicating the application of MVC in RESTful web service design
MVC is pretty straightforward. There is a Model, a Controller and a View. When we create a website, it all come together as 'client sends REST keyword request to server -> the server matches the requested URL to the controller action . which then calls the model(s) for data gathering/processing, gets the result . and returns the result back to the client as a HTML page (view)'.
Discuss the JAX-RS API and its implementations
•JAX-RS is an API
•There are two implementations
1. Jersey
2. RESTeasy
Identify the annotations in JAX-RS, explaining their use
@PathThe
@Pathannotation’s value is a relative URI path indicating where the Java class will be hosted: for example,/helloworld. You can also embed variables in the URIs to make a URI path template.
@GET
The@GET annotation is a request method designator and corresponds to the similarly named HTTP method. The Java method annotated with this request method designator will process HTTP GET requests. The behavior of a resource is determined by the HTTP method to which the resource is responding.
@POST
The@POST annotation is a request method designator and corresponds to the similarly named HTTP method. The Java method annotated with this request method designator will process HTTP POST requests. The behavior of a resource is determined by the HTTP method to which the resource is responding.
@PUT
The@PUT annotation is a request method designator and corresponds to the similarly named HTTP method. The Java method annotated with this request method designator will process HTTP PUT requests. The behavior of a resource is determined by the HTTP method to which the resource is responding.
@DELETE
The@DELETE annotation is a request method designator and corresponds to the similarly named HTTP method. The Java method annotated with this request method designator will process HTTP DELETE requests. The behavior of a resource is determined by the HTTP method to which the resource is responding.






















