How best to implement form validation in the architecture of microservices when using Simfony?

Good day!

When unraveling large monolith on Symfony 3.2 there was such a global issue:

how to be a single UI and a service that is responsible for "Oceania", if validation of form?
(And even more complex forms.)

For clarity, we denote "Oceania", for example, "pie".


1. There is a single UI that is responsible for displaying everything. ( In articles I've ever read, called for a unified UI, and that from the point of view of the separation of a view from the only strictly correct )

2. There is a "pie" that is made in a separate micro service. ( As long as it is only a conclusion, everything is fine. )

3. When working in forms in Symfony and architecture microservices validation does not give right to share code.
( According to the principle of microservices, all information must be submitted to the micro service "cakes" for the return, and he has the entity classes and forms, but to return data on error validation in the monolith is not the same entity classes and forms that are used for display. )

The solution that I came up with ( all bad ):

I. Duplicate entity classes and forms for "pies" in the UI and use them for display only.

II. Translate everything to html, and return in the UI. One piece or several.

III. Change requests for each Chihuahua. If you make the services are quite chatty, the solution also exists.

For writing the micro service "cakes" use Symfony 4.2 that adds spice, so even the redundancy selecting this option would be with reservations)

Thanks in advance to all responded.
March 19th 20 at 08:52
0 answer

Find more questions by tags Service-oriented architectureValidation