Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » preconditions / postconditions of a use case
preconditions / postconditions of a use case [message #474724] Thu, 26 July 2007 08:35 Go to next message
Eclipse UserFriend
Originally posted by: manuela.rink.imagine-worlds.de

Hello,

I've got a model containing an use case, a class that is affected by the
use case and a state machine that describes the states of the class.
I want to set preconditions and postconditions of the use case which
refer to the states defined in the state machine, i.e. (state A or state
B) is the precondition and state C is the postcondition.
Is there a way to model this in UML2 and what is it?

Thanks,
Manuela
Re: preconditions / postconditions of a use case [message #474733 is a reply to message #474724] Fri, 27 July 2007 13:50 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Manuela,

UseCases are BehavioredClassifiers. Behaviored classifiers allow you to
add owned behaviors. Behaviors can have pre and post conditions.
A StateMachine is a Behavior and so is an OpaqueBehavior. So you can
create one or the other as your behavior depending on how you want to
specify the UseCase.

Pre and post conditions are Constraints and a constraint has a context which
is a namespace and a specification. A State is a namespace so you should
be able to set the context of your constraint to a State but I don't think
you can directly set the precondition to be the State itself.

I hope this helps.

- James.




"Manuela Rink" <manuela.rink@imagine-worlds.de> wrote in message
news:f89mc8$ohv$1@build.eclipse.org...
> Hello,
>
> I've got a model containing an use case, a class that is affected by the
> use case and a state machine that describes the states of the class.
> I want to set preconditions and postconditions of the use case which
> refer to the states defined in the state machine, i.e. (state A or state
> B) is the precondition and state C is the postcondition.
> Is there a way to model this in UML2 and what is it?
>
> Thanks,
> Manuela
Re: preconditions / postconditions of a use case [message #474743 is a reply to message #474733] Mon, 30 July 2007 10:35 Go to previous messageGo to next message
exquisitus is currently offline exquisitusFriend
Messages: 211
Registered: July 2009
Senior Member
Thanks, James, for your hints.
Unfortunately, there are still some things unclear to me:

If I understand you right I have to define a Behavior for the UseCase.
This could be the StateMachine (but this doesn't work for my example),
but also an other Behavior (e.g. an Interaction). Having a Behavior I
can define Pre-/Postconditions for it which are Constraints.
You wrote that the namespace of such a Constraint has to be the State I
want to refer to. This would mean I'd have to create it as a child
(ownedRule) of the State (I'm using the Eclipse UML2-Editor). But then
how can this Constraint be a Pre-/Postcondition of the UseCases'
Behavior (how can I create the reference in between)?
I hope, you understand what I mean.

Is there no other, more general way to relate information like this in
an UML2-model? My problem is that I have to combine information from
different diagram types (Use-Case-Diagram, Sequence-Diagram and
StateMachines) and generate a natural language summary from it that
addresses people who don't need to know about UML2 and don't have
interest in implementational details.
So I need to model relationships on a rather abstract level. For
instance, another problem I face is the connection between a Transition
of a StateMachine and a UseCase. That is, the Transition, as occuring in
the course of a certain UseCase, should refer to this enclosing UseCase.
Does anyone have an idea how to accomplish this without using rather
implementational information (the exact operations triggering the
Transition)?

Thanks, Manuela



James Bruck schrieb:
> Hi Manuela,
>
> UseCases are BehavioredClassifiers. Behaviored classifiers allow you to
> add owned behaviors. Behaviors can have pre and post conditions.
> A StateMachine is a Behavior and so is an OpaqueBehavior. So you can
> create one or the other as your behavior depending on how you want to
> specify the UseCase.
>
> Pre and post conditions are Constraints and a constraint has a context which
> is a namespace and a specification. A State is a namespace so you should
> be able to set the context of your constraint to a State but I don't think
> you can directly set the precondition to be the State itself.
>
> I hope this helps.
>
> - James.
>
>
>
>
> "Manuela Rink" <manuela.rink@imagine-worlds.de> wrote in message
> news:f89mc8$ohv$1@build.eclipse.org...
>
>>Hello,
>>
>>I've got a model containing an use case, a class that is affected by the
>>use case and a state machine that describes the states of the class.
>>I want to set preconditions and postconditions of the use case which
>>refer to the states defined in the state machine, i.e. (state A or state
>>B) is the precondition and state C is the postcondition.
>>Is there a way to model this in UML2 and what is it?
>>
>>Thanks,
>>Manuela
>
>
>
Re: preconditions / postconditions of a use case [message #474751 is a reply to message #474743] Tue, 31 July 2007 17:38 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Manuela,

You're right, the namespace (and context) of the constraint should be the
element that owns it. Rather than using a concrete type of behavior, you
could consider using something like an opaque behavior (with pre- and
post-conditions) which describes the behavior in a high-level way in natural
language. I don't see why you couldn't reference the states from a state
machine owned by the subject of the use case (a class), although this would
effectively be creating an "implementation" dependency between your high
level description of the behavior (in the use case) and your lower level,
more detailed, description of the behavior in the state machine...

You can always refence elements like states and transitions using their
fully qualified names (they're named elements), assuming their visibility
hasn't been restricted by their owning namespace(s). Being in the same
namespace (either as an owned member or imported member) just means that
references to the elements need not use their qualified names...

Kenn

"exquisitus" <manuela.rink@imagine-worlds.de> wrote in message
news:f8kes1$hed$1@build.eclipse.org...
> Thanks, James, for your hints.
> Unfortunately, there are still some things unclear to me:
>
> If I understand you right I have to define a Behavior for the UseCase.
> This could be the StateMachine (but this doesn't work for my example),
> but also an other Behavior (e.g. an Interaction). Having a Behavior I
> can define Pre-/Postconditions for it which are Constraints.
> You wrote that the namespace of such a Constraint has to be the State I
> want to refer to. This would mean I'd have to create it as a child
> (ownedRule) of the State (I'm using the Eclipse UML2-Editor). But then
> how can this Constraint be a Pre-/Postcondition of the UseCases'
> Behavior (how can I create the reference in between)?
> I hope, you understand what I mean.
>
> Is there no other, more general way to relate information like this in
> an UML2-model? My problem is that I have to combine information from
> different diagram types (Use-Case-Diagram, Sequence-Diagram and
> StateMachines) and generate a natural language summary from it that
> addresses people who don't need to know about UML2 and don't have
> interest in implementational details.
> So I need to model relationships on a rather abstract level. For
> instance, another problem I face is the connection between a Transition
> of a StateMachine and a UseCase. That is, the Transition, as occuring in
> the course of a certain UseCase, should refer to this enclosing UseCase.
> Does anyone have an idea how to accomplish this without using rather
> implementational information (the exact operations triggering the
> Transition)?
>
> Thanks, Manuela
>
>
>
> James Bruck schrieb:
>> Hi Manuela,
>>
>> UseCases are BehavioredClassifiers. Behaviored classifiers allow you
>> to
>> add owned behaviors. Behaviors can have pre and post conditions.
>> A StateMachine is a Behavior and so is an OpaqueBehavior. So you can
>> create one or the other as your behavior depending on how you want to
>> specify the UseCase.
>>
>> Pre and post conditions are Constraints and a constraint has a context
>> which
>> is a namespace and a specification. A State is a namespace so you
>> should
>> be able to set the context of your constraint to a State but I don't
>> think
>> you can directly set the precondition to be the State itself.
>>
>> I hope this helps.
>>
>> - James.
>>
>>
>>
>>
>> "Manuela Rink" <manuela.rink@imagine-worlds.de> wrote in message
>> news:f89mc8$ohv$1@build.eclipse.org...
>>
>>>Hello,
>>>
>>>I've got a model containing an use case, a class that is affected by the
>>>use case and a state machine that describes the states of the class.
>>>I want to set preconditions and postconditions of the use case which
>>>refer to the states defined in the state machine, i.e. (state A or state
>>>B) is the precondition and state C is the postcondition.
>>>Is there a way to model this in UML2 and what is it?
>>>
>>>Thanks,
>>>Manuela
>>
>>
>>
Re: preconditions / postconditions of a use case [message #474754 is a reply to message #474751] Wed, 01 August 2007 09:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: manuela.rink.imagine-worlds.de

Thank you, Kenn.
You've mentioned the subject of a UseCase. I'm not yet sure about the
correct semantics of the term 'subject'. Let's assume I want to model a
Library System and I've got a use case 'borrow instance' which affects
the classes 'Instance' and 'UserAccount' by changing their internal
states at some time in its course. Can I then say the subjects of
'borrow instance' are these two classes? After reading through the
specification I would think the subject is the Library System itself
(respectively the component of the system that performs the use case).
But then I wouldn't have a direct reference to 'Instance' and
'UserAccount' and I need to express that the use case 'works' on these
classes.

Greetings, Manuela



Kenn Hussey schrieb:
> Manuela,
>
> You're right, the namespace (and context) of the constraint should be the
> element that owns it. Rather than using a concrete type of behavior, you
> could consider using something like an opaque behavior (with pre- and
> post-conditions) which describes the behavior in a high-level way in natural
> language. I don't see why you couldn't reference the states from a state
> machine owned by the subject of the use case (a class), although this would
> effectively be creating an "implementation" dependency between your high
> level description of the behavior (in the use case) and your lower level,
> more detailed, description of the behavior in the state machine...
>
> You can always refence elements like states and transitions using their
> fully qualified names (they're named elements), assuming their visibility
> hasn't been restricted by their owning namespace(s). Being in the same
> namespace (either as an owned member or imported member) just means that
> references to the elements need not use their qualified names...
>
> Kenn
>
> "exquisitus" <manuela.rink@imagine-worlds.de> wrote in message
> news:f8kes1$hed$1@build.eclipse.org...
>
>>Thanks, James, for your hints.
>>Unfortunately, there are still some things unclear to me:
>>
>>If I understand you right I have to define a Behavior for the UseCase.
>>This could be the StateMachine (but this doesn't work for my example),
>>but also an other Behavior (e.g. an Interaction). Having a Behavior I
>>can define Pre-/Postconditions for it which are Constraints.
>>You wrote that the namespace of such a Constraint has to be the State I
>>want to refer to. This would mean I'd have to create it as a child
>>(ownedRule) of the State (I'm using the Eclipse UML2-Editor). But then
>>how can this Constraint be a Pre-/Postcondition of the UseCases'
>>Behavior (how can I create the reference in between)?
>>I hope, you understand what I mean.
>>
>>Is there no other, more general way to relate information like this in
>>an UML2-model? My problem is that I have to combine information from
>>different diagram types (Use-Case-Diagram, Sequence-Diagram and
>>StateMachines) and generate a natural language summary from it that
>>addresses people who don't need to know about UML2 and don't have
>>interest in implementational details.
>>So I need to model relationships on a rather abstract level. For
>>instance, another problem I face is the connection between a Transition
>>of a StateMachine and a UseCase. That is, the Transition, as occuring in
>>the course of a certain UseCase, should refer to this enclosing UseCase.
>>Does anyone have an idea how to accomplish this without using rather
>>implementational information (the exact operations triggering the
>>Transition)?
>>
>>Thanks, Manuela
>>
>>
>>
>>James Bruck schrieb:
>>
>>>Hi Manuela,
>>>
>>>UseCases are BehavioredClassifiers. Behaviored classifiers allow you
>>>to
>>>add owned behaviors. Behaviors can have pre and post conditions.
>>>A StateMachine is a Behavior and so is an OpaqueBehavior. So you can
>>>create one or the other as your behavior depending on how you want to
>>>specify the UseCase.
>>>
>>>Pre and post conditions are Constraints and a constraint has a context
>>>which
>>>is a namespace and a specification. A State is a namespace so you
>>>should
>>>be able to set the context of your constraint to a State but I don't
>>>think
>>>you can directly set the precondition to be the State itself.
>>>
>>>I hope this helps.
>>>
>>>- James.
>>>
>>>
>>>
>>>
>>>"Manuela Rink" <manuela.rink@imagine-worlds.de> wrote in message
>>>news:f89mc8$ohv$1@build.eclipse.org...
>>>
>>>
>>>>Hello,
>>>>
>>>>I've got a model containing an use case, a class that is affected by the
>>>>use case and a state machine that describes the states of the class.
>>>>I want to set preconditions and postconditions of the use case which
>>>>refer to the states defined in the state machine, i.e. (state A or state
>>>>B) is the precondition and state C is the postcondition.
>>>>Is there a way to model this in UML2 and what is it?
>>>>
>>>>Thanks,
>>>>Manuela
>>>
>>>
>>>
>
>
Re: preconditions / postconditions of a use case [message #474757 is a reply to message #474754] Wed, 01 August 2007 15:02 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Manuela,

Yes, based on what the specification says about the semantics of a use
case's subject(s), I'd say that the subject for your use case would be the
library system component. But just because the affected elements of your use
case aren't specified as its subjects does not mean you can't reference
those elements (assuming you're OK with creating such a "dependency")...

Kenn

"Manuela Rink" <manuela.rink@imagine-worlds.de> wrote in message
news:f8pkq9$6nq$1@build.eclipse.org...
> Thank you, Kenn.
> You've mentioned the subject of a UseCase. I'm not yet sure about the
> correct semantics of the term 'subject'. Let's assume I want to model a
> Library System and I've got a use case 'borrow instance' which affects
> the classes 'Instance' and 'UserAccount' by changing their internal
> states at some time in its course. Can I then say the subjects of
> 'borrow instance' are these two classes? After reading through the
> specification I would think the subject is the Library System itself
> (respectively the component of the system that performs the use case).
> But then I wouldn't have a direct reference to 'Instance' and
> 'UserAccount' and I need to express that the use case 'works' on these
> classes.
>
> Greetings, Manuela
>
>
>
> Kenn Hussey schrieb:
>> Manuela,
>>
>> You're right, the namespace (and context) of the constraint should be the
>> element that owns it. Rather than using a concrete type of behavior, you
>> could consider using something like an opaque behavior (with pre- and
>> post-conditions) which describes the behavior in a high-level way in
>> natural
>> language. I don't see why you couldn't reference the states from a state
>> machine owned by the subject of the use case (a class), although this
>> would
>> effectively be creating an "implementation" dependency between your high
>> level description of the behavior (in the use case) and your lower level,
>> more detailed, description of the behavior in the state machine...
>>
>> You can always refence elements like states and transitions using their
>> fully qualified names (they're named elements), assuming their visibility
>> hasn't been restricted by their owning namespace(s). Being in the same
>> namespace (either as an owned member or imported member) just means that
>> references to the elements need not use their qualified names...
>>
>> Kenn
>>
>> "exquisitus" <manuela.rink@imagine-worlds.de> wrote in message
>> news:f8kes1$hed$1@build.eclipse.org...
>>
>>>Thanks, James, for your hints.
>>>Unfortunately, there are still some things unclear to me:
>>>
>>>If I understand you right I have to define a Behavior for the UseCase.
>>>This could be the StateMachine (but this doesn't work for my example),
>>>but also an other Behavior (e.g. an Interaction). Having a Behavior I
>>>can define Pre-/Postconditions for it which are Constraints.
>>>You wrote that the namespace of such a Constraint has to be the State I
>>>want to refer to. This would mean I'd have to create it as a child
>>>(ownedRule) of the State (I'm using the Eclipse UML2-Editor). But then
>>>how can this Constraint be a Pre-/Postcondition of the UseCases'
>>>Behavior (how can I create the reference in between)?
>>>I hope, you understand what I mean.
>>>
>>>Is there no other, more general way to relate information like this in
>>>an UML2-model? My problem is that I have to combine information from
>>>different diagram types (Use-Case-Diagram, Sequence-Diagram and
>>>StateMachines) and generate a natural language summary from it that
>>>addresses people who don't need to know about UML2 and don't have
>>>interest in implementational details.
>>>So I need to model relationships on a rather abstract level. For
>>>instance, another problem I face is the connection between a Transition
>>>of a StateMachine and a UseCase. That is, the Transition, as occuring in
>>>the course of a certain UseCase, should refer to this enclosing UseCase.
>>>Does anyone have an idea how to accomplish this without using rather
>>>implementational information (the exact operations triggering the
>>>Transition)?
>>>
>>>Thanks, Manuela
>>>
>>>
>>>
>>>James Bruck schrieb:
>>>
>>>>Hi Manuela,
>>>>
>>>>UseCases are BehavioredClassifiers. Behaviored classifiers allow you
>>>>to
>>>>add owned behaviors. Behaviors can have pre and post conditions.
>>>>A StateMachine is a Behavior and so is an OpaqueBehavior. So you can
>>>>create one or the other as your behavior depending on how you want to
>>>>specify the UseCase.
>>>>
>>>>Pre and post conditions are Constraints and a constraint has a context
>>>>which
>>>>is a namespace and a specification. A State is a namespace so you
>>>>should
>>>>be able to set the context of your constraint to a State but I don't
>>>>think
>>>>you can directly set the precondition to be the State itself.
>>>>
>>>>I hope this helps.
>>>>
>>>>- James.
>>>>
>>>>
>>>>
>>>>
>>>>"Manuela Rink" <manuela.rink@imagine-worlds.de> wrote in message
>>>>news:f89mc8$ohv$1@build.eclipse.org...
>>>>
>>>>
>>>>>Hello,
>>>>>
>>>>>I've got a model containing an use case, a class that is affected by
>>>>>the
>>>>>use case and a state machine that describes the states of the class.
>>>>>I want to set preconditions and postconditions of the use case which
>>>>>refer to the states defined in the state machine, i.e. (state A or
>>>>>state
>>>>>B) is the precondition and state C is the postcondition.
>>>>>Is there a way to model this in UML2 and what is it?
>>>>>
>>>>>Thanks,
>>>>>Manuela
>>>>
>>>>
>>>>
>>
>>
Re: preconditions / postconditions of a use case [message #624105 is a reply to message #474724] Fri, 27 July 2007 13:50 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Manuela,

UseCases are BehavioredClassifiers. Behaviored classifiers allow you to
add owned behaviors. Behaviors can have pre and post conditions.
A StateMachine is a Behavior and so is an OpaqueBehavior. So you can
create one or the other as your behavior depending on how you want to
specify the UseCase.

Pre and post conditions are Constraints and a constraint has a context which
is a namespace and a specification. A State is a namespace so you should
be able to set the context of your constraint to a State but I don't think
you can directly set the precondition to be the State itself.

I hope this helps.

- James.




"Manuela Rink" <manuela.rink@imagine-worlds.de> wrote in message
news:f89mc8$ohv$1@build.eclipse.org...
> Hello,
>
> I've got a model containing an use case, a class that is affected by the
> use case and a state machine that describes the states of the class.
> I want to set preconditions and postconditions of the use case which
> refer to the states defined in the state machine, i.e. (state A or state
> B) is the precondition and state C is the postcondition.
> Is there a way to model this in UML2 and what is it?
>
> Thanks,
> Manuela
Re: preconditions / postconditions of a use case [message #624119 is a reply to message #474733] Mon, 30 July 2007 10:35 Go to previous message
exquisitus is currently offline exquisitusFriend
Messages: 211
Registered: July 2009
Senior Member
Thanks, James, for your hints.
Unfortunately, there are still some things unclear to me:

If I understand you right I have to define a Behavior for the UseCase.
This could be the StateMachine (but this doesn't work for my example),
but also an other Behavior (e.g. an Interaction). Having a Behavior I
can define Pre-/Postconditions for it which are Constraints.
You wrote that the namespace of such a Constraint has to be the State I
want to refer to. This would mean I'd have to create it as a child
(ownedRule) of the State (I'm using the Eclipse UML2-Editor). But then
how can this Constraint be a Pre-/Postcondition of the UseCases'
Behavior (how can I create the reference in between)?
I hope, you understand what I mean.

Is there no other, more general way to relate information like this in
an UML2-model? My problem is that I have to combine information from
different diagram types (Use-Case-Diagram, Sequence-Diagram and
StateMachines) and generate a natural language summary from it that
addresses people who don't need to know about UML2 and don't have
interest in implementational details.
So I need to model relationships on a rather abstract level. For
instance, another problem I face is the connection between a Transition
of a StateMachine and a UseCase. That is, the Transition, as occuring in
the course of a certain UseCase, should refer to this enclosing UseCase.
Does anyone have an idea how to accomplish this without using rather
implementational information (the exact operations triggering the
Transition)?

Thanks, Manuela



James Bruck schrieb:
> Hi Manuela,
>
> UseCases are BehavioredClassifiers. Behaviored classifiers allow you to
> add owned behaviors. Behaviors can have pre and post conditions.
> A StateMachine is a Behavior and so is an OpaqueBehavior. So you can
> create one or the other as your behavior depending on how you want to
> specify the UseCase.
>
> Pre and post conditions are Constraints and a constraint has a context which
> is a namespace and a specification. A State is a namespace so you should
> be able to set the context of your constraint to a State but I don't think
> you can directly set the precondition to be the State itself.
>
> I hope this helps.
>
> - James.
>
>
>
>
> "Manuela Rink" <manuela.rink@imagine-worlds.de> wrote in message
> news:f89mc8$ohv$1@build.eclipse.org...
>
>>Hello,
>>
>>I've got a model containing an use case, a class that is affected by the
>>use case and a state machine that describes the states of the class.
>>I want to set preconditions and postconditions of the use case which
>>refer to the states defined in the state machine, i.e. (state A or state
>>B) is the precondition and state C is the postcondition.
>>Is there a way to model this in UML2 and what is it?
>>
>>Thanks,
>>Manuela
>
>
>
Re: preconditions / postconditions of a use case [message #624147 is a reply to message #474743] Tue, 31 July 2007 17:38 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Manuela,

You're right, the namespace (and context) of the constraint should be the
element that owns it. Rather than using a concrete type of behavior, you
could consider using something like an opaque behavior (with pre- and
post-conditions) which describes the behavior in a high-level way in natural
language. I don't see why you couldn't reference the states from a state
machine owned by the subject of the use case (a class), although this would
effectively be creating an "implementation" dependency between your high
level description of the behavior (in the use case) and your lower level,
more detailed, description of the behavior in the state machine...

You can always refence elements like states and transitions using their
fully qualified names (they're named elements), assuming their visibility
hasn't been restricted by their owning namespace(s). Being in the same
namespace (either as an owned member or imported member) just means that
references to the elements need not use their qualified names...

Kenn

"exquisitus" <manuela.rink@imagine-worlds.de> wrote in message
news:f8kes1$hed$1@build.eclipse.org...
> Thanks, James, for your hints.
> Unfortunately, there are still some things unclear to me:
>
> If I understand you right I have to define a Behavior for the UseCase.
> This could be the StateMachine (but this doesn't work for my example),
> but also an other Behavior (e.g. an Interaction). Having a Behavior I
> can define Pre-/Postconditions for it which are Constraints.
> You wrote that the namespace of such a Constraint has to be the State I
> want to refer to. This would mean I'd have to create it as a child
> (ownedRule) of the State (I'm using the Eclipse UML2-Editor). But then
> how can this Constraint be a Pre-/Postcondition of the UseCases'
> Behavior (how can I create the reference in between)?
> I hope, you understand what I mean.
>
> Is there no other, more general way to relate information like this in
> an UML2-model? My problem is that I have to combine information from
> different diagram types (Use-Case-Diagram, Sequence-Diagram and
> StateMachines) and generate a natural language summary from it that
> addresses people who don't need to know about UML2 and don't have
> interest in implementational details.
> So I need to model relationships on a rather abstract level. For
> instance, another problem I face is the connection between a Transition
> of a StateMachine and a UseCase. That is, the Transition, as occuring in
> the course of a certain UseCase, should refer to this enclosing UseCase.
> Does anyone have an idea how to accomplish this without using rather
> implementational information (the exact operations triggering the
> Transition)?
>
> Thanks, Manuela
>
>
>
> James Bruck schrieb:
>> Hi Manuela,
>>
>> UseCases are BehavioredClassifiers. Behaviored classifiers allow you
>> to
>> add owned behaviors. Behaviors can have pre and post conditions.
>> A StateMachine is a Behavior and so is an OpaqueBehavior. So you can
>> create one or the other as your behavior depending on how you want to
>> specify the UseCase.
>>
>> Pre and post conditions are Constraints and a constraint has a context
>> which
>> is a namespace and a specification. A State is a namespace so you
>> should
>> be able to set the context of your constraint to a State but I don't
>> think
>> you can directly set the precondition to be the State itself.
>>
>> I hope this helps.
>>
>> - James.
>>
>>
>>
>>
>> "Manuela Rink" <manuela.rink@imagine-worlds.de> wrote in message
>> news:f89mc8$ohv$1@build.eclipse.org...
>>
>>>Hello,
>>>
>>>I've got a model containing an use case, a class that is affected by the
>>>use case and a state machine that describes the states of the class.
>>>I want to set preconditions and postconditions of the use case which
>>>refer to the states defined in the state machine, i.e. (state A or state
>>>B) is the precondition and state C is the postcondition.
>>>Is there a way to model this in UML2 and what is it?
>>>
>>>Thanks,
>>>Manuela
>>
>>
>>
Re: preconditions / postconditions of a use case [message #624150 is a reply to message #474751] Wed, 01 August 2007 09:46 Go to previous message
Eclipse UserFriend
Originally posted by: manuela.rink.imagine-worlds.de

Thank you, Kenn.
You've mentioned the subject of a UseCase. I'm not yet sure about the
correct semantics of the term 'subject'. Let's assume I want to model a
Library System and I've got a use case 'borrow instance' which affects
the classes 'Instance' and 'UserAccount' by changing their internal
states at some time in its course. Can I then say the subjects of
'borrow instance' are these two classes? After reading through the
specification I would think the subject is the Library System itself
(respectively the component of the system that performs the use case).
But then I wouldn't have a direct reference to 'Instance' and
'UserAccount' and I need to express that the use case 'works' on these
classes.

Greetings, Manuela



Kenn Hussey schrieb:
> Manuela,
>
> You're right, the namespace (and context) of the constraint should be the
> element that owns it. Rather than using a concrete type of behavior, you
> could consider using something like an opaque behavior (with pre- and
> post-conditions) which describes the behavior in a high-level way in natural
> language. I don't see why you couldn't reference the states from a state
> machine owned by the subject of the use case (a class), although this would
> effectively be creating an "implementation" dependency between your high
> level description of the behavior (in the use case) and your lower level,
> more detailed, description of the behavior in the state machine...
>
> You can always refence elements like states and transitions using their
> fully qualified names (they're named elements), assuming their visibility
> hasn't been restricted by their owning namespace(s). Being in the same
> namespace (either as an owned member or imported member) just means that
> references to the elements need not use their qualified names...
>
> Kenn
>
> "exquisitus" <manuela.rink@imagine-worlds.de> wrote in message
> news:f8kes1$hed$1@build.eclipse.org...
>
>>Thanks, James, for your hints.
>>Unfortunately, there are still some things unclear to me:
>>
>>If I understand you right I have to define a Behavior for the UseCase.
>>This could be the StateMachine (but this doesn't work for my example),
>>but also an other Behavior (e.g. an Interaction). Having a Behavior I
>>can define Pre-/Postconditions for it which are Constraints.
>>You wrote that the namespace of such a Constraint has to be the State I
>>want to refer to. This would mean I'd have to create it as a child
>>(ownedRule) of the State (I'm using the Eclipse UML2-Editor). But then
>>how can this Constraint be a Pre-/Postcondition of the UseCases'
>>Behavior (how can I create the reference in between)?
>>I hope, you understand what I mean.
>>
>>Is there no other, more general way to relate information like this in
>>an UML2-model? My problem is that I have to combine information from
>>different diagram types (Use-Case-Diagram, Sequence-Diagram and
>>StateMachines) and generate a natural language summary from it that
>>addresses people who don't need to know about UML2 and don't have
>>interest in implementational details.
>>So I need to model relationships on a rather abstract level. For
>>instance, another problem I face is the connection between a Transition
>>of a StateMachine and a UseCase. That is, the Transition, as occuring in
>>the course of a certain UseCase, should refer to this enclosing UseCase.
>>Does anyone have an idea how to accomplish this without using rather
>>implementational information (the exact operations triggering the
>>Transition)?
>>
>>Thanks, Manuela
>>
>>
>>
>>James Bruck schrieb:
>>
>>>Hi Manuela,
>>>
>>>UseCases are BehavioredClassifiers. Behaviored classifiers allow you
>>>to
>>>add owned behaviors. Behaviors can have pre and post conditions.
>>>A StateMachine is a Behavior and so is an OpaqueBehavior. So you can
>>>create one or the other as your behavior depending on how you want to
>>>specify the UseCase.
>>>
>>>Pre and post conditions are Constraints and a constraint has a context
>>>which
>>>is a namespace and a specification. A State is a namespace so you
>>>should
>>>be able to set the context of your constraint to a State but I don't
>>>think
>>>you can directly set the precondition to be the State itself.
>>>
>>>I hope this helps.
>>>
>>>- James.
>>>
>>>
>>>
>>>
>>>"Manuela Rink" <manuela.rink@imagine-worlds.de> wrote in message
>>>news:f89mc8$ohv$1@build.eclipse.org...
>>>
>>>
>>>>Hello,
>>>>
>>>>I've got a model containing an use case, a class that is affected by the
>>>>use case and a state machine that describes the states of the class.
>>>>I want to set preconditions and postconditions of the use case which
>>>>refer to the states defined in the state machine, i.e. (state A or state
>>>>B) is the precondition and state C is the postcondition.
>>>>Is there a way to model this in UML2 and what is it?
>>>>
>>>>Thanks,
>>>>Manuela
>>>
>>>
>>>
>
>
Re: preconditions / postconditions of a use case [message #624153 is a reply to message #474754] Wed, 01 August 2007 15:02 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Manuela,

Yes, based on what the specification says about the semantics of a use
case's subject(s), I'd say that the subject for your use case would be the
library system component. But just because the affected elements of your use
case aren't specified as its subjects does not mean you can't reference
those elements (assuming you're OK with creating such a "dependency")...

Kenn

"Manuela Rink" <manuela.rink@imagine-worlds.de> wrote in message
news:f8pkq9$6nq$1@build.eclipse.org...
> Thank you, Kenn.
> You've mentioned the subject of a UseCase. I'm not yet sure about the
> correct semantics of the term 'subject'. Let's assume I want to model a
> Library System and I've got a use case 'borrow instance' which affects
> the classes 'Instance' and 'UserAccount' by changing their internal
> states at some time in its course. Can I then say the subjects of
> 'borrow instance' are these two classes? After reading through the
> specification I would think the subject is the Library System itself
> (respectively the component of the system that performs the use case).
> But then I wouldn't have a direct reference to 'Instance' and
> 'UserAccount' and I need to express that the use case 'works' on these
> classes.
>
> Greetings, Manuela
>
>
>
> Kenn Hussey schrieb:
>> Manuela,
>>
>> You're right, the namespace (and context) of the constraint should be the
>> element that owns it. Rather than using a concrete type of behavior, you
>> could consider using something like an opaque behavior (with pre- and
>> post-conditions) which describes the behavior in a high-level way in
>> natural
>> language. I don't see why you couldn't reference the states from a state
>> machine owned by the subject of the use case (a class), although this
>> would
>> effectively be creating an "implementation" dependency between your high
>> level description of the behavior (in the use case) and your lower level,
>> more detailed, description of the behavior in the state machine...
>>
>> You can always refence elements like states and transitions using their
>> fully qualified names (they're named elements), assuming their visibility
>> hasn't been restricted by their owning namespace(s). Being in the same
>> namespace (either as an owned member or imported member) just means that
>> references to the elements need not use their qualified names...
>>
>> Kenn
>>
>> "exquisitus" <manuela.rink@imagine-worlds.de> wrote in message
>> news:f8kes1$hed$1@build.eclipse.org...
>>
>>>Thanks, James, for your hints.
>>>Unfortunately, there are still some things unclear to me:
>>>
>>>If I understand you right I have to define a Behavior for the UseCase.
>>>This could be the StateMachine (but this doesn't work for my example),
>>>but also an other Behavior (e.g. an Interaction). Having a Behavior I
>>>can define Pre-/Postconditions for it which are Constraints.
>>>You wrote that the namespace of such a Constraint has to be the State I
>>>want to refer to. This would mean I'd have to create it as a child
>>>(ownedRule) of the State (I'm using the Eclipse UML2-Editor). But then
>>>how can this Constraint be a Pre-/Postcondition of the UseCases'
>>>Behavior (how can I create the reference in between)?
>>>I hope, you understand what I mean.
>>>
>>>Is there no other, more general way to relate information like this in
>>>an UML2-model? My problem is that I have to combine information from
>>>different diagram types (Use-Case-Diagram, Sequence-Diagram and
>>>StateMachines) and generate a natural language summary from it that
>>>addresses people who don't need to know about UML2 and don't have
>>>interest in implementational details.
>>>So I need to model relationships on a rather abstract level. For
>>>instance, another problem I face is the connection between a Transition
>>>of a StateMachine and a UseCase. That is, the Transition, as occuring in
>>>the course of a certain UseCase, should refer to this enclosing UseCase.
>>>Does anyone have an idea how to accomplish this without using rather
>>>implementational information (the exact operations triggering the
>>>Transition)?
>>>
>>>Thanks, Manuela
>>>
>>>
>>>
>>>James Bruck schrieb:
>>>
>>>>Hi Manuela,
>>>>
>>>>UseCases are BehavioredClassifiers. Behaviored classifiers allow you
>>>>to
>>>>add owned behaviors. Behaviors can have pre and post conditions.
>>>>A StateMachine is a Behavior and so is an OpaqueBehavior. So you can
>>>>create one or the other as your behavior depending on how you want to
>>>>specify the UseCase.
>>>>
>>>>Pre and post conditions are Constraints and a constraint has a context
>>>>which
>>>>is a namespace and a specification. A State is a namespace so you
>>>>should
>>>>be able to set the context of your constraint to a State but I don't
>>>>think
>>>>you can directly set the precondition to be the State itself.
>>>>
>>>>I hope this helps.
>>>>
>>>>- James.
>>>>
>>>>
>>>>
>>>>
>>>>"Manuela Rink" <manuela.rink@imagine-worlds.de> wrote in message
>>>>news:f89mc8$ohv$1@build.eclipse.org...
>>>>
>>>>
>>>>>Hello,
>>>>>
>>>>>I've got a model containing an use case, a class that is affected by
>>>>>the
>>>>>use case and a state machine that describes the states of the class.
>>>>>I want to set preconditions and postconditions of the use case which
>>>>>refer to the states defined in the state machine, i.e. (state A or
>>>>>state
>>>>>B) is the precondition and state C is the postcondition.
>>>>>Is there a way to model this in UML2 and what is it?
>>>>>
>>>>>Thanks,
>>>>>Manuela
>>>>
>>>>
>>>>
>>
>>
Previous Topic:Reference Updating
Next Topic:[Announce] MDT UML2 2.1.1 M200708011038 is available
Goto Forum:
  


Current Time: Fri Mar 29 15:13:07 GMT 2024

Powered by FUDForum. Page generated in 0.03470 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top