Docsity

Understanding Abstraction and UML Modeling in Object-Oriented Software Engineering, Schemes and Mind Maps of Software Engineering

Partial preview of the text

Download Understanding Abstraction and UML Modeling in Object-Oriented Software Engineering and more Schemes and Mind Maps Software Engineering in PDF only on Docsity!

Object Using UML, Patterns, and Java

- Oriented Software Engineering Chapter 2, Modeling with UML, Part 1 2 Odds and Ends

  • Reading for this Week:
  • Chapter 1 and 2, Bruegge&Dutoit, Object-Oriented Software Engineering
  • Lectures Slides:
  • Will be posted after each lecture.

3 Overview for the Lecture

  • Three ways to deal with complexity
    • Abstraction and Modeling
    • Decomposition
    • Hierarchy
  • Introduction into the UML notation
  • First pass on:
    • Use case diagrams
    • Class diagrams
    • Sequence diagrams
    • Statechart diagrams
    • Activity diagrams 4 What is the problem with this Drawing?

7 Abstraction

  • Abstraction allows us to ignore unessential

details

  • Two definitions for abstraction:
    • Abstraction is a thought process where ideas are distanced from objects - Abstraction as activity
    • Abstraction is the resulting idea of a thought process where an idea has been distanced from an object - Abstraction as entity
  • Ideas can be expressed by models 8 Model
  • A model is an abstraction

of a system

  • A system that no longer exists
  • An existing system
  • A future system to be built.

9 We use Models to describe Software Systems

  • Object model: What is the structure of the

system?

  • Functional model: What are the functions of the

system?

  • Dynamic model: How does the system react to

external events?

  • System Model: Object model + Functional model

+ Dynamic model

10 Other models used to describe Software System Development

  • Task Model
    • PERT Chart: What are the dependencies between tasks?
    • Schedule: How can this be done within the time limit?
    • Organization Chart: What are the roles in the project?
  • Issues Model
    • What are the open and closed issues?
      • What blocks me from continuing?
    • What constraints were imposed by the client?
    • What resolutions were made?
      • These lead to action items

13

Issue-Modeling

Issue: What is the Center of the Universe? Proposal1: The earth! Proposal2: The sun! Pro: Copernicus says so. Pro: Aristotle says so. Pro: Change will disturb the people. Con: Jupiter’s moons rotate around Jupiter, not around Earth. Resolution (1615): The church decides proposal 1 is right Resolution (1998): The church declares proposal 1 was wrong Proposal3: Neither! Pro: Galaxies are moving away From each other. 14

2. Technique to deal with Complexity:

Decomposition

• A technique used to master complexity

(“ divide and conquer ”)

• Two major types of decomposition

  • Functional decomposition
  • Object-oriented decomposition

• Functional decomposition

  • The system is decomposed into modules
  • Each module is a major function in the application domain
  • Modules can be decomposed into smaller modules.

15 Decomposition (cont’d)

  • Object-oriented decomposition
    • The system is decomposed into classes (“objects”)
    • Each class is a major entity in the application domain
    • Classes can be decomposed into smaller classes
  • Object-oriented vs. functional decomposition Which decomposition is the right one? 16 Functional Decomposition Top Level functions Level 1 functions Level 2 functions Machine instructions System Function Load R10 Add R1, R Read Input Transform Produce Output Transform Produce Read Input Output

19 Changing a Square into a Circle 20 Autoshape Functional Decomposition: Autoshape Draw Rectangle Draw Oval Draw Circle Change Draw Change Rectangle Change Oval Change Circle

21

Object-Oriented View

Autoshape

Draw()

Change()

22

What is This?

Neck Glove Coat Pocket Cave Ellbow

An Eskimo!

25

Class Identification

• Basic assumptions

  • We can find the classes for a new software system: Greenfield Engineering
  • We can identify the classes in an existing system : Reengineering
  • We can create a class-based interface to an existing system: Interface Engineering 26

