From abstraction to implementation details
In the previous sections, we defined the overall organization of the route-planning microservice. In this final section, we will fill in all the details by first defining the domain layer and the database driver, and then defining all commands.
The domain layer
We will define each aggregate in a separate folder that will contain the aggregate, the interface that defines the aggregate state, and the repository interface associated with the aggregate.
However, before starting the definition of all aggregates, we need to add a famous library for handling both geometric and GIS calculations: NetTopologySuite
. It is available in both Java and .NET and all its types conform to a standard recognized by all main databases.
The .NET version is available through the NetTopologySuite
NuGet package. Therefore, let’s add this package to the RoutesPlanningDomainLayer
project. The meaning of GIS object coordinates is defined in...