This repo is for a toy project I'm building following instructions in an online course (Spring Framework 5: Beginner to Guru).
It is an opinionated version of the classic reference application. The idea of Pet Clinic application and the original app is here.
-
Initialize the project from Spring Initialzr
-
Create the basic POJO Data Model
- BaseEntity -> Person -> Owner, Vet
- BaseEntity -> Pet
- BaseEntity -> PetType
- BaseEntity -> Specialty
- BaseEntity -> Visit
-
Refactor the project into Multi-Module project using Maven
-
Using the Maven Release Plugin
-
Service Layer: Interfaces for Services
- CrudService -> OwnerService, PetService, VetService
- Basic functions of CrudService:
findAll()
,findById()
,save()
,delete()
,deleteById()
- Basic functions of CrudService:
- CrudService -> OwnerService, PetService, VetService
-
Map Implementation: Implement Map based Services
- AbstractMapService -> OwnerServiceMap, PetServiceMap, and OwnerServiceMap
-
Controller Layer: Index Page and Controllers
- IndexController, OwnerController, and VetController
- Have a corresponding Service property
- Under templates: index.html, owners/index.html, and vets/index.html
- IndexController, OwnerController, and VetController
-
Load Data on Startup
- Initialize data:
- Create a Class
DataLoader implements CommandLineRunner
- Takes in
OwnerService
andVetService
as property - Override run(String... args) method to initialize and save data
- Create a Class
- Initialize data:
-
Inherit static resources from the original Spring Pet Clinic application and apply their layout to my application
- Copy Master Template from Spring Pet Clinic
- Apply their Layout to each of my index page
-
Spring Data JPA Implementation: implement Spring Data JPA based services
- Convert POJOs to JPA Entities
@Entity
,@MappedSuperClass
- Add Spring Data JPA Repositories
Interface extends CrudRepository<T, ID>
- Add Spring Data JPA services Layer
- Utilizing repositories to retrieve data
- Convert POJOs to JPA Entities
-
Implement View Layer
- Page for owner details.
showOwner()
in OwnerController,ownerDetails.html
- Page for owner details.
- Understand OOP in practice (completely mimicing real life: have a BaseEntity - Person extends BaseEntity - Owner & Vet extends Person etc.)
- Understand Spring MVC in practice (creating service layer, controller layer, and view layer)
- Know the workflow of typical web development - how teams collaborate through version controll tool