Author Topic: Dependency between UseCases  (Read 1043 times)

huddie

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Dependency between UseCases
« on: August 07, 2003, 01:44:43 am »
Hi everybody,

I want to show how one UseCase is dependent on another in the overall process.

For example; a guest will normally make a reservation first and check in later. How do I show this on my diagram?

a) I could show that the outcome of UC 'Make reservation' is an object 'Reservation' and that  Reservation is the input for UC 'Check in'.

b) Or I could draw a dependency link between Make reservation and Check in and give it a stereotype?

c) Ofcourse I could also make a higher level UseCase with the steps Make Reservation and Check In.

NB: It's perfectly clear that Check in has a pre-condition that a reservation has been made. This specifies the order in time of these Use Cases but this is not shown in the diagram...

What is best practice in your opinion?

Regards, Huddie
The truth is there's no such thing as the truth.

Javier

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
  • Necessity is the mother of email
    • View Profile
Re: Dependency between UseCases
« Reply #1 on: August 07, 2003, 12:07:28 pm »
huddie,

I do not believe that they are necessarily related, since a guest can check in without a reservation.

Therefore, a reservation *is not* a pre-condition to check-in.

I see three ways that this can be modeled:

1. Let  Check In With Reservation <<refine>> Check-In.  This new use case would have a <<refine>> association

..................<<refine>>............................................
Check In <---------------- Check In With Reservation

The refinement then must have a reservation as a precondition.

Your use case text would then look similar to the check in use case, except that the first steps would be to retrieve the reservation information.

2. Let Check In With Reservation <<include>> Check-In.

The use case would also have a reservation as a precondition.

.................<<include>>
Check In <---------------- Check In With Reservation

The semantics for include and refine are different, but in this case you could consider that it is valid to <<include>> the other use case.  Your text would then look something like this--depending on your use case template):

1. The clerk asks for guest information
2. The clerk retrieves the reservation.
3. The Check-In use case executes


3. Model it as a scenario:  The general steps of the use case are the same.  You should pick the most common scenario as the abstraction for your main use case, and then the other as a given scenario.

Regards,

Javier
We must become the change we want to see.
- Ghandi

huddie

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Dependency between UseCases
« Reply #2 on: August 08, 2003, 12:03:06 am »
Javier,

You take a point of view I had not considered yet, I quite agree with your solution and it makes me understand the problem better.

I see now that what I'm actually trying to model is that the precondition of 'Check in with reservation' is met by 'Make reservation'.

Regards, Huddie
The truth is there's no such thing as the truth.

Fintan

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: Dependency between UseCases
« Reply #3 on: August 08, 2003, 05:17:09 am »
Quote
Hi everybody,

I want to show how one UseCase is dependent on another in the overall process.

For example; a guest will normally make a reservation first and check in later. How do I show this on my diagram?

What is best practice in your opinion?

Regards, Huddie


Hi Huddie,

The one thing that Use Cases Diagrams do NOT do is show order.

Rather than messing up your use case diagram, I would use an Activity diagram to show the order.

I wanted to show a diagram of how this looks, but cannot get a picture without having a web site set up :'(

Regards,

Fintan

huddie

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Dependency between UseCases
« Reply #4 on: August 08, 2003, 07:07:51 am »
Hi Fintan,

"An activity diagram is a special case of a state diagram in which all (or at least most) of the states are action or sub activity states and in which all (or at least most) of the transitions are triggered by completion of the actions or sub activities in the source states. "

Therefore an Activity Diagram does not seem appropriate to me.

I think that what's happening is this: a condition of usecase A (and therefore usecase A itself) is dependent on some artifact/outcome of usecase B. As I started this project I simply modelled a dependency from usecase A to B. That does not feel right to me because A is not dependent on B, it's dependent on a product of B.

I could define a custom stereotype for dependency to show this.

Or am I thinking data versus process too much?

Regards, Huddie
The truth is there's no such thing as the truth.

Fintan

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: Dependency between UseCases
« Reply #5 on: August 12, 2003, 03:45:09 am »
Quote
"An activity diagram is a special case of a state diagram in which all (or at least most) of the states are action or sub activity states and in which all (or at least most) of the transitions are triggered by completion of the actions or sub activities in the source states. "

I think this quote trivialises the Activity diagram too much.  An activity diagram can show a process(e.g. a use case), who inititates the process, and the order in which processes take place.  E.g.  Make booking -> Reserve room -> Check In.  This is the order that you are trying to show.

Remember the use case diagram does not show everything.  The use case diagram shows you the specific sets of requirements (functionality) and who initiates each piece of functionality.

As you indicate - do you need to think about data at all?  The dependency is that "check-in" relies on "make booking".  Even so, this should not be shown in a use case diagram.  You can diagram the dependency in an activity diagram as :  Make booking -> Check In.

When writing out the use case for Check In, I would include as a pre-requisite that the Make booking use case must have been executed.

Regards,

Fintan

huddie

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Dependency between UseCases
« Reply #6 on: August 12, 2003, 05:04:01 am »
Hi Fintan,

Your suggestion seems very sensible. I'll work it out that way.

Thnx!

Huddie

The truth is there's no such thing as the truth.