Re: Architecting Dilemma
- From: "jeff" <jhersey at allnorth dottt com>
- Date: Wed, 11 Apr 2007 10:01:35 -0700
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
.
- References:
- Architecting Dilemma
- From: John Wright
- Re: Architecting Dilemma
- From: John Wright
- Architecting Dilemma
- Prev by Date: richtext printing from .net
- Next by Date: Re: Architecting Dilemma
- Previous by thread: Re: Architecting Dilemma
- Next by thread: Re: Architecting Dilemma
- Index(es):
Relevant Pages
|
Loading