vendredi 10 juillet 2020

How to change folder structure using MVC design pattern in a java console application

I developed an application which gets the data from the user from the console and pass the data to the frontend and Spring rest api is used for that purpose. So now I want to rearrange the folder structure according to the MVC.
Can you please check what I've done so far and correct me if I'm wrong, my knowledge on design pattern is very low.

enter image description here

Controlller

BookController - Class with rest api to pass data to frontend

Model

Book - Parent class with variables and relevant methods
Novel - Child class with variables and relevant methods
Poems - Child class with variables and relevant methods
MyBookManager - BookManager interface implemented class which includes crud operations with mongoDB

View

BookManager - Interface related to MyBookManager
Console - Class which takes the input from users from the the console and calls methods in MyBookManager to save them to DB

Repository

BookRepository - Interface which extends MongoRepository

Other classes

BookStoreApplication - Class which includes the main method
ErrorHandle - Class which includes methods for validations

Aucun commentaire:

Enregistrer un commentaire