Our new project just started and we have a problem related to its architecture.
We have a 3 layer arhitecture:
- WebUI
- Business
- DataRepositories
Each layer has reference only to the layer below it. The communication is done with what we call entities
and business objects
(BO) as follows:
DataRepositories <--entities--> Business <--BO--> WebUI
<--X-->
means communication using objects of type X.
So we have for example UserEntity
as entity and User
as BO. Another type is ticket which again has TicketEntity
and Ticket
.
Currently we have some distinct vertical slices through the layers having something like Accounts
for users in DataRepositories, Business and WebUI which are well defined and don't interact with the other slices like Tickets
.
Now the problem is that a ticket has an buyer which is an user and we don't know where in our architecture we should connect tickets and users. Should the business components interact between them or the data layer should map the user to the ticket?
To be more specific, we have a method for creating a ticket that is resides in Business and is called from WebUI. It takes as arguments the details of a ticket and "the user" which we don't know yet if it should be an object of type user or just the username/id. If we pass a user object that the presentation should get the user before calling CreateTicket. But, if the webui passes the id then the business layer should resolve the user object which would require adding a reference to the Users business component in Tickets (Business).