comp.lang.ada
 help / color / mirror / Atom feed
* Java interfaces -> ADA
@ 1999-04-19  0:00 Emmanuel.Leguy
  1999-04-19  0:00 ` bob
  0 siblings, 1 reply; 4+ messages in thread
From: Emmanuel.Leguy @ 1999-04-19  0:00 UTC (permalink / raw)


Hello,

Into which ADA feature an Java interface can be translate?

For example, how can I translate this Java code:

public interface Bricoleur {
...
}

public interface Cuisinier {
...
}

public interface Jardinier {
...
}

public class Personne {
...
} 

public class Personne_a_tout_faire extends Personne
                implements Bricoleur, Cuisinier, Jardinier {
...
}

Thanx


Emmanuel Leguy.
--
Laboratoire d'Informatique Fondamentale de Lille (LIFL)
Universite des Sciences et Technologies de Lille
Batiment M3 Cite Scientifique
59655 Villeneuve d'Ascq Cedex
FRANCE
tel: 03 20 33 63 38
fax: 03 20 43 65 66
mailto:Emmanuel.Leguy@lifl.fr
http://www.lifl.fr




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Java interfaces -> ADA
  1999-04-19  0:00 Java interfaces -> ADA Emmanuel.Leguy
@ 1999-04-19  0:00 ` bob
  1999-04-19  0:00   ` Emmanuel.Leguy
  0 siblings, 1 reply; 4+ messages in thread
From: bob @ 1999-04-19  0:00 UTC (permalink / raw)


In article <371AE830.4D8@lifl.fr>, "Emmanuel.Leguy" says...
>
>Hello,
>
>Into which ADA feature an Java interface can be translate?
>
 
I guess since an interface says simply that a class that implements it
needs to supply those methods, then in Ada, you would have a number
of abstract methods for the tag record, and then any one who
extends this record, will need to implement those methods since they
are abstract.

a Java interface is also sort of like a C++ class where its methods
are all pure virtual (ie foo() = 0; ) since any class that inherits
that class, will have to implement those methods also.

I think the java interface class is a nicer way of expressing this idea,
and it seems cleaner also. but this is just an opinion.


bob





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Java interfaces -> ADA
  1999-04-19  0:00 ` bob
@ 1999-04-19  0:00   ` Emmanuel.Leguy
  1999-04-19  0:00     ` Tucker Taft
  0 siblings, 1 reply; 4+ messages in thread
From: Emmanuel.Leguy @ 1999-04-19  0:00 UTC (permalink / raw)
  To: bob@

bob@ wrote:
> I guess since an interface says simply that a class that implements it
> needs to supply those methods, then in Ada, you would have a number
> of abstract methods for the tag record, and then any one who
> extends this record, will need to implement those methods since they
> are abstract.
> 
But a java class can inherit more than one interface... The multiple
inheritance is not permit in ADA.

--
Laboratoire d'Informatique Fondamentale de Lille (LIFL)
Universite des Sciences et Technologies de Lille
Batiment M3 Cite Scientifique
59655 Villeneuve d'Ascq Cedex
FRANCE
tel: 03 20 33 63 38
fax: 03 20 43 65 66
mailto:Emmanuel.Leguy@lifl.fr
http://www.lifl.fr




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Java interfaces -> ADA
  1999-04-19  0:00   ` Emmanuel.Leguy
@ 1999-04-19  0:00     ` Tucker Taft
  0 siblings, 0 replies; 4+ messages in thread
From: Tucker Taft @ 1999-04-19  0:00 UTC (permalink / raw)


Emmanuel.Leguy (leguy@lifl.fr) wrote:

: > I guess since an interface says simply that a class that implements it
: > needs to supply those methods, then in Ada, you would have a number
: > of abstract methods for the tag record, and then any one who
: > extends this record, will need to implement those methods since they
: > are abstract.
: > 
: But a java class can inherit more than one interface... The multiple
: inheritance is not permit in ADA.

Ada 95 supports multiple inheritance through a number of building
block mechanisms, including generic "mix-ins" and through the
use of access discriminants.  You are correct that there is no specific
syntax for multiple inheritance, but there are a number of
flexible mechanisms that allow type multi-hierarchies to
be supported.

In our mapping of Ada to/from Java, we use components to implement
Java interfaces.  See http://www.averstar.com/~stt/adajava_paper/
In this case, the compiler helps out by providing a Convention
"Java_Interface."  However, much the same thing can be accomplished
using components each with an access discriminant default initialized
to refer to the enclosing object.  A paper I wrote discussing this approach 
to multiple inheritance is on http://www.adahome.com, I believe.

: --
: Laboratoire d'Informatique Fondamentale de Lille (LIFL)
: Universite des Sciences et Technologies de Lille
: Batiment M3 Cite Scientifique
: 59655 Villeneuve d'Ascq Cedex
: FRANCE
: tel: 03 20 33 63 38
: fax: 03 20 43 65 66
: mailto:Emmanuel.Leguy@lifl.fr
: http://www.lifl.fr

--
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-04-19  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-19  0:00 Java interfaces -> ADA Emmanuel.Leguy
1999-04-19  0:00 ` bob
1999-04-19  0:00   ` Emmanuel.Leguy
1999-04-19  0:00     ` Tucker Taft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox