I have an ASP.NET MVC site and I am trying to figure out separation of controller and model (repository) and HTML helper functionality.
The goal is to query a database table of photo albums information and display it grouped by year.
The steps are:
- Query database and return datatable of the database information.
- Convert Datatable to AlbumCollection (List)
- Bucket albums by year into ALbumDictionary
- Render each year in a seperate HTML table.
Given this request, I could see: 1,2,3 all in the model and the controller simply binds the View to the AlbumDictionary model or 1,2 in the model and bind to the AlbumCollection and 3 in a HTML ViewHelper or 1,2 in the model 3 in the controller and bind to the Albumdictionary
Thoughts?
Doing every conversion in the first loop would have the best performance but I am not sure it is the best separation of concerns.
In particular to the above question, generic feedback would be interesting: when does separation of concerns overrule performance or vise versa?