Progress.Lang.Object vs System.Object peculiarities...

Posted by Lieven De Foor on 04-Mar-2015 09:58

I've noticed a couple of peculiarities I would like to get peoples opinions on.

First is this:

I'm trying to add a Equals method to an interface and at compilation I'm getting the error:

    Attempt to override method 'Equals' in class 'Progress.Lang.Object', but OVERRIDE was not specified. (13000)

This is an interface, not a class.

Why do I have to specify override? This doesn't seem to be necessary in c# or java...

Second:

Progress has engineered the .NET bridge in such a way that System.Object is (or seems to be) derived from Progress.Lang.Object.

Then how come System.Object isn't exposing the Equals method with a Progress.Lang.Object as parameter, but only as System.Object?

All Replies

Posted by Peter Judge on 04-Mar-2015 10:08

The former sounds buggy to me.  Is it just Equals() or any other the methods in P.L.O, like ToString() or Clone()?
 
-- peter
 
[collapse]
From: Lieven De Foor [mailto:bounce-lievendefoormipsbe@community.progress.com]
Sent: Wednesday, 04 March, 2015 10:59
To: TU.OE.Development@community.progress.com
Subject: [Technical Users - OE Development] Progress.Lang.Object vs System.Object peculiarities...
 
Thread created by Lieven De Foor

I've noticed a couple of peculiarities I would like to get peoples opinions on.

First is this:

I'm trying to add a Equals method to an interface and at compilation I'm getting the error:

    Attempt to override method 'Equals' in class 'Progress.Lang.Object', but OVERRIDE was not specified. (13000)

This is an interface, not a class.

Why do I have to specify override? This doesn't seem to be necessary in c# or java...

Second:

Progress has engineered the .NET bridge in such a way that System.Object is (or seems to be) derived from Progress.Lang.Object.

Then how come System.Object isn't exposing the Equals method with a Progress.Lang.Object as parameter, but only as System.Object?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Lieven De Foor on 04-Mar-2015 10:12

Same behavior for ToString() and Clone()...

Posted by Laura Stern on 04-Mar-2015 10:15

Re 1st question:  It is not strictly necessary for the compiler to complain about this in an Interface definition.  But ultimately, any class that uses this must implement this method.  And then they will get the error anyway that OVERRIDE must be specified.  So we just give the error sooner rather than later.

Re 2nd question:  Yes, we've engineered things so that all objects, including .NET ones inherit from Progress.Lang.Object (or act like they do).   Yes, strictly speaking you are correct.  The .NET object should have two Equals methods, one that takes a System.Object and one that takes a Progress.Lang.Object.  If they pass a System.Object we should call .NET.  If they pass a Progress.Lang.Object we should call our own AVM routine.  So I guess it's a bug, but I don't really see the use case for this.  And I'm not sure the latter case would really do the right thing (would have to think about that some more).

Posted by Lieven De Foor on 04-Mar-2015 10:22

Thanks Laura, it's this kind of technical information that gives some insight in how things are implemented behind the scenes.

I don't consider any of these a bug by the way...

Posted by Laura Stern on 04-Mar-2015 10:25

That's good :-)

This thread is closed