{
    "componentChunkName": "component---src-templates-docs-js",
    "path": "/old/02-theory/04_mvc",
    "result": {"data":{"site":{"siteMetadata":{"title":"Linnéuniversitetet","language":"sv","courseCode":"1DV607"}},"mdx":{"fields":{"id":"d7ba8793-b411-5032-96a3-8e2303785d46","title":"Model View Controller","slug":"/old/02-theory/04_mvc"},"body":"var _excluded = [\"components\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"Model View Controller\",\n  \"metaTitle\": \"Model View Controller\",\n  \"metaDescription\": \"Model View Controller Architecture Pattern, Observer, Code Refactoring\"\n};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar Youtube = makeShortcode(\"Youtube\");\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Model View Controller\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Refactoring to Model View Controller\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Observer\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Refactoring to Model View Controller with Observer \")), mdx(\"h2\", null, \"Reading instructions\"), mdx(\"p\", null, \"Applying UML and Patterns: Applying UML and Patterns:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"33 - Architectural Analysis\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"34 - Logical Architecture Refinement\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"35 - More Object Design with GoF Patterns (Observer)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"38 - Designing a Persistance Framework with Patterns\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"39 - Documenting Architecture UML & the N+1 View Model \")), mdx(\"h2\", null, \"Materials\"), mdx(\"h3\", null, \"Model View Controller\"), mdx(Youtube, {\n    link: \"https://www.youtube.com/embed/5kNc_f0J5AM\",\n    mdxType: \"Youtube\"\n  }), mdx(\"h3\", null, \"Refactoring of the Dice Game into a Model - View - Controller Architecture\"), mdx(Youtube, {\n    link: \"https://www.youtube.com/embed/Gn9w4NRQuVw\",\n    mdxType: \"Youtube\"\n  }), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://github.com/tobias-dv-lnu/1dv607/tree/master/2021/DiceGame/MVCDiceGame/\"\n  }, \"Model-View Dice Game Source Code on GitHub\")), mdx(\"h3\", null, \"Observer Pattern\"), mdx(Youtube, {\n    link: \"https://www.youtube.com/embed/uyqk_b0XUiA\",\n    mdxType: \"Youtube\"\n  }), mdx(\"h3\", null, \"Refactoring of the MVC Dice Game to using Observer\"), mdx(Youtube, {\n    link: \"https://www.youtube.com/embed/oYoExIYFgfs\",\n    mdxType: \"Youtube\"\n  }), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://github.com/tobias-dv-lnu/1dv607/tree/master/2021/DiceGame/ObserverMVCDiceGame/\"\n  }, \"Model-View Dice Game Source Code on GitHub\")), mdx(\"h2\", null, \"Extracurricular\"), mdx(\"h3\", null, \"Videos\"), mdx(\"h4\", null, \"Focus on the MVC Style/Pattern\"), mdx(Youtube, {\n    link: \"https://www.youtube.com/embed/I1PE1ge57i0\",\n    mdxType: \"Youtube\"\n  }), mdx(\"h4\", null, \"Observer Pattern\"), mdx(\"p\", null, \"I think the Observable - Observer is a bit confusing Publisher-Subscriber vocabulary tends to be easier to understand. In practice having an interface for the Publisher (IObservable) is not that practical as you get a generic \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"update\"), \"-method and this is too course grained (can be solved using generics - but again too complex to reuse ~5 lines of code). Prefer a specific Observer interface desigened to meet your needs, and just implement the publisher functionality.\"), mdx(Youtube, {\n    link: \"https://www.youtube.com/embed/_BpmfnqjgzQ\",\n    mdxType: \"Youtube\"\n  }), mdx(\"h3\", null, \"Reading\"), mdx(\"p\", null, \"There are several different flavors of GUI Architectures and flavors of the MVC pattern used throughout the years. You can read more about them here.\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://martinfowler.com/eaaDev/uiArchs.html\"\n  }, \"Martin Fowler on GUI Architectures\")), mdx(\"p\", null, \"A study of the main flavors of MV-patterns, MVC, MVP and MVVM (you should probably access the article throug \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"http://ub.lnu.se/db/ieee\"\n  }, \"UB's Link to IEEE Xplore\"), \")\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://ieeexplore.ieee.org/document/6827095\"\n  }, \"A Journey through the Land of Model-View-Design Patterns\")));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#reading-instructions","title":"Reading instructions"},{"url":"#materials","title":"Materials","items":[{"url":"#model-view-controller","title":"Model View Controller"},{"url":"#refactoring-of-the-dice-game-into-a-model---view---controller-architecture","title":"Refactoring of the Dice Game into a Model - View - Controller Architecture"},{"url":"#observer-pattern","title":"Observer Pattern"},{"url":"#refactoring-of-the-mvc-dice-game-to-using-observer","title":"Refactoring of the MVC Dice Game to using Observer"}]},{"url":"#extracurricular","title":"Extracurricular","items":[{"url":"#videos","title":"Videos","items":[{"url":"#focus-on-the-mvc-stylepattern","title":"Focus on the MVC Style/Pattern"},{"url":"#observer-pattern-1","title":"Observer Pattern"}]},{"url":"#reading","title":"Reading"}]}]},"parent":{"relativePath":"old/02-theory/04_mvc.md"},"frontmatter":{"metaTitle":"Model View Controller","metaDescription":"Model View Controller Architecture Pattern, Observer, Code Refactoring","fullWidth":null}},"allMdx":{"edges":[{"node":{"fields":{"slug":"/forelasningar-2026","title":"Föreläsningar 2026"}}},{"node":{"fields":{"slug":"/","title":"Objektorienterad analys och design med UML (1DV607)"}}},{"node":{"fields":{"slug":"/laborationer-2026","title":"Laborationer 2026"}}},{"node":{"fields":{"slug":"/old","title":"Old"}}},{"node":{"fields":{"slug":"/forelasningar-2026/00-tema-2-objektorienterad-analys-och-uml","title":"Tema 2 – Objektorienterad analys och modellering med UML"}}},{"node":{"fields":{"slug":"/forelasningar-2026/00-tema-3-objektorienterad-design-med-uml","title":"Tema 3 – Objektorienterad design med UML"}}},{"node":{"fields":{"slug":"/forelasningar-2026/01-kursintroduktion-och-domanmodellering","title":"1. Kursintroduktion och domänmodellering"}}},{"node":{"fields":{"slug":"/forelasningar-2026/02-objektorienterad-analys-och-modellering","title":"2. Objektorienterad analys och modellering"}}},{"node":{"fields":{"slug":"/forelasningar-2026/03-uml-modellering","title":"3. Fortsatt modellering med UML"}}},{"node":{"fields":{"slug":"/forelasningar-2026/04-grasp","title":"4. GRASP"}}},{"node":{"fields":{"slug":"/forelasningar-2026/00-tema-1-grunderna","title":"Tema 1 – Grunderna i objektorienterad analys och design"}}},{"node":{"fields":{"slug":"/laborationer-2026/01-laboration-1","title":"Laboration 1 – Domänmodellering"}}},{"node":{"fields":{"slug":"/old/001-introduction","title":"Course Introduction"}}},{"node":{"fields":{"slug":"/old/01-information","title":"Course Information"}}},{"node":{"fields":{"slug":"/laborationer-2026/02-laboration-2","title":"Laboration 2"}}},{"node":{"fields":{"slug":"/old/02-theory","title":"Theory"}}},{"node":{"fields":{"slug":"/old/03-assignments","title":"Assignments"}}},{"node":{"fields":{"slug":"/old/01-information/01-welcome","title":"Welcome to the Course"}}},{"node":{"fields":{"slug":"/old/01-information/registration","title":"Course Registration"}}},{"node":{"fields":{"slug":"/old/02-theory/01-intro_to_ooad","title":"Introduction to Object Oriented Analysis and Design"}}},{"node":{"fields":{"slug":"/old/01-information/grading","title":"Course Grading"}}},{"node":{"fields":{"slug":"/old/02-theory/03_software_architecture","title":"Software Architecture"}}},{"node":{"fields":{"slug":"/old/02-theory/04_mvc","title":"Model View Controller"}}},{"node":{"fields":{"slug":"/old/02-theory/02-domain_modeling","title":"Domain Modeling"}}},{"node":{"fields":{"slug":"/old/02-theory/06_grasp1","title":"GRASP 1"}}},{"node":{"fields":{"slug":"/old/02-theory/05_layers_components","title":"Layers & Components"}}},{"node":{"fields":{"slug":"/old/02-theory/07_grasp2","title":"GRASP 2"}}},{"node":{"fields":{"slug":"/old/02-theory/09_gof1","title":"GoF 1"}}},{"node":{"fields":{"slug":"/old/02-theory/10_gof2","title":"GoF 2"}}},{"node":{"fields":{"slug":"/old/02-theory/11_solid","title":"SOLID"}}},{"node":{"fields":{"slug":"/old/02-theory/08_grasp3","title":"GRASP 3"}}},{"node":{"fields":{"slug":"/old/02-theory/design_class_diagram","title":"UML Design Class Notation"}}},{"node":{"fields":{"slug":"/old/02-theory/design_class_relations","title":"UML Design Class Relations"}}},{"node":{"fields":{"slug":"/old/02-theory/design_object_diagram","title":"UML Object Diagram Notation"}}},{"node":{"fields":{"slug":"/old/02-theory/99-exercises","title":"Exercises"}}},{"node":{"fields":{"slug":"/old/02-theory/design_package_diagram","title":"UML Package Notation"}}},{"node":{"fields":{"slug":"/old/02-theory/domain_class_diagram","title":"UML Domain Model"}}},{"node":{"fields":{"slug":"/old/02-theory/reading-instructions","title":"Reading Instructions"}}},{"node":{"fields":{"slug":"/old/03-assignments/01-assignment_1","title":"Assignment 1"}}},{"node":{"fields":{"slug":"/old/03-assignments/02-assignment_2","title":"Assignment 2"}}},{"node":{"fields":{"slug":"/old/03-assignments/03-assignment_3","title":"Assignment 3"}}},{"node":{"fields":{"slug":"/old/03-assignments/04-yahtzee","title":"Yahtzee Assignment"}}},{"node":{"fields":{"slug":"/old/old_template/ovningsuppgifter-del-a","title":"Övningsuppgifter del A"}}},{"node":{"fields":{"slug":"/old/old_template/ovningsuppgifter-del-b","title":"Övningsuppgifter del B"}}},{"node":{"fields":{"slug":"/old/03-assignments/01-assignment_1/lending-system-problem-description","title":"Stuff Lending System Problem Description"}}},{"node":{"fields":{"slug":"/old/03-assignments/01-assignment_1/yacht-club-problem-description","title":"Yacht Club Problem Description"}}},{"node":{"fields":{"slug":"/old/old_template/videologgar","title":"Vlog"}}},{"node":{"fields":{"slug":"/old/old_template/codeblock/1-index","title":"Sub Page"}}},{"node":{"fields":{"slug":"/old/03-assignments/02-assignment_2/test_specification","title":"Test Specification"}}},{"node":{"fields":{"slug":"/old/old_template/codeblock","title":"Syntax Highlighting"}}},{"node":{"fields":{"slug":"/old/old_template/ovningsuppgifter-del-a/01-hello-world","title":"Hello world"}}},{"node":{"fields":{"slug":"/old/old_template/ovningsuppgifter-del-a/02-simple-addition","title":"Enkel addition"}}}]}},"pageContext":{"id":"d7ba8793-b411-5032-96a3-8e2303785d46"}},
    "staticQueryHashes": ["253607798","3706406642","710574383"]}