This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
First thank you all for making this place such a nice place for SCEA, I completed part 1 with 93% , this forum was my starting place for the prep, I had downloaded part 2 and I have a doubt in the same.
Assuming I have an object called Account, and a Customer that has to be linked to this account. A customer can be Primary Account holder, Secondary Account holder or even a proxy.
The issue I face here is, Initially I thought of having a Customer Object and creating a 1 to * relation with Account , but then uml does not clearly state the complete requirement, also I am not sure if I should create individual objects for Primary Account holder, or a Proxy in UML as a Proxy can be Primary Account holder for a different account. Please help me with your ideas on how a UML can be drawn for this requirement
Considering the policy of this forum, I am not quoting actual exam content , but framing my question using a different object model.
This shows a many to 1 relationship with Customer and Account. i.e An account can have reference to three accountholders differs in roles(Primary, Secondary and Proxy). But from customer perspective I believe there wont be any need to find 'for which account this customer acts as a secondary or proxy holder'.
Based on the above assumption, define a many to one relationship between Customer and Account. And Customer has composition aggregation with Role interface. Define three classes (Primary Holder, Secondary Holder and Proxy) that implements Role interface. Customer class has reference to Role interface (one to one). The operations defined at Customer class should be delegated to Role interface.