I am developing a project (.net core) which is still in its infancy. For the moment, I have divided the solution into several projects, each representing a layer. For example: Project.Web (API and code react / ui controllers), Project.Business (essentially a dll, which contains the main business logic) and finally the repository layer (which hosts the entityFramework code connecting to a server SQL, with basic abstraction code to encapsulate it).
I have some questions:
What is the best way to exchange data in this case? Should I create intermediate "contract classes" containing the definition of interfaces between layers? Or is there a better way?
In the future, if I want to refactor the management layer and divide it into several microservices, I'm afraid that the layered architecture above is an obstacle. What is the best way to keep each layer modular so that it can be easily split into microservices later?
Is it a good design to have a single front-end service / unified UI that calls a set of microservices in the backend? Or is it better to have an aggregation service between the two that combines the application sends to microservices and shares the response to the user interface?
In case I split them into microservices, what is the best way to exchange information between them (just expose the external interfaces as a REST API?)