Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Interface speci...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 5749 of 5874
Post > Topic >>

Interface specification in Ada

by Dennis Hoppe <dennis.hoppe@[EMAIL PROTECTED] > Jun 11, 2008 at 02:46 PM

Hi,

my preferred programming language is Java and I'm used to declare in an 
interface some common methods, that all subcl***** have to implement. 
For example:

interface Bicycle {
   void changeCadence(int newValue);
   void changeGear(int newValue);
   void speedUp(int increment);
   void applyBrakes(int decrement);
}

class RacingBicycle implements Bicycle {
    // remainder of this class implemented as before
}

If I accidentially implement RacingBicycle without providing the four 
methods mentioned above, the compiler would draw attention to this 
situation.

In Ada, i found the keyword "interface" only in the context of multiple 
inheritance. The usage would be:

package Bicycle is
    type Object is interface;

    procedure changeCadence (newValue : in Integer) is abstract;
    procedure changeGear (newValue : in Integer) is abstract;
    procedure speedUp (increment : in Integer) is abstract;
    procedure applyBrakes (decrement : in Integer) is abstract;
end Bicycle;


with Bicycle;

package RacingBicycle is

    type Object is new Bicycle.Object with null record;

    -- omitted needed procedures to raise an error
end RacingBicycle;


Unfortunately, the build process runs through without any errors. In 
this case, I want the compiler to notify me about missing procedure 
implementations, because they are declared abstract in the interface.

I think, I missed something in the hierarchy, but I don't see it.


Thank you in advance,
   Dennis Hoppe
 




 6 Posts in Topic:
Interface specification in Ada
Dennis Hoppe <dennis.h  2008-06-11 14:46:38 
Re: Interface specification in Ada
christoph.grein@[EMAIL PR  2008-06-11 06:04:41 
Re: Interface specification in Ada
Georg Bauhaus <rm.dash  2008-06-11 17:02:48 
Re: Interface specification in Ada
Robert A Duff <bobduff  2008-06-11 12:34:11 
Re: Interface specification in Ada
Dennis Hoppe <dennis.h  2008-06-11 23:23:00 
Re: Interface specification in Ada
Georg Bauhaus <rm.tsoh  2008-06-12 10:37:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Aug 27 21:04:44 CDT 2008.