Weather API Implementation
Weather API Implementation
High-Level Approach
Product Architecture
Implement controllers to handle requests and responses for all the CRUD operations.
In Model set the properties you want to create the response of.
In Service get the methods that are required.
Primary goals
Requirements
1. Create a maven project using Spring MVC archetype. You can refer to the below reference
to set-up your first maven project using spring archetype to pom xml step wise.
Creating a maven project using in IntelliJ IDEA
2. Create separate packages for controller classes, service classes, entity classes .
Packages in Java
Design Pattern - MVC
3. Auto download any spring dependencies if needed (Check the colour codes in the xml
files- if the colour is red, you need to import the dependency).
Import Spring Dependencies
4. Create a schema in the database and add a new table. The table should consist the below
column names -
Location
Date
Temperature
Requirements
The service layer is there to provide logic to operate on the data sent to and from the DAO and
the client. Very often these two pieces are bundled together into the same module. Service
layer provides code modularity and can also be used to serve loose coupling in the application.
Requirements
1. Create a service interface and a service implementation class under the service package.
2. Write the four method definition on the interface class-
Get the total customer list
Save customer information
Get the customer list from a given customer id (for update functionality)
Delete customer information
3. Write down the service implementation class by defining the four methods implemented
from the interface.
Requirements
2. Create a WAR file. If built from IDE. You need to manually build a war file.
Create a WAR file
3. Run the tomcat server from IDE or independently
Else keep the WAR file on the tomcat webapps folder and click on start.bat file present in
the bin folder.
Deploy web application through Tomcat
4. Write down the web URL and start your web application.