Lets say I am writing a blog web application using MVC pattern. Typical layout for the main page of the blog application is - some kind of a post index in the main part, and aside there are some addition parts, like timeline, tag navigation panel, subscribing panel, etc. Those controls also appear on a single post view, and may appear on other views I have.My question is - how should I handle those panels aside in my views and controllers. I see three approaches here:Create a big viewmodel class that contains all the informationrequired for rendering the view s (either index or single post).That case I could make these aside panels a partial views, andcalling them from the view being rendered passing part of that bigviewmodel. The drawback is - I will have the code filling viewmodelspread amongst various controller method, meaning code isduplicated. Which is quite bad.Create another layer of view rendering. Say, the topmost layer ofrendering recives a alreay rendered parts of html, or functionswhich when called outputs an html. The layer under this  combiningpartials layer would give just partial views for each panel I want,include main content. The drawback here - memory usage. Most modern frameworks renders htmls directly to output stream, but in this approach partial views would be rendered into string objects first - which leads to memory overhead.Use something like RenderAction from asp.net mvc, which calls acontroller method from a view. I think this is a worst solution of 3given, because it drops an MVC approach.The question is not tied to any specific framework, I want to understand the general way of doing things like that.UPDATEAfter an answer given, I've found out that post is not clear. So reasonable update here:Under viewmodel term I understand an object that contains all the data required to render a particular view.All of three approaches involve building partial views with their own viewmodel. For example (using C# syntax):class SinglePostViewModel {  string Text {get;set;}  string Title {get;set;}  string Slug {get;set;}  DateTime PublishedDate {get;set;}  ...}class TagNavigationPanelViewModel {  string TagText {get;set;}  int PostsCount {get;set;}}class CalendarNavigationPanelViewModel {  DateTime YearAndMonth {get;set;}  int PostsCount {get;set;} }My question is - how to nicely combine those partial views together.
How to handle complex views (consisting of several parts) in MVC web application
design;design patterns;architecture;web applications;ui