CN2003 Software Analysis and Design |
Examination Advice | |
CN2003 Home - Examination Advice - Question 5 - Answer 5 | |
|
Quick Links
Question
»
Questions
|
First, it is important to remember to answer each part of the question. Make it clear which part of the question you are answering by using the question parts indicated (a, b and c). It is useful to start each part of your answer on a new page, allowing you to add extra detail after your initial answer. A possible class model is shown in the attached diagram. A possible sequence diagram is shown in the attached drawing. Message passthrough is where an object receives a message and simply relays the message onto another object without further processing. Message passthrough is generally regarded as bad, as it increases the interaction coupling of a class model and can make reuse more difficult. However, in some circumstances it is possible that message passthrough is good, for example, where an object is an aggregation of other objects and simply relays a message onto to those objects which create it. Looking at the sequence diagram in part b of this question, you can see it occurs with checkCredit between Handset, User and Subscriber and with updateBalance between the control object, User and Subscriber. Although aggregation is not involved here, the message passthrough is acceptable. This is because when credit is being checked, for example, a Handset only knows its User (the association on the class diagram is only between Handset and User and not Handset and Subcriber). Therefore the Handset would not know which Subscriber to 'ask' to check the credit. One way around this would be to supply the subscriber-id when a call is made so that the Handset object would know which Subscriber's credit to check. |
Quick Tips |
||
|
||||
|