mercredi 7 décembre 2022

MVC vs REST/React in terms architecture

Sorry, if it's kind of newb question. Please, help me to correctly name the architectures I described below.

Lets take we had web-application built with Spring framework/Hibernate/Thymeleaf(or another template engine) with the code of controllers looked like:

@Controller
public class AboutController {
    @GetMapping("/about")
    public String aboutview (Model model) {
        return "about";
    }

So, this is pure MVC software design pattern, as I take.

After this we switched from Thymeleaf to ReactJS for UI. So colleagues asked me to make few REST endpoints, which was used later for drawing single React's page. To be more concrete, let's take this controllers produced a filtered list of the users and goods, which was gotten from the JPA Repository.

So, the questions are:

  1. To which architectural pattern did we switched off instead of pure MVC in above mentioned sample?
  2. If it wasn't HMVC (hierarchical MVC), how it supposed to be looked like in term of controllers? Is it should look like few REST-controllers, which calls each other or simultaneously being called from React?
  3. If I have few microservices, which has endpoints being called from the one React's page (or whatsoever JS framework), how can I correctly name an architecture of the Application: "microservice app with MVC pattern?"

Aucun commentaire:

Enregistrer un commentaire