Description
I'm working with a almost 40 year old project with a lot of legacy code. Over the years multiple databases where added. Now I am converting it step by step to the hexagonal architecture with ports and adapters.
Until now I always created 1 adapter per database. But doing so with this code will give me a representation of my databasestructure in my domain (which I don't want).
Example
If I have a Product object in my domain that can look like this:
public class product()
{
public decimal Price {get; set;}
public string Description {get; set;}
public string Name {get; set;}
}
In this scenario it is possible that the price comes from database 1, the description form database 2 and the name from database 3. All linked by a unique code.
Question
How would I do this in the hexagonal architecture? Should I:
make 1 productAdapter with multiple repositories (1 for every database)
make an adapter for every database and merge everything in my domain (which gives my domain code that is related to my databasestructure)
make an adapter for every database and a productAdapter that calls the database adapters?
I hope the description, example and question make sense