Hi, I am new to VB.NET but an expert at VB6. I just wanted to check if I am still thinking in the correct way for defining a class instances parent/owner.
To further explain.
I do not mean inheritance, e.g. an Apple class inherits the properties of a Fruit class.
I mean I have a collection of Apples and for each apple in that collection I want it to know which Apples collection is its owner or parent.
Am I right in thinking you would still express this like so
Public Class Apples
public function Add() As Apple
'Code to add apple into collection
return new Apple(Parent:=me)
Public Class Apple
private m_MyParent As Apples
public readonly property Parent() As Apples
public sub New(byval Parent As Apples)
m_MyParent = Parent