|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "metadata": {}, |
| 6 | + "source": [ |
| 7 | + "## Unified Modeling Language (UML)\n", |
| 8 | + "\n", |
| 9 | + "- used while explaining classes and their relationships\n", |
| 10 | + "- can help us examine a problem from various angles\n", |
| 11 | + " - understand and describe the problem diagrammatically\n", |
| 12 | + "- can be used as the document for the design phase\n", |
| 13 | + " - can be cumbersome to update UML if you use *agile/iterative* software engineering model instead of *waterfall/cascading* model\n", |
| 14 | + "- provides a common language to talk among developers, managers, designers, clients, etc.\n", |
| 15 | + " - fairly intuitive to visually understand the big picture of the project\n", |
| 16 | + "- this resource provides a good overview of UML - [https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-uml/](https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-uml/)\n", |
| 17 | + "- this resource provides a tool to generate UML diagrams: https://plantuml.com/ automatically\n", |
| 18 | + " - textbook authors used **plantuml** to generate all the UML diagrams\n", |
| 19 | + "\n", |
| 20 | + "## 4+1 Views\n", |
| 21 | + "\n", |
| 22 | + "- we can create a collection of diagrams using UML to help depict and summarize the software we're going to build\n", |
| 23 | + "- provides high-level views of the complete architecture of a software product\n", |
| 24 | + "- the views are used to describe the system from the viewpoint of different stakeholders, such as end-users, developers, system engineers, and project managers, project owners, etc.\n", |
| 25 | + "\n", |
| 26 | + "### Logical View\n", |
| 27 | + "\n", |
| 28 | + "- a logical view of the data entities, their static attributes, and their relationships\n", |
| 29 | + "- the heart of object-oriented design\n", |
| 30 | + "- concerned with the functionalities the software provides to the end users\n", |
| 31 | + "\n", |
| 32 | + "### Process View\n", |
| 33 | + "\n", |
| 34 | + "- describes how the data is processed or essentially describes the runtime behavior of the system \n", |
| 35 | + "- can be of a variety of forms: state models, activity diagrams, and sequence diagrams\n", |
| 36 | + "- addresses concurrency, distribution, integrator, performance, and scalability, etc.\n", |
| 37 | + "\n", |
| 38 | + "### Development View\n", |
| 39 | + "\n", |
| 40 | + "- shows relationships among software components\n", |
| 41 | + "- can be used to show how class definitions are gathered into modules and packages\n", |
| 42 | + "- aka **implementation view** illustrates the programmer's perspective and is concerned with software management\n", |
| 43 | + "\n", |
| 44 | + "### Physical View\n", |
| 45 | + "\n", |
| 46 | + "- view of the application to be integrated and deployed\n", |
| 47 | + "- if the application follows a well-known common design pattern, a sophisticated physical view diagram isn't necessary\n", |
| 48 | + "- otherwise, a diagram is essential to show how a collection of components is integrated and deployed\n", |
| 49 | + "- depicts the software from the system engineer's point of view\n", |
| 50 | + "\n", |
| 51 | + "### Context View\n", |
| 52 | + "\n", |
| 53 | + "- provides a unifying context for the previous four views\n", |
| 54 | + "- often describes the actors that use (or interact) with the system to be built\n", |
| 55 | + "- can involve human actors as well as automated interfaces outside the system\n", |
| 56 | + "- the system must respond to these external actors\n", |
| 57 | + "- can also be called **scenarios or use case view** or system design view (a big picture view)\n", |
| 58 | + "\n", |
| 59 | + "\n", |
| 60 | + "## Example UML diagrams show OOD for Fruit Inventory\n", |
| 61 | + "\n", |
| 62 | + "- rectangular box represents a class\n", |
| 63 | + "- line shows the *association* between two classes\n", |
| 64 | + "- the following is a better UML diagram\n", |
| 65 | + "- shows the proper relationships\n", |
| 66 | + " \n", |
| 67 | + "\n", |
| 68 | + "\n", |
| 69 | + "- use plantuml - https://plantuml.com/\n", |
| 70 | + "- must create description file\n", |
| 71 | + " - see guide for syntax - https://plantuml.com/guide\n", |
| 72 | + " - shows how to create plantuml description files\n", |
| 73 | + "- can use plantuml from local Terminal to generate diagrams or VS Code extension\n", |
| 74 | + "\n", |
| 75 | + "### VS Code Extension\n", |
| 76 | + "\n", |
| 77 | + "- install VS Code extension by jebbs - https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml\n", |
| 78 | + "- allows to preview UML diagrams using local or remote render\n", |
| 79 | + "- install recommended libraries following the extension documentation\n", |
| 80 | + "- configure the extension\n", |
| 81 | + " - search for `PlantUML` in Extensions and click on `Settings` menu\n", |
| 82 | + " - click `Workspace` tab set PlantUML: Render to `Remote`\n", |
| 83 | + " - click `Workspace` tab set PlantUML: Output Format to `png`\n", |
| 84 | + " - enter server URL: `http://www.plantuml.com/plantuml/png/` in PlantUML: Server\n", |
| 85 | + "- to render UML diagrams:\n", |
| 86 | + "- on VS Code, create .plantuml file and enter `option+D` (Mac) or `alt+D` (Win)\n", |
| 87 | + "- to save image file:\n", |
| 88 | + " - enter command+P and > PlantUML: Export Current Diagram and pick image type\n", |
| 89 | + " \n", |
| 90 | + "### Local System and Makefile\n", |
| 91 | + "\n", |
| 92 | + "- to render UML images locally, must install **Java** runtime and **Graphviz** library\n", |
| 93 | + "- follow the instruction for your platform here - https://plantuml.com/starting\n", |
| 94 | + "- on a local Terminal type the following command\n", |
| 95 | + "- you must also download plantuml.jar file\n", |
| 96 | + "\n", |
| 97 | + "```bash\n", |
| 98 | + "java -jar <path_to_plantuml.jar> <folder/file.plantuml>\n", |
| 99 | + "```\n", |
| 100 | + "- it automatically creates <file_name>.png in the same folder where <file_name>.plantuml file is\n", |
| 101 | + "\n", |
| 102 | + "- see Makefile for demo: `demo-assignments/A1-OOP/Makefile`\n", |
| 103 | + "- to render UML diagrams run the following commands from the Terminal\n", |
| 104 | + "\n", |
| 105 | + "```bash\n", |
| 106 | + "cd demo-assignments/A1-OOP/Makefile\n", |
| 107 | + "make create-uml\n", |
| 108 | + "```" |
| 109 | + ] |
| 110 | + }, |
| 111 | + { |
| 112 | + "cell_type": "markdown", |
| 113 | + "metadata": {}, |
| 114 | + "source": [] |
| 115 | + } |
| 116 | + ], |
| 117 | + "metadata": { |
| 118 | + "language_info": { |
| 119 | + "name": "python" |
| 120 | + } |
| 121 | + }, |
| 122 | + "nbformat": 4, |
| 123 | + "nbformat_minor": 2 |
| 124 | +} |
0 commit comments