Book a Demo

Author Topic: Can Use Cases signify class objects  (Read 3994 times)

rhurst

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Can Use Cases signify class objects
« on: September 26, 2007, 08:20:06 am »
I used a Use Case diagram to kind of get a feel for the types of class objects I needed for my design. Each Use Case ellipseoid represented a class object. I was told that this was the incorrect use of Use Cases. Is this correct?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Can Use Cases signify class objects
« Reply #1 on: September 26, 2007, 08:54:29 am »
Whoever advised you is likely on the right track. That is not how use cases and classes are usually portrayed.

This is not a tutorial board. However, take the time to search through and you'll find a few threads (they are usually several pages long) where use cases are discussed. In these threads you will find quite a few good reference sources cited. Take the time to scan the posts, as they will give you some idea of what various users thought about the various references - level of detail, prerequisites, overall clarity, etc.

HTH, David

PS: There are a few basic tutorials on the Resources page of the Sparx Web site.
No, you can't have it!

thomaskilian

  • Guest
Re: Can Use Cases signify class objects
« Reply #2 on: September 26, 2007, 10:13:38 pm »
Hmm. I can't confirm that a UC is related to exactly one Class. This is something completely different. The UC tells a short story where an Actor gains a piece of value in performing a set of activities. These will later be supported by one or more classes. However, I'm with David: take the time to read a few books...

rhurst

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Can Use Cases signify class objects
« Reply #3 on: September 27, 2007, 06:30:47 am »
Actually I have read "The Unified Modeling Language User Guide 2nd edition". On page 230 it states that "A use case describes a system (or a subsystem, class, or interface) does but it does not specify how it does it."

That statement made me assume a Use Case could represent a class.

However, maybe a package is the best way to represent classes?


«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Can Use Cases signify class objects
« Reply #4 on: September 27, 2007, 06:42:48 am »
No.

To simplify somewhat...

Use a class element to represent a class. Use other diagrams to represent the relationship of the class to other elements, how a class behaves internally and contributes to system behavior, and the various states the class can be in.

If memory serves (I do not have the document at hand) the quote is slightly different: "...describes what a system (...) does..." [Emphasis added, and omitted word in italics.] It does not state that the use case describes what a class (or whatever) is.

David
« Last Edit: September 27, 2007, 06:44:10 am by Midnight »
No, you can't have it!

thomaskilian

  • Guest
Re: Can Use Cases signify class objects
« Reply #5 on: September 27, 2007, 08:31:57 am »
Quote

However, maybe a package is the best way to represent classes?


I think that classes are best represented by classes.

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Can Use Cases signify class objects
« Reply #6 on: September 27, 2007, 08:59:52 am »
Quote
Actually I have read "The Unified Modeling Language User Guide 2nd edition". On page 230 it states that "A use case describes a system (or a subsystem, class, or interface) does but it does not specify how it does it."

That statement made me assume a Use Case could represent a class.

However, maybe a package is the best way to represent classes?


From the UML 2.1.1  Structure Specification, Section 16.1:
Quote
Strictly speaking, the term “use case” refers to a use case type. An instance of a use case refers to an occurrence of the emergent behavior that conforms to the corresponding use case type. Such instances are often described by interaction specifications.

Apparently, your book does not force you to understand is that a type of emergent behavior can be modeled as a class, although in my experience this is seldom done.

Using a Use Case to model other types of object classes is like saying that swaying in the wind is a type of tree.  Your logic is inside out.  More proper to explain that a class of Tree exhibits a behavior of swaying in the wind.

I don't understand why you are avoiding use of the class element to represent a class?  If you are trying to stay at a high level of abstraction, adorn the class element with the abstract symbol.  Your UML fluent readers will better understand your diagrams.
Verbal Use Cases aren't worth the paper they are written upon.