Author Topic: Activity vs. Use Case  (Read 8304 times)

thomaskilian

  • Guest
Activity vs. Use Case
« on: January 05, 2004, 08:32:04 am »
Hi UML freaks

I wonder whether someone could explain me the difference in semantic for Activity and Use Case. Isn't it that an activity diagram shows the timely sequence of Use Cases? Why then Activities?

Any clue?

BR

Thomas

futuros

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Activity vs. Use Case
« Reply #1 on: January 09, 2004, 07:35:35 am »
Imagine that you want to call your friend.

1. You take the phone
2. Enter the number
3. Talk with friend
4. Cancel call

Why did you call? Becouse you want  to take the phone(1) ?, or you want only to enter number ? ....  of course no. The reason was to agree on time,place... for saturday night ... :) with you friend. This brings value to you. So - Agree on saturday night is USE CASE, and that four steps represents basics flow of USE CASE.




thomaskilian

  • Guest
Re: Activity vs. Use Case
« Reply #2 on: January 12, 2004, 01:15:20 am »
I see the difference. But imagine a level higher when dealing with business processes. The funny thing is, EA models these as activities (in several books I found stereotyped use cases instead). A business process itself is an aggregation of several use cases.  Also you can imagine a certain order, in which these use cases appear. Here I'm back with my question: why now switch to activities?

Probably it is not so easy to make ANY model of the real world. I guess, UML is simply not perfect in that respect.

CJ

  • EA User
  • **
  • Posts: 288
  • Karma: +0/-0
    • View Profile
Re: Activity vs. Use Case
« Reply #3 on: January 12, 2004, 05:26:17 am »
G'day g'day,

Use Cases are features provided by a system (software system, business system, etc.).

For example, your banking system (forget about computer systems ... think of the old days) provides you with some of the following features:
- open an account
- apply for a loan
- make a deposit
- make a withdrawal
- transfer funds

"Opening an account" involves a certain number of steps.  These steps can be modelled with an activity diagram.

Use cases do not appear in any order.  They are features of a system which you should be able to use individually and independently.  In the banking example, there is no flow from one use case to the other, but you can have pre-conditions: "you must have an account before you can make a loan".  But there is no flow or order between use cases.

I don't think a business process is an aggregation of use cases.  The aggregation of use cases is a system.
« Last Edit: January 12, 2004, 05:27:06 am by jasonv »
Cheers and best regards.

thomaskilian

  • Guest
Re: Activity vs. Use Case
« Reply #4 on: January 12, 2004, 05:49:43 am »
Use Case - understood
Activity - understood

But ---- what is a business process then?  A stereotyped use case, a stereotyped activity, something totally different?

CJ

  • EA User
  • **
  • Posts: 288
  • Karma: +0/-0
    • View Profile
Re: Activity vs. Use Case
« Reply #5 on: January 12, 2004, 12:21:54 pm »
G'day,

Take the banking system example again.

As far as a client of a bank is concerned, there are a series of steps involved in the use case  "Open an Account". These steps are essentially the user guide for "Open and Account".  [Steps to the use case "Open an Account"] is equivalent to [process of opening an account].

From the business perspective, there may be a whole bunch of steps that the banking system performs that are unknown to the client.  All these steps make up the business process of setting up a new account for a client.  If there is an internal system, a bank employee may be interested in the use case "Setup New Account", described by a series of steps.  Those steps describe the business process of setting up a new account.

The following may be more useful than my gibberish above:  "... the business process was written as a use case and documented with an activity diagram."  (p. 85, "Use Cases for Business Processes", Applying Use Cases, Second Edition by Schneider and Winters.)
Cheers and best regards.

thomaskilian

  • Guest
Re: Activity vs. Use Case
« Reply #6 on: January 13, 2004, 04:12:10 am »
Thank you! That really helped and fits into the puzzle.

However, I wonder why EA is using a stereotyped activity for a process and not a use case (which seems to make more sense)? Probably the EA process has nothing to do with a business process (despite the symbol)?

CJ

  • EA User
  • **
  • Posts: 288
  • Karma: +0/-0
    • View Profile
Re: Activity vs. Use Case
« Reply #7 on: January 13, 2004, 07:46:33 am »
G'day,

It depends.  Sometimes it's worth modeling a process as a use case, sometimes not.

If a process provides a result that by itself is of value to a user of a system, then that process is worth modeling as a use case (and activity diagrams).

