I'm playing around with composition of a couple of objects.
I have two classes (Note and task). The Task class is derived from the Note class as a task is an extented note.
Each note has a property Property Child as list (of note)
as a note or task could be added to an existing note or task (Therefore this 'child' note could be a task or a note)
ie.
dim x as new note()
x.Child.item(0).Child.item(0).Child.item(0).description.ToString()
the final child note object is actually a task, how can i make this aggregation work? i don't care if its a note or a task but I would like to release the functionality of the base or the extended class.
My immediate thoughts were that each object needs to have a list of tasks and a list of notes but it feels like there could be a more elegant solution.
Does anybody have any thoughts on this?