Skip to content

This repo deals with the Dependency Injection which is the core concept of Spring Core along with Model-View-Controller Design pattern

Notifications You must be signed in to change notification settings

Victorhashl/Spring-MVC

Repository files navigation

How to RUN the application

Build the project using Gradle Clean Build
Now the run the application-it will be live on port 8080 of your localhost
Now open POSTMAN with the localhost:8080 url followed by /employees
According to various Requests select required Post,Get,Delete,Put options
The embed database can also be accessed through /h2-console (all the configurations are provided in application.properties)

You are good to go



Dependency Injection

DevDB and ProdDB implements the DB interface which has public method getData which returns a string depending upon the class.
AppConfig class(with @Configuration annotation) has 2 Beans defined for eaach of the DB-type classes.It also mentions the condition on the property defining when to instantiate which class.
This dependency to be injected is mentioned in application.properties.

REST APIs

Several request methods are available(like GET,POST,DELETE,PUT) This has been achieved through 3 layer structure(MVC) -
Presentation Layer(used to interact with the client)
Service Layer(contains the business logic)
Persistence Layer(manages the database/repository)

About

This repo deals with the Dependency Injection which is the core concept of Spring Core along with Model-View-Controller Design pattern

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages