• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IBM ICE Test question #5

 
Yingtang Tang
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I continue the question postings of Ram Dhan Yadav K here. I am very confused about this question. Please offer your answer and understanding here. Thanks.
Q) A partial class diagram of a college course management application is shown in the exhibit. A student knows all of the instructors with whom s/he is registered with. Similarly, an instructor also knows all students who are registered with
him/her. A new requirement is added which specifies that an instructor can also be a student for some ourses. What is the BEST partial application redesign shown in the Figure as linked.
Single Select:
a) Design 'A'
b) Design 'B'
c) Design 'C'
d) Design 'D'
e) Design 'E'
 
Ram Dhan Yadav K
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tang,
In C, the Student and instructor are subclasses of Role. This is the best way of usage of inheritance.
Now a Candidate is associated to Role and that Role can be either student or Instructor or both from the association shown.
Hope this helps!
 
maya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it would have been less confusing if the subclasses (in C) -- Student and Instructor had been named StudentRole and InstructorRole respectively.
 
Craig Jackson
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe the answer is design (E). Because of polymophism and inheritance. And what I mean by that is that both the Student and the Instructor are subtypes of the base class Candidate... Therefore Student or Instructor "is a" Candidate.
But also keep in mind the question states a "student knows his/her instructors" and a "instructor knows his/her students" and now an instructor can be a student.
So we need an array or collection to store this information for each student-instructor(s) and instructor-students(s). But since Instructor and Student are Candidates the Array can be of type Candidate(SuperType).
So, Now we can can store those instructors that are also students.
So in my opinion I believe design (E) is the BEST partial application redesign.
 
Xyz Abx
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The partial class diagram indicates that a student can list his registered instructors and instructor can list his registered students.The new requirement indicates that instructor able to register for other courses, that means Instructor able to list his registered students and registered instructors. Is it correct, if yes how design 'C' & 'E' satify the above requirement. Please correct me if anything goes wrong.
 
Craig Jackson
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just wanted to elaborate more on why I chose design (E) instead of (C) or design (D) which is basically the same as (E).
I chose design (E) because it shows shared-aggregation(unfilled diamond) and design (D) does not.
The reason being is that the composite-whole(Role class) has an operation(getRegisteredCandidate()) that propagates to the aggregate element(Candidate class) and also because of shared-aggregation the aggregate-element(Candidate and any subtypes) does not have to depend on the composite-whole(Role class) for creation or deletion. And also the Candidate class can be referenced elsewhere in the design.
If there is anybody else with a different opinion or an alternate solution, please advise.
craig j.
 
garth schneider
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just about went along with craig on this. But "e" can not be correct. The role class does not identify any one. It also does not allow for multi roles. You are either a instructor or a student not both.
C appears to be right. It has a base candidate class that identifies the individual and has the ablitie to have many roles (arrays of students or instructors for each role).
 
Xyz Abx
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi cj jack,
can you please exaplain me, how design 'E' get the list of registered instructors for Instructor candiate, because instuctor can be register for other courses also, he wants to know what other instructors he registered. Can you also please exaplain me what wrong with design 'A'. Thanks in Advance.
CCR
 
Craig Jackson
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After searching the forum for this particular question, I have come to the conclusion that design (E) may not be the best answer. I now can see why design (C) would be the better design, finally. This is one of the harder questions for me to answer.
But hey, my original answer at least sounded good.
craig
 
Sangeeta Murthy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think everyone has agreed that C is the answer, but can anyone explain to me why it is not D ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic