File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes missing criteriaFind method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "missing criteriaFind method" Watch "missing criteriaFind method" New topic

missing criteriaFind method

Manish Kumar
Ranch Hand

Joined: Apr 15, 2002
Posts: 53
Data class which i have got does not contain the criteriaFind method like lock() and unlock().
Is it same with all of you??
please reply.
Nate Johnson
Ranch Hand

Joined: May 13, 2002
Posts: 301
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.

scwcd, scjd, scjp<br /><a href="" target="_blank" rel="nofollow"></a><br /><a href="" target="_blank" rel="nofollow"></a>
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
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
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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.
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
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
I agree. Here's the link:
subject: missing criteriaFind method
It's not a secret anymore!