Re: Architecting Dilemma



john,

read my previous and reverse the order of FOO and Piece ....

Create a FOO class
....

Create a Widget class
....

Create a Piece class...

The foo class will have a list / collection of Widgets ... as a property
The Widget class will have a list / collection of Pieces ... as a property.

The FOO 'TotalWeigh' would be a method ...

Foo.getWeigth()
Dim lReturn as Decimal
For each Widget in WidgetsList
lReturn = Widget.GetWeight() + lReturn
Next


Widget.GetWieght()
Dim lReturn as Decimal
For each piece in pieces
lreturn = piece.wieght + lReturn
next



When you add NEW pieces ... do you mean that each piece could / would have
its own set of properties ??? Did you create a Seperate TABLE / SCHEMA for
new a piece or do you add a new ROW an existing PIECE table for the new
piece?

If yes, you should investigate inheritance...

Are you telling me that for each new 'Piece' Widget and FOO you have a
distinctly different TABLE?


"John Wright" <riley_wrightx@xxxxxxxxxxx> wrote in message
news:uJ3L3yEfHHA.4020@xxxxxxxxxxxxxxxxxxxxxxx
Sorry for the confusion. Let me try to clarify.

The relationship of FOO's to Widgets is 1 to many. I FOO creates many
widgets. The do not share any properties at all except for the widget
containing the FOO ID and FOO Number. The relationship of Widgets to
Pieces is 1 to many. I widget can create many pieces. Pieces will inherit
from widget because they so share many qualities. Like the example given
of BaseClass....person.....properties and creating different types of
people, the pieces class will create different types of pieces that all
come from widgets.

So

FOO --------Widget2-----Piece 1
| |_______Piece 2
| |_______Piece 3
|
|------------Widget2----Piece 1
|_______Piece 2
|_______Piece 3

Note the dashed line from FOO to widget is just showing the relationship
of Widgets to FOO by including a readonly property in widget containing
the FOO ID and FOO Part Number. The Pieces are all specifics with
extended properties for each piece type.

In the FOO class I do have some data I would like to get from the Piece
class. For example the FOO weight. This weight will help determine the
estimated weight of the piece after processing. So I would like to have
the ability to go get the weight by putting in piece1.foo.weight.

Now the FOO class will be created when a new FOO is generated. Most of
these properties will not be needed or accessible from Widget (and Piece
by default of inheritance). So do I create a new FOO2 class that Widget
will create that will contain only readonly properties, or do I put a
method in Widget that will create the FOO class and provide the readonly
properties this way.

As for skipping inheritance and putting it all in the database, we did
that in VB 6 and adding new pieces and widgets was nightmare, not to
mention all the duplicate coding.

John




.



Relevant Pages

  • Re: Architecting Dilemma
    ... you have a class Foo that creates Widgets: ... Function NewWidget(Parameters) As Widget ... Foo propety that would simply return a reference to the original ... Widget that will create the FOO class and provide the readonly properties ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Architecting Dilemma
    ... created it and let the FOO properties be exposed through this class. ... Private mWidgets As New List ... Foo propety that would simply return a reference to the original ... FooInfo, Foo2, whatever you want to call it) that would expose only ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Architecting Dilemma
    ... containing the FOO ID and FOO Number. ... I widget can create many pieces. ... In the FOO class I do have some data I would like to get from the Piece ... Widget that will create the FOO class and provide the readonly properties ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Architecting Dilemma
    ... i think you are using inheritance wrong ... ... SpecialistClass inherits from PhysicianClass and includes these additional ... There are many FOO's in a Widget ... Foo is many to 1 Widget ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Architecting Dilemma
    ... creating a Widget base class and inheriting the Piece classes from Widget. ... Widget will contain the FOO ID and FOO Part Number as read only properties ... Public Class FOO ... Or should I create one FOO class and set readonly properties for FOO in my ...
    (microsoft.public.dotnet.languages.vb)

Loading