|Re: OCL Context and UML Usage relationship [message #657511 is a reply to message #657485]
||Thu, 03 March 2011 05:52
| Ed Willink
Registered: July 2009
UML provides a (too) large set of facilities, but not large enough to
cover modeling of specifications in natural language. You must map your
terminology to UML or use UML terminology.
UML associations, particularly multi-way Association Classes can model
many different relationships, you name the association as the
relationship. However they cannot do everything, such as re-Classing and
you may need to introduce intermediate Role classes.
Saying that your ProductManager to Product relationship is not 1:1, 1:*
or *:* so you'll use a Usage seems to me rather like, 'I don't know what
the relationship is so I'll use something else'. I think you need to
work much harder on understanding the realtionship so that you can them
model it. If it's really vague/flexible, you may need to introduce a
polymorphic hierarchy of ProductManagement classes for each category of
The above is nothing to do with OCL or OCL contexts. Once you have a
UML model you can then add OCL to specify those aspects that cannot be
captured directly in UML.
On 02/03/2011 23:33, Eban Escott wrote:
> Hi Ed, thanks for getting back to me :) and yes, I am using UML2.
> The example I am working on is this:
> I have a Product class and a ProductManager class. The ProductManager
> uses the Product class and I want to write some OCL on the
> ProductManager class that references a Product. Having a manager for a
> corresponding domain model entities is standard practice for some
> software architectures.
> The relationship between the two classes is not a one-to-one,
> one-to-many, or many-to-many relationship like, for example, a
> one-to-many relationship between a Brand class and a Product class.
> So, I thought it would make more sense to use the UML2 usage as the
> ProductManager uses a Product.
> I guess I need to spend some more time understanding the ins and outs
> of the OCL context and what I can use where. In the meantime, should I
> just use an association instead?
> Hope all is well
Powered by FUDForum
. Page generated in 0.03374 seconds