• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

URLyBird: Use of intermediate interface

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do you mean...?
 
Maurizio Nagni
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic