Hi,
I am quite new to the architecture and I am desiging an application for my next .NET project. My proposed architecture design is as follows:
It is traditional three tier application which contains: DataLayer (LINQ + Partial Classes) BusinessLogicLayer (Entities + Validation Logic) (Optional) Service Layer (WCF) UI (Web site and Windows App)
Data Layer: The data layer will contains my DataContext classes (i.e. LINQ) and partial classes. These partial classes will have basic calculation logic (for e.g. Calc. VAT) and other database level validation logic.
Business Layer: This will have entiries similar to Data Layer but also will contain validation logic at UI level. For e.g. if user try to enter username which does not exists in the database it needs to tell user that user does not exists. (this is the place where I am struggling). The object will be Lazy Loaded whenever the properties will be called and not when the Object is created.
UI: This will be a traditional UI layer where Business entities will be invoked.
The reason why I am saperating the business layer from the DataLayer even when using LINQ is becouse if I wish to add more middle tier entities for e.g. WCF service then I want it to talk to Business Layer rather then Data. I belive decoupling helps when the application grows.(I think)
I would appriciate if someone can comment on above lines. My real problem is writing the business classes (obeviously). For e.g. In Lazy loading when I try to Load the Object and it there is no data in the database then I want my UI to show the user that the user does not exists (if I am searching for username). What are your recommondations with regards to this. Any input to this is much appriciated.
Many thanks, Preyash