Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird: Use of intermediate interface

 
Chris Popz
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you mean...?
 
Maurizio Nagni
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic