{"id":1879,"date":"2023-06-20T09:24:36","date_gmt":"2023-06-20T09:24:36","guid":{"rendered":"https:\/\/blog.amt.in\/?p=1879"},"modified":"2023-06-20T09:24:36","modified_gmt":"2023-06-20T09:24:36","slug":"insights-on-model-view-controller","status":"publish","type":"post","link":"https:\/\/blog.amt.in\/index.php\/2023\/06\/20\/insights-on-model-view-controller\/","title":{"rendered":"Insights on Model View Controller"},"content":{"rendered":"<p>Model View Controller\u00c2\u00a0is a software architectural pattern\u00c2\u00a0for implementing user interfaces\u00c2\u00a0on computers. It divides a given application into three interconnected parts in order to separate internal representations of information from the ways that information is presented to and accepted from the user. The MVC design pattern decouples these major components allowing for efficient code reuse\u00c2\u00a0and parallel development.<\/p>\n<p>Traditionally used for desktop graphical user interfaces \u00c2\u00a0(GUIs), this architecture has become popular for designing web applications\u00c2\u00a0and even mobile, desktop and other clients.Popular programming languages like Java, C#, Ruby, PHP\u00c2\u00a0and others have popular MVC frameworks that are currently being used in web application development straight out of the Box.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-104 aligncenter\" src=\"http:\/\/blog.amt.in\/wp-content\/uploads\/2017\/04\/200px-MVC-Process.svg_.png\" alt=\"\" width=\"318\" height=\"350\" \/><\/p>\n<p>As with other software architectures, MVC expresses the &#8220;core of the solution&#8221; to a problem while allowing it to be adapted for each system. Particular MVC architectures can vary significantly from the traditional description here.<\/p>\n<p>Components :<\/p>\n<ul>\n<li>The model\u00c2\u00a0is the central component of the pattern. It expresses the application&#8217;s behavior in terms of the problem domain, independent of the user interface. It directly manages the data, logic and rules of the application.<\/li>\n<li>A view\u00c2\u00a0can be any output representation of information, such as a chart or a diagram. Multiple views of the same information are possible, such as a bar chart for management and a tabular view for accountants.<\/li>\n<li>The third part, the controller, accepts input and converts it to commands for the model or view.<\/li>\n<\/ul>\n<p>Interactions :<\/p>\n<p>In addition to dividing the application into three kinds of components, the model\u00e2\u20ac\u201cview\u00e2\u20ac\u201ccontroller design defines the interactions between them.<\/p>\n<ul>\n<li>A Model\u00c2\u00a0stores data that is retrieved according to commands from the controller and displayed in the view.<\/li>\n<li>A View\u00c2\u00a0generates new output to the user based on changes in the model.<\/li>\n<li>A Controller\u00c2\u00a0can send commands to the model to update the model&#8217;s state (e.g., editing a document). It can also send commands to its associated view to change the view&#8217;s presentation of the model (e.g., scrolling through a document).<\/li>\n<\/ul>\n<p>Advantages :<\/p>\n<ul>\n<li>Simultaneous development &#8211; Multiple developers can work simultaneously on the model, controller and views.<\/li>\n<li>High cohesion &#8211; MVC enables logical grouping of related actions on a controller together. The views for a specific model are also grouped together.<\/li>\n<li>Low coupling &#8211; The very nature of the MVC framework is such that there is low coupling among models, views or controllers<\/li>\n<li>Ease of Modification\u00c2\u00a0&#8211; Because of the separation of responsibilities, future development or modification is easier<\/li>\n<li>Multiple views for a Model\u00c2\u00a0&#8211; Models can have multiple views<\/li>\n<\/ul>\n<p>Disadvantages :<\/p>\n<ul>\n<li>Code navigability &#8211; The framework navigation can be complex because it introduces new layers of abstraction and requires users to adapt to the decomposition criteria of MVC.<\/li>\n<li>Multi-artifact consistency &#8211; Decomposing a feature into three artifacts causes scattering. Thus, requiring developer(s) to maintain the consistency of multiple representations at once.<\/li>\n<li>Pronounced learning curve &#8211; Knowledge on multiple technologies becomes the norm. Developers using MVC need to be skilled in multiple technologies.<\/li>\n<\/ul>\n<p>The above mentioned are some of the key factors of Model View Controller.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Model View Controller\u00c2\u00a0is a software<\/p>\n","protected":false},"author":1,"featured_media":1881,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,973,7],"tags":[23,974,18],"class_list":["post-1879","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-model-view-controller","category-software-architecture","category-techtrends","tag-model-view-controller","tag-software-architecture","tag-technology"],"_links":{"self":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts\/1879","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/comments?post=1879"}],"version-history":[{"count":1,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts\/1879\/revisions"}],"predecessor-version":[{"id":1880,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts\/1879\/revisions\/1880"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/media\/1881"}],"wp:attachment":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/media?parent=1879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/categories?post=1879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/tags?post=1879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}