Oberon Community Platform Forum
September 25, 2017, 09:06:25 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Inheritance  (Read 3327 times)
danp
Newbie
*
Posts: 37


« on: May 28, 2008, 06:22:19 PM »

Hello,

I have an object that extends System.Xml.XmlDocument that works fine:

module Util;
type {public, ref} RecordSet = object (data : XmlElement) implements XmlDocument

but I should like to extend it again in another module like this:

module Db;
type {public, ref} RecordSet = object (data : XmlElement) implements Util.RecordSet

and this is not valid. How can I manage that? There is a confusing sentence in section 10.2.1 of the Language Report: "If an object B refines an object A, then B is said to be derived from A". Could an object refines another object? Only definitions could be refined.

Thanks,
Dan
« Last Edit: May 28, 2008, 06:36:00 PM by danp » Logged
rmitin
Moderator
Newbie
*****
Posts: 22


« Reply #1 on: June 03, 2008, 04:06:48 PM »

Hi Dan,

only definitions can be refined. Objects in Zonnon are what sealed objects in C# or final objects in Java. If you want to refine it later you need to create a pair definition + implementation, then refine it and then create two (sealed/final) objects when which you will actually use.

Roman
Logged
danp
Newbie
*
Posts: 37


« Reply #2 on: June 06, 2008, 10:36:50 PM »

Hi Roman,

I have understood the Zonnon internal definition + implementation mechanism which is great, but how can I resolve my case? As I could intend, the .Net class is considered as a default implementation, and it could be extended only by the object witch implements it. But is frustrating to not be able to extend it more.

Thank you,
Dan
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!