Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

OMG-OCUP2-FOUND100 Exam - Topic 6 Question 44 Discussion

Actual exam question for OMG's OMG-OCUP2-FOUND100 exam
Question #: 44
Topic #: 6
[All OMG-OCUP2-FOUND100 Questions]

Choose the correct answer:

Consider the following diagram:

Which change could the modeler make to fix the UML error in this model?

Show Suggested Answer Hide Answer
Suggested Answer: B

In the UML diagram given, we see two classes, ClassA and ClassB, with ClassB inheriting from ClassA. ClassA has two attributes, position of type Integer and description of type String. ClassB introduces an additional attribute, version of type Real.

Looking at the instance specifications (the right part of the diagram), we have three instances: a1 of type ClassA, b1 of type ClassB, and b2 also of type ClassB.

In UML, an instance specification must comply with the structure of its classifier, which means an instance of ClassA must show slots for both position and description, whereas an instance of ClassB must show slots for position, description, and version.

In the provided diagram, instance a1 of ClassA only shows a slot for position. This is an error because it does not show a slot for description, which is a defined attribute of ClassA. To correct this error, we would need to add a description slot to a1.

This means that the correct answer is:

B . Add a description slot to a1.

The other options do not correct the error in the model:

A) Specifying unique values for position does not address the missing description slot in a1. C) Changing the type of ClassB.version from Real to Integer is not required by any UML constraint in the context given. D) Changing the type of ClassA.position from Integer to Real does not address the missing description slot in a1 and is unrelated to the inheritance structure.


Contribute your Thoughts:

0/2000 characters
Rana
3 days ago
I remember something about unique values being important in UML, so maybe A is the right choice?
upvoted 0 times
...

Save Cancel