mvc presentation model best-practices

Posted by Andrew Florko on Stack Overflow See other posts from Stack Overflow or by Andrew Florko
Published on 2010-05-07T14:36:12Z Indexed on 2010/05/07 14:38 UTC
Read the original article Hit count: 533

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:

  1. 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)

  2. What architecture layer do you choose for conversion (mvc controllers that formats business data from business layer, for instance).

Thank you in advance

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mvc