Java Web Services Flashcards

1
Q

What is a web service?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is REST?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a container is spring?

A

It gives your application some structure to update objects and destroy them when it is not needed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Spring Boot?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the Spring Framework?

A

It is a frameword to make java development more scalable and easier to manage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is tight coupling?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is loose coupling?

A

It is where you don’t have to update every object or parameter that is created the framework does it for you.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a spring container?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a rest service?

A

It is part of the web site that makes the request to the database and receives data back in form of JSON.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is the process for setting up a Spring project?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does Spring Boot work?

A

It maps a class to a controller and has the method and path all mapped out so that it can be a web service.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is SOAP ui?

A

It is a way to create a API from the currently run program and a way to test your APIs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a web service # 2?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is a microservice?

A

It is a service that is independant. Separate a big application into several smaller applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the format for a REST API?

A

The format can be anything, but is often JSON

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the format of a SOAP request?

A

XML

17
Q

What is the protocol for the request on the web service?

A

It follows the http protocol because it is on the network

18
Q

What is a URI?

A

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://).

19
Q

How are URI’s used in web services?

A

It is an address to request some information in the network. /getBrands or /getBikes etc… each would return the specified resource from the database.

20
Q

What is a resource based URIS?

A

/brands , /spares , or spare/25 , need to design the uris logically and with thought

21
Q

What is the DAO layer?

A

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.

22
Q

what is the breakdown of Modular approach to code development?

A

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.

23
Q

Web Services Details

A

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.

24
Q

What is a service layer?

A

It is similar to angular and does the requests to get the data

25
Q

How do you connect with a database?

A

Using the connector jar that need to download into the application.

26
Q

Describe a web service

A

It is something similar to expedia…say they are working with Air Canada, air canada will expose a web service to expedia where expedia can book and cancel flight information. Expedia doesn’t have access to the database and only air canada does.

27
Q

what is one other important item about web services?

A

It is just data and doesn’t send anything back no html or anything else just web data

28
Q

What is a resource based URI?

A

It is an address that leads to a resource and returns a resource. Like /bikes would return bikes or /bikes/honda would return all Honda Bikes. Dynamic pages that generate a page based on the city or the parameter. Need to understand how the URI and need to architect them correctly and need to have proper relationship and not have confusion. It is the proper way to construct an api

29
Q

What is a file based link?

A

it is a resource that leads to a file and a static pages

30
Q

What is one way to create a API to a java class?

A

Need to add a @Path annotation to customize the java class and then add @path(“getbrands”) that way it can return something and just need to annotate the class to run it

31
Q

What is the base url?

A

It is the main url to the site and will change once you have deployed your app

32
Q

What is the @path param annotation?

A

It is an annotation that will tell the uri that the path has a parameter.