Back to list
Views:   0
Replies:  0
Archived
,
Hi, you should take a look at my video series that does just that, except exposing a public api. http://www.mvccentral.net and look for the Golf Tracker Video series. I hope that helps. King Wilder info@mvccentral.net
Mar 29, 2010
Reply 1
I found the M in the MVC slightly confusing at first. The layers I have chosen are similar to yours, as I wanted the Service Layer on top of the Data and Business Layer.

My initial ideas (prompted by some examples from the books on MVC) made me place the model classes (domain/business) into the Models sub-folder of the ASP.NET MVC project. Of course, it is possible (as I have seen it was encouraged for the sake of simplicity) to ignore the Models folder and make a dependency on the layers on the lower levels, e.g., Service.
At the moment my Models folder is used for keeping objects that are closely related to the presentation layer, such as forms, UI flow-specific objects, and data transfer objects crafted for browser display purposes, etc.).
I did it because in my past projects when I was trying to decouple the service layer from the presentation layer, I found that services 'knew too much' about the flow, hence the need for something in between. I know that some people might frown upon yet another layer between the UI and the business logic layer (or services layer, in the matter of fact), but that is what I have found useful so far.
So in my case the Models folder serves a purpose of separating the UI-specific stuff (such as forms, their temporary data, states, flow logic, etc.) from the service layer. I would not keep Data Layer or reusable services in Models, in my case that would go outside ASP.NET MVC project to something like Integration layer that serves a purpose of mediating between clients (UI is just one of them) and the Service and Business Layers.
The increased number of layers makes the system more flexible and easier to evolve and maintain in the long term.

Dariusz Kaminski, Feb 16, 2010
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas