In UML class diagram in MVC software design pattern there are model view controller classes and in ASP.NET MVC all views are cshtml not classes my question is how to put views in class diagram ?

1 Answer 1


Behind the curtain, the cshtml gets transformed into a class. You could simply add a class node with a <<view>> stereotype and the relevant properties.

Question is, what would be the benefit of adding the view to the diagram? In MVC the views are supposed to be dumb, they should only present data and should be oblivious of any behavior that drives the data. Normally they have a backing view model that encapsulates the data and (any) behavior. You should decouple the view model from the rest of the business logic and add that to the diagram instead of the view.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.