Solved

Class vs Object Vs State daigrams

Posted on 2013-12-17
3
1,485 Views
Last Modified: 2014-06-30
I would like to know when, where, why we use
Class vs Object Vs State daigrams.


What are practical uses, advantages of each of them.

please advise
Any links resources ideas highly appreciated. Thanks in advance
0
Comment
Question by:gudii9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 27

Accepted Solution

by:
dpearson earned 500 total points
ID: 39733330
1) A class diagram shows the static relationships between classes.  A common example is a class hierarchy like this one for Java's AWT library:
http://www.ged.fi/DesignPatterns/AWT.gif

Class diagrams are very common.

2) A state diagram shows the flow of a process - the different states that you can be in and how those states are allowed to change.  E.g. When you use an ATM you can be in a series of different states (e.g. have you entered your PIN number yet or not).  Here's an example of a state diagram for an ATM:
http://people.engr.ncsu.edu/efg/210/s99/Notes/fsm/atm.gif

State diagrams are also quite common as a way to represent a process that happens over time.

3) An object diagram shows a snapshot in time - the relationship between a set of specific objects.  Here's an example of an object diagram:
http://static1.creately.com/blog/wp-content/uploads/2012/01/UML-Object-Diagram.png

The key is that it's showing specific instances (e.g. order_number=0001), not just general relationships between classes.

Personally I've never seen anyone have to draw an object diagram.  Class diagrams and state diagrams are both much more common as they deal with the general behavior of the system - not a specific moment in time (as an object diagram does).

Hope that helps,

Doug
0
 
LVL 7

Author Comment

by:gudii9
ID: 39738546
where can i find lot of examples, diagrams of above kind and good resources to refer.

In the state diagram

http://people.engr.ncsu.edu/efg/210/s99/Notes/fsm/atm.gif

what each circle represents?
Please advise
0
 
LVL 21

Expert Comment

by:Amitkumar Panchal
ID: 40167041
Circle represents a state and a line represents an input/event/action.

In attached snap below can be the examples of state:
- Waiting for card
- Waiting for PIN
- Waiting for choice (Withdraw/Deposit)
- Waiting for amount
- Waiting for confirmation

and

sn on.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question