Closed lenagainulina closed 6 years ago
This does not solve the problem in general since it is still the same Business object from the database and you have to tune its jackson annotation properties if you want to disable sharing of same data from db to the web client.
Even more, it might be the case that the Web counterpart contains more or different data, than the DB one. It may even be a completely different structure. Imagine, we would like to extend the storage model with additional services a business may offer. This may be a different composition and properties to store in the db and to show to the client on the web.
I would think of what do you want to show to the client and since we have just very few entities, go for 2 sets and mappers.
I would also consider to add some unit tests already.
I would go for merging some of these PRs in order to have something running.
Since it is not clear whether we will cover Frontend for Backend in the course, I would go for Thymeleaf/jsp for UI rendering. Some of rest endpoints may be dropped since we are not going to use json to deliver data to the frontend, but we need to replace them with server pages as I have shown in one of last lections.
If we still want to keep a bit of microservice architecture here and still leave with Business microservice and Order microservice, then we need to identify 2 things:
What is UI/UX interaction with our backend? I assume this is placing order, viewing its status, rerequesting it, then register/manage business and confirm the order, see the list of confirmed/pending orders.
Business service will check for available orders not via database but via calling OrderController via http gateway. An order service may enrich the output to customers UI as well via http gateway, not via joining 2 tables in the DB.
Think about it, we can go fully monolithic and it is very simple or we may play a bit with scalability abd microservices.
I would go for microservice architecture instead of a monolith.
Hi, please check, if the business class is ok (used @JsonIgnoreProperties here).