mvc presentation model best-practices
- by Andrew Florko
Hello, everybody
How do you usually convert business objects to presentation?
For example:
Business object Person { Id, FirstName, LastName, Patronymic ... } should be presented as "LastName F. P. " in html layout.
We use Presentation classes hierarchy to represent data ready for output from Business model.
Questions:
Will you keep presentation model completely separated from Business Model. For example, can strong-typed views (MVC ASP.NET) aggregate formatted business data as well as raw business objects (that leads toward
<%=Html.Encode(PersonHelper.ToShort(Model.Person))% html layout injections)
What architecture layer do you choose for conversion (mvc controllers that formats business data from business layer, for instance).
Thank you in advance