Class Identification (cont’d)

• Why can we do this?

  • Philosophy, science, experimental evidence

• What are the limitations?

  • Depending on the purpose of the system, different objects might be found

• Crucial

Identify the purpose of a system

27

3. Hierarchy

• So far we got abstractions

  • This leads us to classes and objects
  • “Chunks”

• Another way to deal with complexity is to

provide relationships between these chunks

• One of the most important relationships is

hierarchy

• 2 special hierarchies

  • "Part-of" hierarchy
  • "Is-kind-of" hierarchy 28 I/O Devices CPU (^) Memory

Part-of Hierarchy (Aggregation)

Computer Cache (^) ALU (^) Program Counter

31 Models must be falsifiable

  • Karl Popper (“Objective Knowledge):
    • There is no absolute truth when trying to understand reality
    • One can only build theories, that are “true” until somebody finds a counter example
  • Falsification: The act of disproving a theory or hypothesis
  • The truth of a theory is never certain. We must use

phrases like:

  • “by our best judgement”, “using state-of-the-art knowledge”
  • In software engineering any model is a theory:
  • We build models and try to find counter examples by:
  • Requirements validation, user interface testing, review of the design, source code testing, system testing, etc.
  • Testing: The act of disproving a model. 32 Concepts and Phenomena
  • Phenomenon
  • An object in the world of a domain as you perceive it
  • Examples: This lecture at 9:35, my black watch
  • Concept
  • Describes the common properties of phenomena
  • Example: All lectures on software engineering
  • Example: All black watches
  • A Concept is a 3-tuple:
  • Name: The name distinguishes the concept from other concepts
  • Purpose: Properties that determine if a phenomenon is a member of a concept
  • Members: The set of phenomena which are part of the concept.

33

Definition Abstraction:

  • Classification of phenomena into concepts

Definition Modeling:

  • Development of abstractions to answer specific questions about a set of phenomena while ignoring irrelevant details. Name Members Watch Purpose A device that measures time. Concepts, Phenomena, Abstraction and Modeling 34 Abstract Data Types & Classes
  • Abstract data type
  • A type whose implementation is hidden from the rest of the system
  • Class:
  • An abstraction in the context of object-oriented languages
  • A class encapsulates state and behavior
  • Example: Watch Watch time date SetDate(d) CalculatorWatch EnterCalcMode() InputNumber(n) calculatorState Unlike abstract data types, subclasses can be defined in terms of other classes using inheritance

State

Behavior

Inheritance

Subclass

  • Example: CalculatorWatch

Superclass

37 Systems, Models and Views

  • A model is an abstraction describing a

system or a subsystem

System: Airplane

Models:

Flight simulator

Scale model

Views:

Blueprint of the airplane components

Electrical wiring diagram, Fuel system

Sound wave created by airplane

  • A view depicts selected aspects of a model
    • A notation is a set of graphical or textual

rules for depicting models and views:

  • formal notations, “napkin designs” 38 System View 1 Model 2 View 2 View 3 Model 1

Aircraft

Flightsimulator

Scale Model

Blueprints Electrical

Wiring

Fuel System

Views and models of a complex system usually overlap Systems, Models and Views (“Napkin” Notation)

**39 Systems, Models and Views System View

Model

Described by**^ Depicted^ by Airplane: System Scale Model:Model (^) Flight Simulator:Model Fuel System: View Electrical Wiring: View Blueprints: View (UML Notation)

Class Diagram

Object Diagram

40 Model-Driven Development

1. Build a platform-independent model of an

applications functionality and behavior

a) Describe model in modeling notation (UML) b) Convert model into platform-specific model

2. Generate executable from platform-specific

model

Advantages:

  • Code is generated from model (“mostly”)
  • Portability and interoperability
  • Model Driven Architecture effort:
  • http://www.omg.org/mda/
  • OMG: Object Management Group