August 22, 2003
In article <bi5bge$13nv$4@digitaldaemon.com>, Mike Wynn says...
>"DeadCow" <deadcow-remove-this@free.fr> wrote in message
>>
>> Here is my point of view:
>>
>> - an abstract method is a "not implemented" method.
>> - an abstract class is a "not concrete" class. Something you can derive
from
>> but that you cant instanciate.
>> - a class with an abstract method become abstract too.
>> - there is no reason for a method to be abstract because its class is
>> abstract.
>>
>100% agree (Java abstract semantics).

Me too.


August 24, 2003
>
> Of course not. Here is my point of view:
>
> - an abstract method is a "not implemented" method.
> - an abstract class is a "not concrete" class. Something you can derive
from
> but that you cant instanciate.
> - a class with an abstract method become abstract too.
> - there is no reason for a method to be abstract because its class is
> abstract.
>

I agree. Abstract should be a non-instantiation modifier, not no-implementation.

Lars Ivar Igesund


August 24, 2003
I agree

"Lars Ivar Igesund" <larsivi@stud.ntnu.no> wrote in message news:bia0op$28bb$1@digitaldaemon.com...
> >
> > Of course not. Here is my point of view:
> >
> > - an abstract method is a "not implemented" method.
> > - an abstract class is a "not concrete" class. Something you can derive
> from
> > but that you cant instanciate.
> > - a class with an abstract method become abstract too.
> > - there is no reason for a method to be abstract because its class is
> > abstract.
> >
>
> I agree. Abstract should be a non-instantiation modifier, not no-implementation.
>
> Lars Ivar Igesund
>
>


August 25, 2003
"Matthew Wilson" <dmd@synesis.com.au> a écrit dans le message news: bia57h$2eu0$1@digitaldaemon.com...
> I agree

Is Walter agree too ?
Can we hope it changed by DMD 0.71 ?

-- Nicolas Repiquet


August 31, 2003
"DeadCow" <deadcow-remove-this@free.fr> wrote in message news:bida9d$14p9$1@digitaldaemon.com...
>
> "Matthew Wilson" <dmd@synesis.com.au> a écrit dans le message news: bia57h$2eu0$1@digitaldaemon.com...
> > I agree
>
> Is Walter agree too ?
> Can we hope it changed by DMD 0.71 ?

Y'all are right. I'll fix it.


September 01, 2003
Lars Ivar Igesund wrote:

> I agree. Abstract should be a non-instantiation modifier, not
> no-implementation.

Then what is it good for, since abstract is also implicit when some function is not defined, and also means the class is not instantiatable?

-eye

September 01, 2003
"Ilya Minkov" <midiclub@8ung.at> wrote:
> Lars Ivar Igesund wrote:
>
> > I agree. Abstract should be a non-instantiation modifier, not no-implementation.
>
> Then what is it good for, since abstract is also implicit when some function is not defined, and also means the class is not instantiatable?
>

I got used to the 'abstract' keyword in Java. There it means just what I said above. Anyway;

A method don't have to be implemented, in which case it must be abstract (or part of an interface). Since an instantiatable class needs all it's methods to be implemented, a class with an abstract method must be abstract.

If all methods are implemented, the class can still be abstract. This typically happens when you need a base class with lots of functionality which is inherited into several subclasses, but it doesn't make sense to instantiate an instance of the baseclass itself.

Possible example:
A scenegraph library where there is a base node. If this scenegraph
use reference counting, the nodes will have ref() and unref() methods
that will use the same implementation for all subclasses. Thus they
are best implemented in the BaseNode class, but you don't want to
instantiate it since it don't have any useful functionality. You don't want
it as an interface either, since it then must be implemented in the
subclasses.

Lars Ivar


September 01, 2003
"Lars Ivar Igesund" <larsivi@stud.ntnu.no> wrote in message
news:bj08cm$2fl6$1@digitaldaemon.com...
|
| ...
| If all methods are implemented, the class can still be abstract. This
| typically happens when you need a base class with lots of functionality
| which is inherited into several subclasses, but it doesn't make sense to
| instantiate an instance of the baseclass itself.
| ...

I agree with that use of abstract (that's what I first expected), but if that gets into the language, what would be the difference between these two?

abstract class A {
    void foo();
    int bar(char []);
}

interface B {
    void foo();
    int bar(char []);
}

And I mean in a pure non-implementation sense. I mean, I don't know about vtables and such, so don't go that way. (I might be missing something, but I still want to know)

————————————————————————— Carlos Santander


---

Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.514 / Virus Database: 312 - Release Date: 2003-08-28


September 01, 2003
"Carlos Santander B." <carlos8294@msn.com> a écrit dans le message news: bj0e0h$2n9r$2@digitaldaemon.com...

> I agree with that use of abstract (that's what I first expected), but if that gets into the language, what would be the difference between these
two?
> [snip]
> And I mean in a pure non-implementation sense. I mean, I don't know about
> vtables and such, so don't go that way. (I might be missing something, but
I
> still want to know)

Well, I think its just an OO design difference. B extends A means A *is a* B. B implements A means A *can act like a* B.

-- Nicolas Repiquet


September 02, 2003
>
> I agree with that use of abstract (that's what I first expected), but if that gets into the language, what would be the difference between these
two?
>
> abstract class A {
>     void foo();
>     int bar(char []);
> }
>
> interface B {
>     void foo();
>     int bar(char []);
> }
>
> And I mean in a pure non-implementation sense. I mean, I don't know about vtables and such, so don't go that way. (I might be missing something, but
I
> still want to know)
>

As it, IMO, there are no differences between the abstract class and the interface but there will be difference if you want data member or MI.

- You can derives from multiples interface but only one class (abstract or
not).
- An interface cannot have any data member but an abstract class can.
- An abstract class will probably allows to define member functions as
mentionned elsewhere.

So the main difference would be the intended use. An abstract class
might serve as the base class of a class hierarchy and offer some services
to derives classes. An interface only declare function that need to be
implemented to support it...