{
    "componentChunkName": "component---src-templates-docs-js",
    "path": "/old/02-theory/03_software_architecture",
    "result": {"data":{"site":{"siteMetadata":{"title":"Linnéuniversitetet","language":"sv","courseCode":"1DV607"}},"mdx":{"fields":{"id":"3454da51-9dd6-58f9-8e15-c090ad9d9283","title":"Software Architecture","slug":"/old/02-theory/03_software_architecture"},"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\": \"Software Architecture\",\n  \"metaTitle\": \"Software Architecture\",\n  \"metaDescription\": \"Logic Software Architecture, Package Diagrams, Model-View Separation\"\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  }, \"Software Architecture\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Logic Software Architecture\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"UML Package Diagrams\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Layers\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Model-View Separation Principle\")), mdx(\"h2\", null, \"Reading instructions\"), mdx(\"p\", null, \"Applying UML and Patterns: Applying UML and Patterns: Chapter 13 - Logical Architecture and UML Package Diagrams\"), mdx(\"h2\", null, \"Materials\"), mdx(\"h3\", null, \"Overview and the Model-View Separation Principle\"), mdx(Youtube, {\n    link: \"https://www.youtube.com/embed/edkQIUjpb2Y\",\n    mdxType: \"Youtube\"\n  }), mdx(\"h3\", null, \"Refactoring of the Dice Game into Model - View Architecture\"), mdx(Youtube, {\n    link: \"https://www.youtube.com/embed/Ltr9k83SHZM\",\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/ModelViewDiceGame/\"\n  }, \"Model-View Dice Game Source Code on GitHub\")), mdx(\"h3\", null, \"UML Packages\"), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://coursepress.lnu.se/courses/object-oriented-analysis-and-design/02-theory/design_package_diagram\"\n  }, \"Domain Model UML Packages Quick Guide\")), mdx(\"h3\", null, \"Example Source Code\"), mdx(\"p\", null, \"This is the same examples as in the recording, with the exception of using packages instead of inner classes.\"), mdx(\"h4\", null, \"Dependency from model to view\"), mdx(\"p\", null, \"An example of a dependency from the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"model\"), \" to the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"view\"), \". This is \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"NOT\"), \" what we want and it is a \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"violation\"), \" of the \", mdx(\"em\", {\n    parentName: \"p\"\n  }, \"model-view separation principle\")), mdx(\"p\", null, \"A view class \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"ConsolePersonPrinter\"), \" is used as an argument to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Person.print\"), \" this creates a dependency from \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Person\"), \" to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"ConsolePersonPrinter\"), \".\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-java\"\n  }, \"package model;\\nclass Person {\\n  String m_firstName, m_lastName;\\n  Person(String a_firstName, String a_lastName) {\\n      m_firstName = a_firstName;\\n      m_lastName = a_lastName;\\n  }\\n     \\n  void print(ConsolePersonPrinter a_cpp) {  \\n    a_cpp.printPerson(m_lastName + \\\", \\\" + m_firstName);\\n  }\\n}\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-java\"\n  }, \"package view;    \\n// This is a view class\\nclass ConsolePersonPrinter {\\n  void printPerson(String a_fullName) {\\n    System.out.println(\\\"The name is: \\\" + a_fullName);\\n  }\\n}\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-java\"\n  }, \"public class ModelViewSeparation {\\n  public static void main(String args[]) {\\n    Person p = new Person(\\\"John\\\", \\\"Smith\\\");\\n    ConsolePersonPrinter pPrinter = new ConsolePersonPrinter();\\n    \\n    p.print(pPrinter);\\n  }\\n}\\n\")), mdx(\"h4\", null, \"view Responsibility in model\"), mdx(\"p\", null, \"In this example the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"model\"), \" class \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Person\"), \" has some responsibility (functionality) that should rather be a part of some \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"view\"), \" class (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Person.getName()\"), \"). This is tricker to spot as it does not form a direct dependency. Common signs are custom formatting of strings (as in the example), use of user interface api:s (e.g. 'system.out.println'), or even helper methods that cater for a specific view funtionality only.\"), mdx(\"p\", null, \"This is \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"NOT\"), \" what we want and it is a \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"violation\"), \" of the \", mdx(\"em\", {\n    parentName: \"p\"\n  }, \"model-view separation principle\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-java\"\n  }, \"package model;\\n\\nclass Person {\\n  String m_firstName, m_lastName;\\n  Person(String a_firstName, String a_lastName) {\\n      m_firstName = a_firstName;\\n      m_lastName = a_lastName;\\n  }\\n  \\n  String getName() {\\n    return m_lastName + \\\", \\\" + m_firstName;\\n  }\\n}\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-java\"\n  }, \"package view;    \\n\\nclass ConsolePersonPrinter {\\n  void printPerson(Person a_person) {\\n    System.out.println(\\\"The name is: \\\" + a_person.getName());\\n  }\\n}\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-java\"\n  }, \"public class ModelViewSeparation {\\n  public static void main(String args[]) {\\n    Person p = new Person(\\\"John\\\", \\\"Smith\\\");\\n    ConsolePersonPrinter pPrinter = new ConsolePersonPrinter();\\n    \\n    pPrinter.printPerson(p);\\n  }\\n}\\n\")), mdx(\"h4\", null, \"Implementation that Conforms to the model-view Separation Principle\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-java\"\n  }, \"package model;\\n\\nclass Person {\\n  String m_firstName, m_lastName;\\n  Person(String a_firstName, String a_lastName) {\\n    m_firstName = a_firstName;\\n    m_lastName = a_lastName;\\n  }\\n    \\n  String getFirstName() {\\n    return m_firstName;\\n  }\\n  String getLastName() {\\n    return m_lastName;\\n  }\\n}\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-java\"\n  }, \"package view;\\n\\nclass ConsolePersonPrinter {\\n  void printPerson(Person a_person) {\\n    System.out.println(\\\"The name is: \\\" + a_person.getLastName() + \\\", \\\" + a_person.getLastName());\\n  }\\n}\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-java\"\n  }, \"public class ModelViewSeparation {\\n  public static void main(String args[]) {\\n    Person p = new Person(\\\"John\\\", \\\"Smith\\\");\\n    ConsolePersonPrinter pPrinter = new ConsolePersonPrinter();\\n      \\n    pPrinter.printPerson(p);     \\n  }\\n}\\n\")), mdx(\"h2\", null, \"Extracurricular\"), mdx(\"h3\", null, \"Videos\"), mdx(\"p\", null, \"Introduction to Architectural Styles/Patterns - good to get an overview\"), mdx(Youtube, {\n    link: \"https://www.youtube.com/embed/51KEpN0s6vY\",\n    mdxType: \"Youtube\"\n  }), mdx(\"p\", null, \"Focus on the Layers Architectural Style/Pattern\"), mdx(Youtube, {\n    link: \"https://www.youtube.com/embed/VdWavRcd1FE\",\n    mdxType: \"Youtube\"\n  }), mdx(\"h3\", null, \"Reading\"), mdx(\"p\", null, \"The influential software architecture paper describing different architectural views for a system. Note that in this paper an old noation (Booch-notation) is used, i.e. it was written before the \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://cs.smu.ca/~porter/csc/465/notes/uml.html\"\n  }, \"method-wars\"), \" was over and before UML was an accepted standard notation. You need of course not know this notation.\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"http://orion.lnu.se/pub/education/course/1DV607/ht19/F04/materials/4+1view-architecture.pdf\"\n  }, \"Architectural Blueprints\\u2014The \\u201C4+1\\u201D View Model of Software Architecture\")), mdx(\"p\", null, \"A book about architectural software patterns, like Layers, Model-View-Controller etc.\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://www.amazon.com/Pattern-Oriented-Software-Architecture-Volume-Patterns/dp/0471958697\"\n  }, \"Pattern-Oriented Software Architecture Volume 1: A System of Patterns\")));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#reading-instructions","title":"Reading instructions"},{"url":"#materials","title":"Materials","items":[{"url":"#overview-and-the-model-view-separation-principle","title":"Overview and the Model-View Separation Principle"},{"url":"#refactoring-of-the-dice-game-into-model---view-architecture","title":"Refactoring of the Dice Game into Model - View Architecture"},{"url":"#uml-packages","title":"UML Packages"},{"url":"#example-source-code","title":"Example Source Code","items":[{"url":"#dependency-from-model-to-view","title":"Dependency from model to view"},{"url":"#view-responsibility-in-model","title":"view Responsibility in model"},{"url":"#implementation-that-conforms-to-the-model-view-separation-principle","title":"Implementation that Conforms to the model-view Separation Principle"}]}]},{"url":"#extracurricular","title":"Extracurricular","items":[{"url":"#videos","title":"Videos"},{"url":"#reading","title":"Reading"}]}]},"parent":{"relativePath":"old/02-theory/03_software_architecture.md"},"frontmatter":{"metaTitle":"Software Architecture","metaDescription":"Logic Software Architecture, Package Diagrams, Model-View Separation","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":"3454da51-9dd6-58f9-8e15-c090ad9d9283"}},
    "staticQueryHashes": ["253607798","3706406642","710574383"]}