I am trying to create an example project Web API to see how "clean" I can remake the Delphi(Pascal) API we are developing on my job.
I have created a solution which as of now contains 3 different projects.
If I want to keep my business logic as seperate as possible where should I put following logic?
VacationAccoutetc.which would need to be created and maintained throughout his employment.
I Could use a
PersonDataController of some sort, but this would leave me with a
DataController which would need to be tightly coupled to objects
VacationAccount - furthermore this would mean that my
PersonRepository would also be
dependant on my
EmploymentRepository and possibly others.
Another approach (and possibly the most straightforward) is to keep business logic in the DataObject
Person so I could call
Person.Hire(); Which makes the most sense to me, but the issue remains that my
Hire function needs to be dependant on the
employment object and that my
PersonRepository would be dependant on my
Where would I put the business function
Hire(Person) in a way that avoids tightly coupling my data objects and repositories?