Java Web Services Flashcards
What is a web service?
A service offered by an electronic device to another electronic device, communicating with each other via the world wide web.
The most frequent used file formatting is JSON
What is REST?
Representational State Transfer
The REST used by browsers can be thought of as the language of the internet
The RESTFUL API is an application program interface that uses HTTP requests to GET, PUT, POST, and DELETE data.
Basically a web address where devices can make requests to to get data from a database that is typically returned in JSON format. Typically need access to get into the API.
What is a container is spring?
It gives your application some structure to update objects and destroy them when it is not needed.
What is Spring Boot?
Start quickly
Can pick and choose libraries to use
it is probably the number 1 frameword to develop microservices in the java development world
the goal is to build production ready applications quickly
‘
What is the Spring Framework?
It is a frameword to make java development more scalable and easier to manage.
What is tight coupling?
It is where you need to update every created object if there is a change to the underlying class. This can be time consuming and tedious.
What is loose coupling?
It is where you don’t have to update every object or parameter that is created the framework does it for you.
What is a spring container?
A spring container consists of objects and the container handles the initialization of those objects , the whole lifecycle including the destruction of the objects.
The container gets its instructions on what the object to instantiate by reading the configuration metadata provided. The configuration metadat can be represendted either by XML, Java annotations, or Java code.
What is a rest service?
It is part of the web site that makes the request to the database and receives data back in form of JSON.
what is the process for setting up a Spring project?
Need to go to the project and set up some dependencies that will create an xml file that will be read and started and create all of the folders and dependencies like setting up express js. It is a pom file.
How does Spring Boot work?
It maps a class to a controller and has the method and path all mapped out so that it can be a web service.
What is SOAP ui?
It is a way to create a API from the currently run program and a way to test your APIs.
What is a web service # 2?
A web service is a service available on the netword and uses a standardized messaging system. It is a way to access data from other end points and not know how the internal program is set up. Like expedia can use a bunch of web services from other airlines to book tickets throuhg http requests. And would give limited access to the data. The web service is access on the network.
what is a microservice?
It is a service that is independant. Separate a big application into several smaller applications.
What is the format for a REST API?
The format can be anything, but is often JSON
What is the format of a SOAP request?
XML
What is the protocol for the request on the web service?
It follows the http protocol because it is on the network
What is a URI?
Uniform Resource Identifier?
A Uniform Resource Identifier (URI) is a string of characters that unambiguously identifies a particular resource. To guarantee uniformity, all URIs follow a predefined set of syntax rules,[1] but also maintain extensibility through a separately defined hierarchical naming scheme (e.g. http://).
How are URI’s used in web services?
It is an address to request some information in the network. /getBrands or /getBikes etc… each would return the specified resource from the database.
What is a resource based URIS?
/brands , /spares , or spare/25 , need to design the uris logically and with thought
What is the DAO layer?
58
There is no distinction as far as Spring is concerned. By convention you can mark DAO classes with @Repository and services with @Service. Also the former does some persistence layer exception translation.
Since you are asking theoretically: DAO should perform raw database operations and translate them to some higher level constructs (objects, collections). Services should call DAOs and perform business operations. Typically transactions demarcation is performed on service layer to span several DAO calls.
Finally DAO should abstract business logic from persistence details, ideally allowing to switch persistence layer without business logic (services) changes. This is hardly ever possible due to leaking abstraction of persistence providers (e.g. lazy loading).
DAO - data access object, are object to handle connection to your data storage (typicaly database). You have here your queries and DAO provides data to your services.
Services should contain all your logic. If you have logic separete you can theoretically change your UI layer or DAO layer without you affected it.
what is the breakdown of Modular approach to code development?
Code is broken into modules or related classes and the modules communicates with each other and if you need to fix something in one module it doesn’t have to rebuild everything.
Web Services Details
All of the web services are connected over the network , give functionality and a web service is used over the network. Web service is standard data.
What is a service layer?
It is similar to angular and does the requests to get the data