{"id":87,"date":"2017-03-20T12:14:12","date_gmt":"2017-03-20T12:14:12","guid":{"rendered":"http:\/\/generic.wordpress.soton.ac.uk\/gapapp\/?p=87"},"modified":"2017-03-20T12:15:10","modified_gmt":"2017-03-20T12:15:10","slug":"model-view-controller-framework","status":"publish","type":"post","link":"https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/2017\/03\/20\/model-view-controller-framework\/","title":{"rendered":"Model-View-Controller framework"},"content":{"rendered":"<p>When choosing a system architecture design framework for our app, we picked the Model-View-Controller model and we will explain the reasons behind that.<\/p>\n<p>Historically MVC was the earliest example of Graphical User Interface design approaches since its introduction by\u00a0<a title=\"Trygve Reenskaug\" href=\"https:\/\/en.wikipedia.org\/wiki\/Trygve_Reenskaug\">Trygve Reenskaug<\/a>\u00a0 MVC into <a title=\"Smalltalk\" href=\"https:\/\/en.wikipedia.org\/wiki\/Smalltalk\">Smalltalk<\/a>. It solved the problem of user control over large data sets. The idea was to create an illusion for the user that they control the data domain.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-89 aligncenter\" src=\"http:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-content\/uploads\/sites\/193\/2017\/03\/Screen-Shot-2017-03-20-at-10.53.53-300x150.png\" alt=\"Screen Shot 2017-03-20 at 10.53.53\" width=\"388\" height=\"194\" srcset=\"https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-content\/uploads\/sites\/193\/2017\/03\/Screen-Shot-2017-03-20-at-10.53.53-300x150.png 300w, https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-content\/uploads\/sites\/193\/2017\/03\/Screen-Shot-2017-03-20-at-10.53.53.png 377w\" sizes=\"auto, (max-width: 388px) 100vw, 388px\" \/><\/p>\n<p style=\"text-align: right\"><a href=\"http:\/\/heim.ifi.uio.no\/~trygver\/themes\/mvc\/mvc-index.html\">Figure 1. The original concept behind MVC<\/a><\/p>\n<p style=\"text-align: left\">\u00a0Although originally developed for desktop software, MVC became largely popular for\u00a0web\/mobile applications architecture design.<\/p>\n<p style=\"text-align: left\"><strong>What does MVC mean?<\/strong><\/p>\n<p style=\"text-align: left\"><em>Model <\/em>is the\u00a0knowledge domain.<\/p>\n<p style=\"text-align: left\"><em>View <\/em>is the visual representation of the model.<\/p>\n<p style=\"text-align: left\"><em>Controller\u00a0<\/em>is the link between a\u00a0user and the system. Provides means for user input and produces\u00a0means for user output.<\/p>\n<p style=\"text-align: left\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-90 aligncenter\" src=\"http:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-content\/uploads\/sites\/193\/2017\/03\/MVC-basic-300x180.png\" alt=\"MVC-basic\" width=\"300\" height=\"180\" srcset=\"https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-content\/uploads\/sites\/193\/2017\/03\/MVC-basic-300x180.png 300w, https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-content\/uploads\/sites\/193\/2017\/03\/MVC-basic-367x220.png 367w, https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-content\/uploads\/sites\/193\/2017\/03\/MVC-basic.png 600w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p style=\"text-align: right\">Figure 2. Basic MVC\u00a0interaction diagram<\/p>\n<p style=\"text-align: left\">This structure splits the architecture of an app into three interconnected parts, so that the internal representation of information and user representation of information can be separated.<\/p>\n<p style=\"text-align: left\"><a href=\"https:\/\/blog.codinghorror.com\/understanding-model-view-controller\/\">For example<\/a>, we can look at the Web from the MVC point of view. The model is\u00a0HTML that communicates the knowledge to a user. The view is a\u00a0CSS that makes the information readable and nicely represented. The controller is a\u00a0browser that renders the HTML and CSS and produces an output and translates the user\u00a0input into script code. From the evident statistics of the Web usage, we can conclude the MVC model works fine.<\/p>\n<p style=\"text-align: left\"><strong>The\u00a0pros of MVC<\/strong><\/p>\n<ul>\n<li style=\"text-align: left\"><em>Simultaneous development<\/em>. Because the components are separated, different teams can work with different components of an app without blocking the work of others. For example, development can be divided into back-end and front-end, whereas the latter do not need the\u00a0server-side data structure to design the user interface and vice versa.<\/li>\n<li style=\"text-align: left\"><em>Reuse.\u00a0<\/em>Again, because of independent components, the components code can be easily reused in other applications.<\/li>\n<li style=\"text-align: left\"><em>Multiple views of a\u00a0model. <\/em>New features and business entities can easily fit into an\u00a0existing pattern.<\/li>\n<\/ul>\n<p style=\"text-align: left\"><strong>The cons of MVC<\/strong><\/p>\n<ul>\n<li style=\"text-align: left\"><em>Learning different techniques<\/em>. Developers have to be skilled in different technologies and multiple coding techniques.<\/li>\n<li style=\"text-align: left\"><em>Complex design pattern<\/em>. Although the main concept is quite straight-forward, the structure of each component can get very bulky and complex.<\/li>\n<\/ul>\n<p>We conclude that the MVC design pattern is aligned with our design and development core.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-88 aligncenter\" src=\"http:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-content\/uploads\/sites\/193\/2017\/03\/Screen-Shot-2017-03-20-at-10.47.26-300x191.png\" alt=\"Screen Shot 2017-03-20 at 10.47.26\" width=\"481\" height=\"306\" srcset=\"https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-content\/uploads\/sites\/193\/2017\/03\/Screen-Shot-2017-03-20-at-10.47.26-300x191.png 300w, https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-content\/uploads\/sites\/193\/2017\/03\/Screen-Shot-2017-03-20-at-10.47.26-345x220.png 345w, https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-content\/uploads\/sites\/193\/2017\/03\/Screen-Shot-2017-03-20-at-10.47.26.png 715w\" sizes=\"auto, (max-width: 481px) 100vw, 481px\" \/><\/p>\n<p style=\"text-align: right\">Figure 3. The NaviGap MVC design pattern<\/p>\n<p style=\"text-align: left\">We have chosen to use <a href=\"https:\/\/www.djangoproject.com\/\">Django<\/a>\u00a0python web framework because it is open-source, free and is targeted at highly-loaded database-driven applications.\u00a0Django web framework is viewed as an <a class=\"mw-redirect\" title=\"Model-view-controller\" href=\"https:\/\/en.wikipedia.org\/wiki\/Model-view-controller\">MVC<\/a> architecture. The Model is an object-relational mapper assisting connection between data python classes and a relational database. The View is a system processing HTTP requests and the Controller is the\u00a0URL dispatcher. Also, we will be using<a href=\"https:\/\/angularjs.org\/\"> AngularJs<\/a> to extend the capabilities of declaring dynamic views in our mobile app.<\/p>\n<p style=\"text-align: left\">In short, we have a layout of planned works to be done.<\/p>\n<h3>Process plan:<\/h3>\n<ol>\n<li>Building RestServices using Django &amp; DjangoRestFramework<\/li>\n<li>Building MobileApp<\/li>\n<li>Integration of AngularJS and Webservices<\/li>\n<li>Deployment<\/li>\n<\/ol>\n<p>Using open-source frameworks and environments not only reduces our costs of production, but provides opportunities for collaboration, and expertise from the developers&#8217; community.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When choosing a system architecture design framework for our app, we picked the Model-View-Controller model and we will explain the reasons behind that. Historically MVC was the earliest example of Graphical User Interface design approaches since its introduction by\u00a0Trygve Reenskaug\u00a0 MVC into Smalltalk. It solved the problem of user control over large data sets. The [&hellip;]<\/p>\n","protected":false},"author":2298,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12,32],"tags":[34,28,35,33],"class_list":["post-87","post","type-post","status-publish","format-standard","hentry","category-app","category-development","tag-angularjs","tag-development","tag-django","tag-mvc"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-json\/wp\/v2\/posts\/87","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-json\/wp\/v2\/users\/2298"}],"replies":[{"embeddable":true,"href":"https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-json\/wp\/v2\/comments?post=87"}],"version-history":[{"count":2,"href":"https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-json\/wp\/v2\/posts\/87\/revisions"}],"predecessor-version":[{"id":97,"href":"https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-json\/wp\/v2\/posts\/87\/revisions\/97"}],"wp:attachment":[{"href":"https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-json\/wp\/v2\/media?parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-json\/wp\/v2\/categories?post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/generic.wordpress.soton.ac.uk\/gapapp\/wp-json\/wp\/v2\/tags?post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}