tags:

views:

360

answers:

7

can two use cases extend or include each other at the same time? A extend/include B and B extend/include A

+2  A: 

I'm pretty sure the answer is "NO".

You've just described the digital equivalent fo the chicken and egg problem.

Circular references are [almost] always Bad Things (tm). The only place I know it to not be horrible is in the context of a linked list, in which each entry has a pointer to another of its own type.

warren
A: 

It seems likely not, though I'm sure you could do it if you went generic [and useless] enough. Do you have a specific example? There are always exemptions to the rules and I'd be curious to see one.

cfeduke
+1  A: 

If (A includes/extends B and B includes/extends A) then A = B

Admitting that if A extends/includes B then A >= B

bruno conde
I was confused by extends/include words but now I think this is correct.
bruno conde
A: 

below is the senario for business use case (business modelling) not system use case: USE Case A: Service Vehicle Use Case B: Authorise Additional repair Use Case C: Repair Vehicle

Additional repair could be identified during initial repair. or repair could be identified as a new repair during service, in both case, customer authorisation is required?

A extend B and B extend C (authorisation and start of repair identified during service)

C extend B (authorisation for additional repair identified during repair)

I wouldn't call "Authorise Additional repair" a use case. Whose goal does it achieve? The vehicle owner's goal is to have a vehicle that works, the mechanic's goal is to provide a service; neither has a goal of producing paperwork. I'd say it's no more than a step in Use Case C.
chimp
A: 

It's rare but in the general case, there's nothing that prevents use cases from including/using each other.

Mark Cidade
A: 

the answer is no. extend and include are mutually-exclusive relationship types. Most likely the use-cases are incorrectly factored/separated, or you've misunderstood the extend/include relationship definitions, or both.

given the example you posted (fyi it is better for you to edit the question rather than post an answer that does not answer the original question) i would venture that B extends A and B extends C, since in both cases A and C additional repairs (case B) may be identified.

alternately, use cases A and C could conditionally include use case B

offhand, i would model this as Work On Vehicle, which is a composition of 2 use-cases, Obtain Customer Authorization, and Service Vehicle, where the latter includes any kind of service or repair and requires the output of the former before starting the work. The notion of 'additional repairs' is just another instance of Work On Vehicle.

but i don't know the full business context, so your mileage may vary ;-)

EDIT: you wrote "but in this case: work is being carried out and further authorisation is required during the course of work", but i don't see how that really matters.

the first step is to eliminate the confusion about includes and extends. Try modeling each use-case completely and independently, and then look at what is common to see if includes/extends is warranted

Steven A. Lowe
but in this case: work is being carried out and further authorisation is required during the course of work
@[me.yahoo.com]: see edits; from the information you've given, and what i know about car repairs and body shops (which isn't much!) i don't see the difference - customer authorization is required for any repair
Steven A. Lowe
ok. car is being put to work. authorisation was received. here question is for further authorisation (if any)
thanks! I do need two use cases one for each work. so what I did is a extend b and c extend b.. because both a and c has common B. before I had linked a to c (repair to service) and only b to c(repair to authorisation)...thanks for your input
A: 

"YES" - Checked the Spec.

I just read through the UML specification section for use cases: http://www.omg.org/spec/UML/2.1.2/Superstructure/PDF/ There was no rule that would prevent doing this that I could find. Many people may conceptually have a problem with this, but that is ok, as you are just instinctively trying to objectize or structure use cases logically. Use Cases are a behavior (or set) and are not like classes/"objects". We are not talking about Java objects.

Even in Rational Software Modeler (IBM) allows this "circular reference".

In practice and in trying to map this to Java or other Object languages it may not make sense or get confusing.

Ted Johnson