MCS 270 Spring 2014 Object-Oriented Software Development.

Slides:



Advertisements
Similar presentations
Concepts & Notations. Acknowledgements  The material in this tutorial is based in part on: Concurrency: State Models & Java Programming, by Jeff Magee.
Advertisements

UML State chart/machine diagram State machine diagram is a behavior diagram which shows discrete behavior of a part of designed system through finite state.
State Diagrams A state diagram is a graph whose nodes are states and whose directed arcs are transitions between states. A state diagram specifies the.
State Transition Diagrams
Unified Modeling Language
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 5, Analysis: Dynamic Modeling.
K. Stirewalt CSE 335: Software Design Administrivia Homework #7 on web –A “tour” rather than a working project –Please look through it and try to understand.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
Advanced Behavioral Modeling
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 10: Statecharts.
An Introduction to Rational Rose Real-Time
Unified Modeling Language(UML) BY
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
Lecture 4 Finite State Machine CS6133 Software Specification and Verification.
Timed UML State Machines Ognyana Hristova Tutor: Priv.-Doz. Dr. Thomas Noll June, 2007.
Chapter 10 State Machine Diagrams
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
State Diagrams A state diagram is a graph whose nodes are states and whose directed arcs are transitions between states. A state diagram specifies the.
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
E. Kraemer CSE 335: Software Design Software Architecture and Larger System Design Issues Lecture 5: Finite state modeling and analysis Topics: –Using.
Fall 2010 CS4310 Requirements Engineering UML: Dynamic Modeling Dr. Guoqiang Hu Department of Computer Science UTEP 1.
State Modeling.
1 Software Engineering Dr. K. T. Tsang Lecture 8 State modeling
Systems Analysis and Design in a Changing World, Fifth Edition
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
CS3320::CH111 OBJECT-ORIENTED ANALYSIS Chapter 11.
Object-Oriented Modeling Using UML CS 3331 Section 2.3 of Jia 2003.
1 UML Basic Training. UML Basic training2 Agenda  Definitions: requirements, design  Basics of Unified Modeling Language 1.4  SysML.
MCS 270 Spring 2014 Object-Oriented Software Development.
MCS 270 Spring 2014 Object-Oriented Software Development.
Selected Topics in Software Engineering - Distributed Software Development.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML: Review Session (Optional)
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML: Review Session (Optional)
1 State Modeling  Events  States  Transitions and Conditions  State Diagrams  State Diagram Behavior  Practical Tips.
MCS 270 Spring 2014 Object-Oriented Software Development.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
MCS 270 Spring 2014 Object-Oriented Software Development.
1 Kyung Hee University Statecharts Spring Kyung Hee University Specifying Objects’ Behaviour  Interaction diagrams show message-passing behaviour.
UML Discussion on State Machines Perfectly static system is intensely uninteresting Because nothing ever happens.
Dynamic Models. Outline Dynamic Models Statecharts –States –Transitions –Composite states Interaction Diagrams –Sequence Diagrams The time order of interactions.
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
12 Chapter 12: Advanced Topics in Object-Oriented Design Systems Analysis and Design in a Changing World, 3 rd Edition.
OMT Modeling 1. Object Model : presented by the object model and the data dictionary. 2. Dynamic Model: presented by the state diagrams and event flow.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML State Diagrams.
Systems Analysis and Design in a Changing World, Fourth Edition
States.
CS3773 Software Engineering Lecture 06 UML State Machines.
Interaction Diagram An interaction diagram is a graphical representation of interactions between objects. Sequence diagram: shows the sequence in which.
Systems Analysis and Design in a Changing World, Thursday, Feb 15.
Dynamic Modeling Grady Booch, James Rumbaugh, and Ivar Jacobson, The Unified Modeling Language User Guide, 2 nd edition, Addison Wesley, 2005.
Essentials of Visual Modeling w/ UML Instructor Notes
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 10: Statecharts.
Chapter 3: Introducing the UML
Modeling Object Lifecycles and State-Dependent Behavior ©SoftMoore ConsultingSlide 1.
1 IS 0020 Program Design and Software Tools Unified Modeling Language Lecture 13 November 30, 2004.
Class Diagrams, MVC and Design Patterns CS153P Session 4.
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
State transition modeling
State Machine Model.
Marlon Dumas Institute of Computer Science
State Machine Diagrams
Software Architecture and Larger System Design Issues
CS251 – Software Engineering Lectures 11 State Diagrams
States.
Object Oriented System Design
Chapter 5 state Modeling
Marlon Dumas Institute of Computer Science
States.
Presentation transcript:

