Re: Ensuring a method exists
- From: "Javier" <javuchi@xxxxxxxxx>
- Date: 28 Sep 2006 05:28:53 -0700
Pascal Costanza ha escrito:
In Java, interfaces are only necessary to make the static type system
happy. When different classes offer similar functionality and you want
to use their instances in the same place, they have to have the same
type. So either, they are derived from the same common superclass, one
is derived from the other, or they implement the same interface.
Interface types are more flexible than class types because the former
are not restricted to single inheritance. If Java classes would support
multiple inheritance, interfaces would not be necessary, but abstract
classes would be sufficient (like in C++).
Since Common Lisp is dynamically typed, you don't have to worry about
all these things. When different classes offer functionality and you
want to use their instances in the same place, you ... just use them.
Thanks Pascal. Let see if I understand it, I'll give up you an example:
For example you develop a sound application, like Cubase. Cubase uses
VST, which is an especification of abstract classes in C++. Basically,
the devolper enforces you to write a series of methods to ensure that
your plugin will work correctly in the entire system. A similar issue
happens with Java Sound.
What I don't understand from your answer is that interfaces (and
abstract classes) are something that only strongly typed languages
need. I understand that an interface is a void framework of methods
primaly, independetly of the data type of their methods or fields. How
would a CLOS programmer would enforce other users to develop plugins
for their application without an abstract class or interface? (just
asking).
.
- Follow-Ups:
- Re: Ensuring a method exists
- From: Pascal Costanza
- Re: Ensuring a method exists
- References:
- [CLOS] Ensuring a method exists
- From: Didier Verna
- Re: [CLOS] Ensuring a method exists
- From: Lars Rune Nøstdal
- Re: [CLOS] Ensuring a method exists
- From: Didier Verna
- Re: [CLOS] Ensuring a method exists
- From: Ken Tilton
- Re: [CLOS] Ensuring a method exists
- From: Christophe Rhodes
- Re: [CLOS] Ensuring a method exists
- From: Ken Tilton
- Re: [CLOS] Ensuring a method exists
- From: Pascal Costanza
- Re: [CLOS] Ensuring a method exists
- From: Ken Tilton
- Re: [CLOS] Ensuring a method exists
- From: Pascal Costanza
- Re: Ensuring a method exists
- From: Javier
- Re: Ensuring a method exists
- From: Pascal Costanza
- [CLOS] Ensuring a method exists
- Prev by Date: Re: Ensuring a method exists
- Next by Date: Re: Aha! moments
- Previous by thread: Re: Ensuring a method exists
- Next by thread: Re: Ensuring a method exists
- Index(es):
Relevant Pages
|
|