vb.net aggregation question

  • Thread starter Thread starter ninjutsu28
  • Start date Start date
N

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!
 
wat im tryin to do is aggregation, to show drawing class has

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-
 
Back
Top