If a process provides a result that by itself is of no value to a user of a system, then it may not be worth modeling as a use case (but may still be worth modeling activity diagrams).

Before talking about a system and it's use cases, you may want to document and model business processes with activity diagrams and stereotyped activities.  From these business processes, you may find that only a subset are going to be supported by a some new system.
« Last Edit: January 13, 2004, 07:49:13 am by jasonv »
Cheers and best regards.

thomaskilian

  • Guest
Re: Activity vs. Use Case
« Reply #8 on: January 13, 2004, 08:54:51 am »
Thanks again. Probably I was confused by the idea that there is a strict method behind the modelling process. If it depends then I was wrong in that respect. I'll take the opportunity and adapt the modelling to my own style ...

btw: does it make sense to model anything that 'by itself is of no value'?

CJ

  • EA User
  • **
  • Posts: 288
  • Karma: +0/-0
    • View Profile
Re: Activity vs. Use Case
« Reply #9 on: January 13, 2004, 09:22:36 am »
G'day,

If a business process has no perceived value to the user of a system, then it's not worth modeling a use case.  That said, you may still want to model such a process with activity diagram(s) if you want to keep a complete model of the business for whatever reasons.

If a system will not support certain business processes, then some of the models for those processes may provide some context (what's in the system, what's not).
Cheers and best regards.

thomaskilian

  • Guest
Re: Activity vs. Use Case
« Reply #10 on: January 13, 2004, 09:48:55 am »
I'm happy now. Thanks for the explanations. Have a nice day!

JourneymanDave

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Re: Activity vs. Use Case
« Reply #11 on: January 26, 2004, 12:56:08 pm »
Not sure if this is academically defensible against the UML spec, but my understanding would go something like this:

The use case diagram intends to capture a functional requirement, reflecting some desireable outcome - production of some end  that is of value to one or more of the actors.  This is irrespective of the underlying implementation details.  I think of this as being a description of "What?" should happen.

The activity diagram functions in my mind much like a flowchart, and intends to break the "What?" down to a high level definition of "How?".  In other words, now that you know what it is being done in the use case description, the activity diagram helps express the business rules, logical constraints, timing dependencies and important algorithmic concepts of the realization of the use case.  Some people even use swimlanes with activity diagrams to depict allocation of responsibility across system components, but I usually prefer sequence diagrams for this.

Speaking for myself, I don't usually find it's necessary to do a lot of activity diagrams, but when there is a particularly important business rule or other piece of functional logic that needs to be stated explicitly in the design, it strikes me as being useful.  Usually a couple of these per model is my norm, but only for items which I don't think I can better express with other diagram types;  even if there are many more use cases.

Remember too, that using the UML, you tend to have a certain amount of overlap between the various artifacts in your model.  Along the timeline of creating your model and fully fleshing it out, you're basically describing the same things over and over, just at greater levels of detail on each pass.  Sometimes with activity diagrams, there's so much overlap going from use cases to the other diagrams, I just continue on with the next level of detail instead.  

thomaskilian

  • Guest
Re: Activity vs. Use Case
« Reply #12 on: January 26, 2004, 11:55:34 pm »
That far, the methodology seams to be straight and clear. You start from scratch with use cases (what?) and go on (where needed) with activities (how?). But reality is different to that academic approach. As you start with business process analysis you normally will be faced with lots of 'how' (activities) and you have to break it down to find the 'what' (use cases). For that reason, business processes have been invented that show up like big arrows. I'm currently gathering some practice with that approach and still do not have a complete picture. Probably in a year or so...

JourneymanDave

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Re: Activity vs. Use Case
« Reply #13 on: January 27, 2004, 03:13:14 pm »
Point taken, it sounds like you're dealing with a set of task-level information and having to discover the higher-level functions by piecing them back together.  Essentially bottom-up modeling.  

What I described could probably be described as the more Utopian top-down scenario.

I think a large part of the difference is that when building a software system, it frequently is the case that one is building the system to fill a gap in the overall enterprise;  not having to deal with current state items at the task level because they're being created as part of the new model.  Since no business I've ever seen was conducting business with no current-state tasks, it's understandable that you'd have to model from a tactical to strategic viewpoint.

So then, having said all that, where does that lead us back into the discussion of Use Case vs Activity?  Maybe I didn't fully grasp your original question.

JourneymanDave

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Re: Activity vs. Use Case
« Reply #14 on: January 27, 2004, 03:16:56 pm »
BTW, are you using the Eriksson/Penker profile for your process modeling with EA?