Analysis and Design A view - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Analysis and Design A view

Description:

For a small project: Use state of art. But it is very useful to read about at least ... Train, car, bicycle are VEHICLES. The other way around is called Specialisation ... – PowerPoint PPT presentation

Number of Views:39
Avg rating:3.0/5.0
Slides: 15
Provided by: Boute
Category:
Tags: analysis | art | bicycle | design | view

less

Transcript and Presenter's Notes

Title: Analysis and Design A view


1
Analysis and Design(A view)
  • Analysis and Design are just the way of thinking
  • about the system (abstraction) that one has in
    mind
  • The goal is
  • Shift the development effort from implementation
    into analysis
  • Spend more effort in modelling
  • Emphasis on data structure before function
  • Hint Always ask what data can do for you and
  • never ask what you can do for or
    with the
  • data.
  • The development process is rather iterative than
  • sequential

2
The Method
  • 1) Use/Find an Object Modelling technique
  • For a small project Use state of
    art
  • But it is very useful to read
    about at least
  • one of the proposed methods in the
  • literature.
  • 2) Analysis The problem has to be modelled in
  • three views
  • 1) Object Model ( The static view)
  • 2) Dynamic Model ( object interactions,
    states)
  • 3) Functional Model ( Data
    transformation)
  • 3) Design Decide how the model should be
  • represented in software
  • 1) System design
  • 2) Object design
  • 4) Implementation
  • 1) realise the design.
  • A good modelled problem would not require a full
  • re iteration step once we are at the
    implementation step

3
Analysis
  • Remind that this is the WHAT? Phase.

Knowledge Experience Literature Interviews
My idea Market Needs End user
Request Generated
Construct Models
Problem Stated
Object Model
Dynamic Model
Functional Model
Coherent Composition of the three
Model Integration
4
Analyse
  • Problem Formulation
  • - Describe informally the problem to be
    solved
  • - State what is to be done and what is
    needed
  • - indicate mandatory and optional
    features
  • Analysis
  • - First understanding
  • - Model the problem in the context of
  • application domain (The user side)
  • - The initial input is the problem
    statement
  • (problem stated)
  • The analysis output is a formal model that
  • captures the three essential aspects of
    the
  • system Object Model, Dynamic Model and
  • Functional Model .

5
Object Model
  • The object model is the framework of the two
    other
  • models the dynamic and the functional
  • Describing the static structure of the system
  • consists of instance and class diagrams.
  • Hint Start enumerating what you think are the
  • system component .
  • Dynamic Model
  • - Describe the dynamic properties of the
    system
  • ---gt control flow.
  • --gt Dynamic gt time Sequencing operation,

  • synchronisation.
  • --gtEvent handling Events that mark
    changes
  • State
    that defines context for
  • events
    organisation of
  • events
    and states.
  • - Consists of scenarios, event traces and
    state
  • diagrams, each class has its own state
    diagram

6
Functional Model
  • -) Describes the functional aspects of the
    system
  • - Data Flow
  • -) Concerned with transformation of values
  • - Functions, - Mappings - Constraints
  • - Functional dependencies
  • -) Relates input to output
  • it consists of data flow diagrams.
  • Relationship between the models
  • i) The Object Model (static) describes data
    structure that the Dynamic Model and Functional
  • Model operate on
  • ii) The operations in the Object Model correspond
    to events in the Dynamic Model and processes in
  • the Functional Model
  • iii) The Functional Model describes functions
    invoked by operations in the Object Model and
  • actions in the Dynamic Model.

7
System design
  • Decisions about the organisation of the system
    into sub-systems.
  • Allocation of sub-systems to hardware and
    software components (Physics)
  • Concurrency Grouping objects into concurrent
    tasks
  • Global decision are made about
  • - Inter process communication
  • - data storage
  • - implementation of
    the dynamic
  • model

8
Object Design
  • Shift the emphasis from application (users end)
    towards computer concept.
  • Object representations
  • Operation algorithms
  • Implementation of associations
  • Classes are packaged into modules /files
  • Summary
  • The purpose of the analysis is to understand by
  • modelling the problem in the context of
    application
  • domain using 3 views Object (static), Dynamic
    and

  • Functional model.
  • The purpose of design is to map the analysis
    model
  • into computer entities System and Object
    Design.
  • The purpose of implementation is to realise the
    design
  • Object Orientation in programming ( all phases)
    seems to be the simple (natural) way of reading
    inputs from the problem space and translating
    this input to the solution space. The end of the
    translation is the solution.

