Last post May 12, 2015 03:18 AM by Mikesdotnetting
May 11, 2015 06:18 AM|rpk2006|LINK
I am building an MVC 5 application. I am using ADO.NET and not Entity Framework. I have a layered architecture as below:
Model will only contain ViewModel which are closely linked to Controller. But where should POCO reside?
I have seen some samples of Repository Layer but it is not clear why Interfaces are used.
May 11, 2015 08:12 AM|Mikesdotnetting|LINK
Models don't form part of the UI layer. They are seaprate. I would put POCOs in the Model layer.
May 12, 2015 01:00 AM|rpk2006|LINK
But the main project contains Model, View and Controller.
You mean I should create another Model layer instead of using the Model folder which resides in the main project?
Can you please let me know which all layers you will put and what will be the project and class libraries?
May 12, 2015 03:18 AM|Mikesdotnetting|LINK
You are confusing layers and projects. Layers are logical groupings of related code. As such, they are conceptual, not physical. Projects are units of deployment. One of the main reasons for creating multiple projects is for code reuse across other applications.
If you need to serve multiple UIs (web, WPF etc) then you should create the UI as a separate project. What I would then do is rename the Models folder in the MVC UI project to ViewModels and only keep view model classes there. I would create a separate project
as a class library for domain entities or POCO classes that will be used across different applications.