jeudi 29 janvier 2015

Singleton LoggedUser class on Infrastructure Layer?

I'am developing an multi-layered application that suport many application UI consumers, like WinForms and MVC.


First, i'am developing a UI Windows forms to consume that.


I have the falowing project structure:



Application.DataAccess - IUserRepository....
Application.Busines - IUserService, ICustomerService...
Application.Infrastructure - Logging, Exception handling... (Cross-cutting.)
Application.Domain - Entities, User, Customer...
Application.WindowsForms - UI


Most of my busines methods need User that has requesting like AddNewCustomer(Customer c, User requestingUser)...


I always have to pass Logged User through my User Interface application to Busines layer or should create a Singleton class on Cross-cutting layer and use that on all of my application?


Aucun commentaire:

Enregistrer un commentaire