SCJP 5.0 | SCWCD 1.4 <br /> <br />If you don't know where you are going, any road will take you there!
if who i am is what i have, and what i have is lost, then who am i?<br /> <br />SCJP 5.0<br />SCWCD 1.4<br />SCBCD preparing
SCJP 5.0 | SCWCD 1.4 <br /> <br />If you don't know where you are going, any road will take you there!
if who i am is what i have, and what i have is lost, then who am i?<br /> <br />SCJP 5.0<br />SCWCD 1.4<br />SCBCD preparing
SCJP 5.0 | SCWCD 1.4 <br /> <br />If you don't know where you are going, any road will take you there!
Matt
Inquisition: open-source mock exam simulator for SCJP and SCWCD
More generally, does anybody else find these object-oriented definitions questions really hard, or is it just me?
all events occur in real time
Originally posted by Burkhard Hassel:
I don't find them hard, but this one is again an example of a really silly, bad and totally ambigous question, that cannot be properly answered at all.
Where is this question from?
Matt
Inquisition: open-source mock exam simulator for SCJP and SCWCD
I just hope the ones on the real SCJP exam are better!
all events occur in real time
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Originally posted by Bert Bates:
I do think that the question in question is fairly representative of what you'll find on the real exam.
Matt
Inquisition: open-source mock exam simulator for SCJP and SCWCD
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Matt
Inquisition: open-source mock exam simulator for SCJP and SCWCD
We're going to admit it up front. The Sun exam's definitions for cohesion and coupling are somewhat subjective, so what we discuss in this chapter is from the perspective of the exam, and by no means The One True Word on these two OO design principles.
Tight coupling is generally a bad thing - it means that classes know more about each other than they need to or should. It's fairly defensible to say that a House class would reasonably "have-a" Roof object, so this wouldn't be considered tight coupling - House does know about Roof because it "has" a roof, but it seems natural - so A is incorrect.
I guess D is related to A - the idea being that the existence of a "reasonable has-a" doesn't create tight coupling - reasonable of course being subjective. On the real exam we tried to make up "reasonable" real-world examples.
K&B elsewhere say that "coupling refers to the degree to which one class knows about or use members of another class", and that "loose coupling describes a situation in which classes know only about each other's APIs". I'm not sure, then, how that fits in with the explanation.
Further, just knowing that "House has-a Door" tells us very little about how a House uses its Door -- it's entirely possible that House fiddles with Door's public doorKnob field rather than using get/setDoorKnob...or not, we don't know.
Finally E - i suppose this one's debatable too - the admittedly subjective argument is that in the real world it's reasonable that a House object would have an address property, and that having an address property wouldn't hurt the House classes cohesiveness.
all events occur in real time
Straws are for suckers. Now suck on this tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|