Home All Groups Group Topic Archive Search About

vb.net aggregation question

Author
27 Aug 2006 12:53 PM
ninjutsu28
hi im juz a student so pls bear with my terminologies..juz wana ask how
to perform aggregation in vb.net code..
in my model, i have rectangle, shape, drawing classes..rectangle class
inherits shape class (is - a relationship), and drawing class has shape
class(aggregation)
Shape Class:
           Public MustInherit Class CShape

Rectangle Class:
             Public Class CRectangle
                          Inherits CShape

Drawing Class:
            public class CDrawing
               ?????????????????

wat im tryin to do is aggregation, to show drawing class has
shapes..and i dont know how to perform it in code.. i kinda assume that
shape class cant be instantiated coz its the base class(not sure)..
any help will be really appreciated..cheers!

Author
27 Aug 2006 2:40 PM
Heikki Leivo
> wat im tryin to do is aggregation, to show drawing class has
> shapes..

There are many ways, for example

Public Readonly Property Shapes() As List(Of Shape)...
Public Property Shapes() As Shape()
Public Readonly Property Shapes() as Collection
Public Readonly Property Shapes() as System.Array

or whatever. Just like mentioning that "person has money" does not imply
where and how the money is stored (on bank account, cash in wallet, cheque,
whatever)

-h-