Subject: [netmod] Augmenting vs. Sub-classing WAS:RE: when statement

From: "Ersue, Mehmet (NSN - DE/Munich)" <[email-masked]>
Date: Mon, 18 Aug 2008 13:02:21 +0200

Hi Lada, 
 
we need to differentiate between augmenting data 
nodes which have been advertized and OO sub-classing, 
i.e. inheriting types. 

In case of augmenting data nodes in module A, module 
A must be advertised. 
Enhancing a data node tree without supporting it does 
not make much sense. 

In case you just use a type X from module A or even 
inherit type Y from type X advertizing is not needed. 
It becomes apparent that a type is supported when 
it is used inside an advertized data node tree. 
When using a type it should not matter whether a 
type extends any other type or not. 

There is also a general difference between augmentations 
and inheritance. In the latter case if we derive type Y from 
type X, X and Y are literally different types. 

Also, if I derive a class fooChild from foo, all instances 
of the foo class remain the same. fooChild and foo
generate different type of instances although the actions 
and data have been derived and are reused.

In that sense inheritance is a clear language feature
without ambiguities and supports simple model extension.
	  
Cheers, 
Mehmet 

	> > 
	> > > -----Original Message----- 
	> > > From: [email-masked] 
	> > > [mailto:[email-masked] <mailto:[email-masked]> ] On Behalf Of ext Ladislav Lhotka 
	> > > Sent: Thursday, August 07, 2008 11:51 AM 
	> > > To: Balazs Lengyel 
	> > > Cc: NETMOD Working Group 
	> > > Subject: Re: [netmod] when statement 
	> > > 
	> > > Balazs Lengyel píše v Čt 07. 08. 2008 v 10:51 +0200: 
	> > > 
	> > > > > 
	> > > > > Back to OOP - it you define an instance of a class, you 
	> > > don't specify it 
	> > > > > together with all its superclasses. My box just uses a 
	> > > data model that 
	> > > > > is derived from another one - and that should be 
	> > specified in the 
	> > > > > derived data model. 
	> > > > > 
	> > > > This example IMHO has nothing to do with OO. 
	> > > > 
	> > > > You have a container with a lump of data in module A. The 
	> > > in module B you augment it with a 
	> > > > second lump of data. If your node does not 
	> > > advertise/implement module A, what are you 
	> > > > augmenting actually? 
	> > > > So if you augment something in module A, you MUST 
	> > > implement/advertise module A. 
	> > > 
	> > > But I think it is an exact analogy with subclassing: I 
	> > advertise just 
	> > > module B, which in turn declares that it is derived from 
	> > module A. So 
	> > > naturally the device has to implement everything that is in the 
	> > > "superclass" module A PLUS the changes from B. 
	> > > 
	> > > But maybe our Nokia-Siemens friends could speak up and 
	> > formulate their 
	> > > OO proposals, it may help clarify this. 
	> > > 
	> > > Lada 
	> > > 
	> > > -- 
	> > > Ladislav Lhotka, CESNET 
	> > > PGP Key ID: E74E8C0C 
	> > > 
	> > > _______________________________________________ 
	> > > netmod mailing list 
	> > > [email-masked] 
	> > > https://www.ietf.org/mailman/listinfo/netmod <https://www.ietf.org/mailman/listinfo/netmod>  
	> > > 
	> > 
	> 

_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod

---

From: Phil Shafer <[email-masked]>
Date: Mon, 18 Aug 2008 13:27:45 -0400

>and data have been derived and are reused.

If you only wish to derive fooChild from foo, you can just use foo
inside fooChild:

   grouping foo {
       leaf neat-stuff { ... }
   }

   grouping fooChild {
       use foo;
       leaf child-stuff { ... }
   }

This will leave all original uses of foo untouched, protecting them
in a way augmented grouping does not.

Thanks,
 Phil