MCS 270 Spring 2014 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Today’s schedule State Diagrams Java Review-Example MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Class model: describes the static structure of objects and relationships in a system Comprises object and class diagrams State model: describes the dynamic aspects of objects and the nature of control in a system Interaction model: describes how objects in a system cooperate to achieve broader results Unified modeling language (UML) MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu State Model MCS 270 Object-Oriented Software Development Describes the changes in objects that occur in response to stimuli (events) Consists of multiple state diagrams, one for each class, with temporal behavior that is important to an application

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu What is a State Diagram? A state diagram models dynamic behavior. Specifies sequence of states in which an object can exist: The events and conditions that cause the object to reach those states The actions that take place when those states are reached MCS 270 Object-Oriented Software Development Assistant Professor Tenured

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu LAMP State Diagram OffOn-lowOn-high Burned-out click MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu State Model States: An abstraction of the values and links of an object Some states are “special” Events : Internal and external occurrences that impact, or are generated by, an object Transitions : Response of an object based on events and present state On a change of state, the transition is said to fire MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu State Diagram Notation States: labeled roundtangles Transitions: directed arcs, labeled by triggering event, guard condition, and/or effects Example: ST event(attribs) [condition] / effect States Event Transition MCS 270 Object-Oriented Software Development Guard ConditionEffect

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Guard Condition Boolean expression that must be true for transition to occur Checked only once, at time event occurs; transition fires if true MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Enabling and firing of transitions Transition is: enabled if source state is active and guard condition satisfied fires when enabled and triggering event occurs Example below: enabled when state is Editing and form is complete fires when user presses the “OK” button EditingSubmitted pressOK [form complete] MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu State Diagram Components start state final state simple state concurrent composite state sequential composite state MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu “One-shot” state diagrams Represent objects with finite lives have initial and finite states Initial state - entered on object creation Final state - entry implies destruction of object MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu selecting verifying downloading checking schedule download course offerings make a course selection[download complete] verify selection check schedule select another course make a different selection unscheduled scheduled sign schedule MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Example White’s turn Black’s turn white moves black moves checkmate stalemate Chess game start state final state MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Example White’s turn Black’s turn Black wins White wins Draw white moves black moves checkmate stalemate Chess game start state Final states MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Activity/Effect Activity/Effect = behavior invoked by any number of effects May be performed upon: a transition entry to or exit from a state some event within a state Notation: event / resulting-activity Idle Menu visible r_button_down /showPopup r_button_up/ hidePopup MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Entry and Exit Activities Opening entry / motor up exit / motor off Can bind activities to entry to/ exit from a state MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Do-Activities PaperJam do/ flash warning light Continue for an extended time Occur only within a state Performed for all or part of time object is in state May be interrupted by other events MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Practice: Tic Tac Toe MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Practice: Phone System MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Practice Groups of two: A digital watch has a display and 2 buttons: A and B. The watch has two modes of operation: display time and set time. In the display time, the watch shows hours and minutes. Set time has 2 submodes: set hours and set minutes. The A button selects modes. Each time it is pushed, mode advances: display, set hrs, set mins. In a submode, B advances hours or minutes. Create the state diagram. MCS 270 Object-Oriented Software Development

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Java Review - Arrays MCS 270 Object-Oriented Software Development Arrays in Java are objects. The first line of code creates a reference for an array object. The second line creates the array object. int [] arrayRef; arrayRef = new int[5]; arrayRef[2] = 5; All arrays have a length property that gives you the number of elements in the array. args.length is determined at runtime

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Java Practice MCS 270 Object-Oriented Software Development Use arrays to define the UndirectedGraph class from yesterday. (Assume Vertex and Edge have been defined) class UndirectedGraph { } Use arrays to define the DirectedGraph class from yesterday. class DirectedGraph { }

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Assignments Monday - Homework: Chapter 5. Exercise 5.3, 5.4 Due Friday, Feb. 21 MCS 270 Object-Oriented Software Development