Yep that is right... I added mine right in the Data class... I believe others have put it in their local and remote classes, but it is the same code for both, which is why I just added it to my Data class. I would be interested to hear if others did it differently.
Hi Nate, I actually diverged somewhat from the instructions and neither modified nor extended the Data class. Instead I created composites using the Builder Pattern. I created an interface called DataSearch which contained one method: criteriaFind. So remote and local composites had a reference to a DataSearch implementation. Doing it this way makes it easy to add more robust searching facilities in the future without breaking any existing clients. Michael Morris
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Hi Michael, Will you be penalized for this by trying to divert from the instructions. The instructions says
You may do this by modification or subclassing, but you should document the approach and reason for your choice.
Joined: Jan 30, 2002
Hi Amish, I guess not. I made a 154 losing only one point on documentation. That tells me that the examiner agreed with my argument that composition is a better overall design scheme than either inheritance which can cause you to get locked in to an inflexible static design or modification which risks the introduction of bugs into working code. So the moral is if you firmly believe you have a better solution and can sell that solution then go for it. Michael Morris