Lesson 4: Web Services Flashcards
What is the 3-tier architecture?
Presentation - Business - Persistence
Client - web server - database
What is a web service?
A web service is a software system designed to support interoperable machine-to-machine interaction over a network.
— extra details —
It has an interface described in a machine-processable format (WSDL). Other systems interact with the web service in a manner prescribed by its description using SOAP or RESTful messages, typically conveyed using HTTP with an XML or JSON serialization in conjunction with other web-related standards.
Give some benefits of a web service.
- loose coupled design
- ease of integration
- service reuse
What benefits do we gain with a loose coupled design in a web service?
- Each service exists independently of the other services that make up the application
- Individual pieces of the application can be modified without impacting unrelated areas.
What are some characteristics of the ‘ease of integration’ benefit when using a web service?
- Data is isolated between applications.
- Web services act as glue between these and enable easier communications within an across organizations
Describe the ‘service reuse’ benefit of web services.
- Take code reuse a step further
- A specific function within the domain is only ever coded once and used over and over again by consuming applications
What is REST and what is it short for?
REpresentational State Transfer.
Rest in an architectural style.
What is the difference between URI, URL and URN
URI is a Uniform Resource Identifier and can be a URL, URN or both.
URL is a Uniform Resource Locator and is the location where you can find the resource
URN is a Uniform Resource Name and defines an item identity
How are REST resources described?
- Describe resources, not applications
- Make it short
- Hackable up the tree
- Meaningful
- Predictable, human-readable
- Nouns, not verbs
- Permanent
- Query arguments are only for parameters
- Avoid extensions
What is a RESTful API? What does it have?
= web service API that adheres to the REST style
- it has a base URI
- it has an internet media type for the data
- It uses standard HTTP methods
- It uses hypertext links to reference states
- It uses hypertext links to reference related resources
Describe JSON in keywords.
- Open Standard
- Human-Readable text
- Alternative to XML
- Language-independent
- Support in many programming languages
- has the ability to define a schema for validation
What are the 6 REST architectural constraints?
1) Interface uniformity between components
2) Client-server model (separation of concerns)
3) Stateless client-server communication
4) caching
5) Layering
6) Code on demand (optional)
What is the “Interface uniformity between components” constraint in REST?
Components need to speak the same language and know what to expect in order to understand each other
What is the “client-server model (separation of concerns)” constraint in REST?
Client and server are fully decoupled and can be developed independently
What is the “stateless client-server communication” constraint in REST?
Each request from client to server must contain all the information necessary to understand the request, and cannot take advantage of any stored session state on the server.