File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes URLyBird: Use of intermediate interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "URLyBird: Use of intermediate interface" Watch "URLyBird: Use of intermediate interface" New topic
Author

URLyBird: Use of intermediate interface

Chris Popz
Greenhorn

Joined: Feb 19, 2007
Posts: 14
Hello Ranchers!

The spec states:

Your data access class must be called "Data.java", .... , and must implement the following interface: (DMMain)


Does anyone see a problem in using an intermediate interface (extending DBMain) as:

DBMain <--- SomeInterface <---- Data

Regards,

Chris
Maurizio Nagni
Ranch Hand

Joined: May 29, 2004
Posts: 75
I guess that because it will be an automatic software to perform the test of many of the "MUST" requirements, like locking, it will do something like

DBMain myServer = new Data();

that is it will use only the methods from the DBMain interface and so is better that the methods of the interface B implemented in Data are not vital for the life of the server. In this vision the various method that are implemented in DBMain server CAN call method of B without problem.

Ask yourself this:
Can I search/insert/delete/update records from the myServer object?
Chris Popz
Greenhorn

Joined: Feb 19, 2007
Posts: 14
How do you mean...?
Maurizio Nagni
Ranch Hand

Joined: May 29, 2004
Posts: 75
Hello,

please sorry if i reply late..... engulfed of job

I mean that they require you to implement the DBMain interface. At this point it does not matter how many interface your brand-new interface extends as long the class that will implement your interface could be threat like a DBMain.
A quick and dirty example:
suppose that your DbMain contain a method


then start to build your code



just to finish what they ask is easy: you MUST implement DBMain interface. Dot. That's all. This mean that if I have your JAR with your class HugeServer I can use it IN MY code as long you implement the DBMain interface (like we have done in the example implementing the HugeServer class).
Chris Popz
Greenhorn

Joined: Feb 19, 2007
Posts: 14
Okey, thanks mate!
The thing in the specification I was concerned about was wheter the word "implement" in:

Your data access class must be called "Data.java"...and must implement the following interface:

should be taken explicitly, meaning that I had to have: "Data implements DBMain", but as I understand it from your answers this is not the case... and my solution, where Data.java implicitly implements DBmain.java, is ok...

Thanks again!

Regards,
Chris
 
Don't get me started about those stupid light bulbs.
 
subject: URLyBird: Use of intermediate interface
 
It's not a secret anymore!