Objects by Design Forums
Show 15 posts from this thread on one page

Objects by Design Forums (http://forums.objectsbydesign.com/index.php)
- UML Certification Review Questions (http://forums.objectsbydesign.com/forumdisplay.php?forumid=18)
-- sequence diagrams 101 (http://forums.objectsbydesign.com/showthread.php?threadid=223)

Posted by SZ on 03-20-2002 04:16 AM:

sequence diagrams 101

Here is a nice simple question on sequence diagrams:

44) Refer to the exhibits to answer the question.

What are the names of missing classes XXX and YYY in the sequence diagram?

a) XXX = DeliverySchedule, YYY = Supplier

b) XXX = Supplier, YYY = DeliverySchedule

c) XXX = PreferredSupplier, YYY = DeliverySchedule

d) XXX = DeliverySchedule, XXX = PreferredSupplier

Single Select - Please select the best answer (one and only one choice must be selected).


If you look at the class diagram (attached) you can see that InventoryProduct has an association with Supplier. Therefore, the proper class for XXX is Supplier. The same rule of visibility applies to Supplier and DeliverySchedule so that the class for YYY is DeliverySchedule.

So what's wrong with this relatively simple example? In particular I find it odd that Product is not listed as a class on the class diagram, especially since it figures into the solution so directly. I don't think that they meant InventoryProduct because the signature for the nextDeliveryFor methods is pretty specific about giving the parameter type as Product.

Also, a minor issue is that Purchasable seems like it should have been an interface, especially since a realization association is used. The example uses a class instead of an interface, which would be more accurate.

Posted by homeyz63 on 03-20-2002 02:02 PM:

I agree with you that the answer should be (B).
But I would like to pose another question to the
forum, and this applies to your statement about
why the Product Class is not shown on the class
diagram. The question would be if we had to modify
the class diagram to show the Product class where
would it go? I believe the naming of the Purchasable
class could be an error and should have been defined
as a <<interface>> Product. If not, what other alternatives
will work or a determination cannot be made because of
insufficient information.
What do you think.

Posted by SZ on 03-22-2002 04:01 AM:

I'm not sure why InventoryProduct isn't simply called Product. That would seem to solve this problem.

You see, a UML class diagram by itself is insufficient. You have to understand the requirements and use cases thoroughly in order to create an abstraction for a Product class, which more specific classes, such as InventoryProduct, could derive.

Lacking this knowledge in the current example, it is far better to keep it simple and just deal with a Product class.

All times are GMT. The time now is 03:21 AM.
Show 15 posts from this thread on one page

Powered by: vBulletin Version 2.3.5
Copyright © Jelsoft Enterprises Limited 2000 - 2018.
Copyright 1999-2005, Objects by Design, Inc.