• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

State Diagrams - HOWTO implement them?

 
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Martin Fowler in his book UML Distilled differentiates between action (as transitions) and activities (as states).He mentions about events associated to actions in the form event[guard]/action
I have a couple of queries on this :

  1. Can we find out who has triggered the event shown as action by the State Diagram?If not, which UML artifact would show this?
  2. Wanted some more information/illustrations on implementation of State Diagrams - Any online information on this?Has anyone gone through Real-time UML by Douglass, which Martin Fowler refers to for implementation of State Diagrams?

  3. Thanks in advance,
    Sandeep
    [This message has been edited by Desai Sandeep (edited June 01, 2001).]
 
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i'm also interested in knowing the significant differences between state and activity diagrams... hope our fellow ranchers here would help us... many thanks!
 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A state chart diagram corresponds to a single class.We usually extrapolate object modes to class state.For instance if account is treated as object then it has 2 modes closed and opened thus illustarting the valid states.
A state chart diagram illustartes the valid states and valid state transitions and which events trigger the state transition.
Activity diagrams are the old style flow chart and are used for complex use cases
 
nitin kumar
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An activity diagram is a special form of state diagram used to model a sequence of actions and conditions taken within a process. The modeled process may be at the organizational level or at the system level. One of the most valuable uses of the activity diagram is during operation design
UML activity diagrams document the logic of a single operation or method, a single use case, or the flow of logic of a business process. In many ways, activity diagrams are the object-oriented equivalent of flow charts and data-flow diagrams (DFDs) from structured development. Activity diagram is interesting because it may cuts across the logic of several of the use
cases
Activity diagrams are a useful behavioral modeling tool for the following reasons:
They describe the internal behavior of an operation pictorially
They depict activities that can occur in parallel
They help to identify activities whose responsibility belongs elsewhere
They allow the discovery of common functionality within a system
They can be used as coding specifications
 
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch niti
Please read our naming policy and adjust your displayed name accordingly.
Desai, have you read the examples given in Thinking in Patterns at bruceeckel.com ?
 
nitin kumar
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no i did not go thru that site.I will go thru it
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Can we find out who has triggered the event shown as action by the State Diagram?If not, which UML artifact would show this?


A stage diagram is related to one specific entity, normaly one object. As always you can use a stereotype. You can also link another diagram that shows more detais. If the intetion is primarily to show this interaction, sequence or collaboration diagrams should be used.


Wanted some more information/illustrations on implementation of State Diagrams - Any
online information on this?


They are normaly implemented as an attribute of the object. If you have many states and wnat to avoid usind switch/case command you can use State Pattern described in Larman's book , 2nd edition, pg. 554 or GoF, pg 305.
Online, I found this simple tutorial:
State pattern
Adrian
[ August 15, 2002: Message edited by: Adrian Ferreira ]
 
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic