Chapter 1. Root software elements

Table of Contents

Type
Object
Factory
Service
Summary

Type

A type defines the features of objects.

examples:

  • type customer: has an identifier, name, address, ...

  • type date: is composed of a day, month and year; can be printed or converted_to_XML

  • type coffee_machine: can make_coffee

There are 3 kinds of features:

  • attributes

  • commands

    • they can be executed in order to perform a task

    • examples: print_sales_history, make_coffee, export_to_XML, ...

    • for more information: see the section called “Command”

  • events

    • they arise due to specific conditions and are used to inform other software elements about what happened

    • examples: coffee_ready, mouse_clicked, connection_interrupted, ...

    • for more information: see the section called “Event”

Every type can have 0, 1 or more attributes, commands and events.

examples:

  • type date

    • attributes

      • year
      • month
      • day

    • commands

      • convert_to_XML

  • type coffee_machine

    • attributes

      • brand
      • color
      • price

    • commands

      • power_on
      • power_off
      • make_coffee
      • make_capucino
      • make_espresso

    • events

      • coffee_ready
      • water_tank_empty
      • failure

For more information about types: see the section called “Type”