Software Architecture

  • Software Architecture
  • Logic Software Architecture
  • UML Package Diagrams
  • Layers
  • Model-View Separation Principle

Reading instructions

Applying UML and Patterns: Applying UML and Patterns: Chapter 13 - Logical Architecture and UML Package Diagrams

Materials

Overview and the Model-View Separation Principle

Refactoring of the Dice Game into Model - View Architecture

Model-View Dice Game Source Code on GitHub

UML Packages

Domain Model UML Packages Quick Guide

Example Source Code

This is the same examples as in the recording, with the exception of using packages instead of inner classes.

Dependency from model to view

An example of a dependency from the model to the view. This is NOT what we want and it is a violation of the model-view separation principle

A view class ConsolePersonPrinter is used as an argument to Person.print this creates a dependency from Person to ConsolePersonPrinter.

view Responsibility in model

In this example the model class Person has some responsibility (functionality) that should rather be a part of some view class (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.

This is NOT what we want and it is a violation of the model-view separation principle

Implementation that Conforms to the model-view Separation Principle

Extracurricular

Videos

Introduction to Architectural Styles/Patterns - good to get an overview

Focus on the Layers Architectural Style/Pattern

Reading

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 method-wars was over and before UML was an accepted standard notation. You need of course not know this notation. Architectural Blueprints—The “4+1” View Model of Software Architecture

A book about architectural software patterns, like Layers, Model-View-Controller etc.
Pattern-Oriented Software Architecture Volume 1: A System of Patterns