Skip to content

UML

What is UML

Unified Modeling Language

Semi-formal and graphical notation

Object-oriented paradigm

Doesn't define any process for software development

visual modeling language.

extensibility and specialization mechanisms to extend the core concepts

UML Diagrams

14 kinds of diagram

Structure Diagrams

Static structure of the system.

Class/Component/Deployment/Object/Package/Composite Structure/Profile

Class diagram: set of classes, interfaces and their relationships. can be seen as a graph: nodes are classes&interfaces, and links are relationships.

A class: name, attributes, operations

  • attributes: public, private, protected
  • operations: what the class can do

Relationships: association, generalization, dependency

Behavior Diagram

Dynamic behavior of the objects in a system.

Use Case/Activity/State Machine/Sequence/Communication/Interaction Overview/Timing

Design Patterns

What is Design Patterns

Pattern: A problem which occurs over and over again in environment, then describes the core of the solution to that problem.

A pattern has 4 essential elements: name, problem, solution, and consequences.

Describing Design Patterns

Pattern name and classification

Intent

Also known as

Motivation

Applicability

Structure

Participants

Collaborations, consequences, implementation

Catalog

Purpose

  • Creational patterns concern the process of object creation
  • Structural patterns deal with the composition of classes of objects
  • Behavioral patterns characterize how classes or objects interact and distribute responsibility

Scope: specifies whether the pattern applies primarily to classes or objects

  • Class patterns: relationship between classes and subclasses
  • Object patterns: object relationships

Creational Patterns

Creational patterns abstract the instantiation process

Singleton

Intent: ensure a class only has one instance and provide a global point of access to it.

How do we ensure that a class has only one instance?

  • A global variable (not best)
  • Make the class itself responsible for keeping track of its sole instance

Abstract Factory

Intent: Provide an interface for creating families of related or dependent objects without specifying their concrete classes