Study your flashcards anywhere!

Download the official Cram app for free >

  • Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

How to study your flashcards.

Right/Left arrow keys: Navigate between flashcards.right arrow keyleft arrow key

Up/Down arrow keys: Flip the card between the front and back.down keyup key

H key: Show hint (3rd side).h key

A key: Read text to speech.a key

image

Play button

image

Play button

image

Progress

1/22

Click to flip

22 Cards in this Set

  • Front
  • Back

state machine

a model that shows how an object changes from state in response to events


- uses statecharts as notations



state

represent some condition or situation in the life of an object


- it is not an action but a description of something about the object that will remain true until something happens



state machine diagrams consist

- states: represented by the round-cornered rectangles


- events: gives as labels on transition arrows


- transitions: represented by arrows and idnetified by the events that give rise to them


- transitions occur as a response to an event, and cause a change of state

guard [......]

is used to choose which transition to take if the same event appears on more than one transition



transitions

changes takes place in the system


they are either fired or trigerred by events

the state machine models

- the life history of a single object:


- its initial state when first created


- the different states it can be while it exists


- how it can move from state to state in response to events - the state transitions that are possible

initial state

it is not a true state, but is instead a way of indicating which of the real states he object will enter first

final state

show that processing has been terminated.


it has only one outgoing transition, whereas a final state can have many incoming transitions bu no outgoing transitions



actions

consequences are recorded in the action part of the label on the transaction


- event / action


- a single event may often lead to a sequence of actions


- if there were more messages to be sent, they could be added to the action sequence following the event


- each action is separated from the next in the list by a semicolon



guards

it is evaluated when an event occurs


- the transition and any associated actions will only take place if the guard evaluates to true




accept(aGuest) [reservation exist] / setOccupants(aGuest) ; aGuest.setRoom(self)

self- transition

originates in one state and returns to the same state.


- commonly found in state machines that model loops or cycles



avoid putting actions on every transition by using:

- an entry event that is trigerred every time an object enters a state


- an exit event that is trigerred every time an object leaves the state

internal transition

- an event cause an object toreturn again to the same state but without performing the entry and exit events


-used to handle an interrupt where you want some action to take place that does not affect the current state


- they are written inside the state to which they refer

benefits of state machines

- identifying which messages affect which attributes and considering the consequences for each onject belonging to a given class


- they help understand the behaviour of an object over its lifetime


- they help to understand how an object or system must respond to events, object interactions


- they are ensuring correctness

state independent objects

if the object always responds in the same way to a given event, it is unlikely that you need a state diagram

state dependent objects

those objects that react differently.

packages

a way of model elements into a unit


- can be used to group almost everything


- each package define a namespace


- one package can be associated with another


- a package can be depend on another package


- they don't have interfaces and they cannot interact with each other

3 reasons to partition a system:

- to manage size and complexty


- for information hiding


- for logical decomposition

representation of package structure

- draw a package inside another


- represent the package hierarchy in a tree structure



UML representation of package access

- UML allows you to import the contents of one package into another


- an alternative machanism is to use the stereotype << access >>

other use of packages

- you can use packages to present different views of a software system such as its architecture

advantages of system separation into 3 layers

- developers can be allocated to different layers to facilitate parallel development or the user of particular skills such as interface design


- reuse becomes possible in certain areas