9
Common Vocabulary in OO
  • Object Identity An object models a well defined
  • entity or concept in reality (!?). It
    forms a discrete, distinguishable model concept.
  • A computer, A house, A car,
  • Attribute The properties of an object are
    represented by its attribute values.
  • Computer.processor_type IntelP4
  • Car.weight 1020kg
  • Link.protocol tcpip
  • State The present situation of an object is
    represented by a state
  • CPU is busy ( Vs idled)
  • The car moving ( Vs stopped)
  • The link is established (Vs broken)
  • Operation A transition from one state to an
    other is
  • caused by an operation..
  • The ensemble of state
    transitions of an object is
  • called behaviour.

10
Relations
  • Classification Identification of objects with
    the same attributes, states and operations.
  • A class is the representation of the set of
    all objects with
  • the same attributes, states and operations.
  • Intel based PC, Macintosh, Sun Station are
    computers
  • ---gt class Computer.
  • Association An object knows about an other The
    car belongs to Guenter
  • Aggregation An object is compound of other
    objects (also called composition) Guenters car
    is compound of a chassis, 4 doors, 4 wheels and
    a motor.
  • Generalisation Sharing of attributes, states and
    operations among classes based on hierarchical
    relationship (also called inheritance)
  • Train, car, bicycle are VEHICLES
  • The other way around is called
    Specialisation
  • ( a train is a special vehicle that moves
    on rails)
  • Polymorphism The same operation may behave
    differently
  • on objects belonging to different classes.
  • Move on plane fly
  • Move on car translation on a road.

11
Other definitions
  • Event Is an abstraction of something that
    occurs Click mouse button. An event might
    have attributes position of cursor on screen.
  • Transition A change of state is performed by a
    transition. An event may cause a state
    transition click mousse to change the colour
    of the applet.
  • Send Event During transition an object can send
    an
  • event to an other object
  • Class diagram Is is a diagram (graph) that
    represents the static structure of an object
    class.
  • State diagram It is a diagram (graph) that
    represents the dynamic behaviour on an object
    class.

12
Polymorphism
  • It helps decoupling what from how ( it decouples
    in terms of types)
  • It allows improved code organisation,
    readability and extensibility.
  • It also allows to separate things that change
    from things that do not change (i.e final)
  • Polymorphism is possible thanks to dynamic
    binding ( run-time binding)

13
Up casting
  • // Inheritance up casting.
  • class Note
    // Define a friendly class Note
    private int value private Note(int val) value
    val public static final Note MIDDLE_C
    new Note(0), //Instantiated objects
    of type Note C_SHARP new Note(1), B_FLAT
    new Note(2) // Etc.
  • class Instrument
    //Define a general type Instrument
    public void play(Note n) System.out.println("I
    nstrument.play()")
  • class Wind extends Instrument //
    Define Wind as a special type public void
    play(Note n) // of Instrument,
    (Inheritance )
  • System.out.println("Wind.play()")
  • public class Music
    //Define class Music public static void
    tune(Instrument i) // A method to tune// ...
    i.play(Note.MIDDLE_C)
    //play a note public static void
    main(String args) Wind flute new Wind()
    //UP CASTING TUNE TAKES AS
    tune(flute) // Up casting //
    ARGUMENT A wind (not Instrument) ///
    The method Music.tune() takes as argument
    anything derived from Instrument

14
Overridinghappens during run time
  • class Shape // general shape
  • void draw()
  • void erase()
  • class Circle extends Shape
  • void draw() print(circle Draw)
  • void erase() print( Circle Erase)
  • class Square extends Shape
  • void draw()
  • print( square Draw)
  • void erase()
  • print( square Erase)
  • public static Shape randShape()
  • // returns ransom shapes
  • // ? Random not known at compile
  • // time !!!
  • switch ((int)(math.random()2)
  • default
  • case 0 return Shape
  • case 1 return Circle
  • case 2 return Square
  • public static void main( String args )
  • Shape s new Shape9
  • for (int i0 ilt9i)
  • sirandShape()
  • sI.draw()

Remind Methods with empty bodies in root class
better make it abstract.
Write a Comment
User Comments (0)
About PowerShow.com