Board index » delphi » How to design tables for this situation?

How to design tables for this situation?

Please allow me some time to explain my problem.

A plant produce a range of resin products say Resin1,Resin2,..ResinN.
A reactor is used to cook the resin. The sales manager will  plan the
production schedule and come out with something like this based on
product demand

BatchNo1  Resin2
BatchNo2  Resin9
:               :

There exists a set of rules which decide which product can or cannot
be cooked following the cooking of a product. The chart looks
something like this:

                        Next Batch
                Resin1  Resin2  Resin3 .....    ResinN
        Resin1      -   Y       N       ....    Y
        Resin2      Y   -       Y
This    Resin3      Y   Y       -
Batch   :           :  
        :           :
        ResinN     N

Y=Yes, N=No

For example, refering to 1st row, you can't cook Resin3 immediately
after Resin1 is cooked. But you can cook Resin2, ResinN etc.

My question is how to design tables to store this information.
Hard-coding  the info is not possible because the product list will
continue to expand. Can someone give me some guides?

TIA
See Liang
GeniurSoft Enterprise
sa...@pc.jaring.my

 

Re:How to design tables for this situation?


Ong,
You can store the matrix in a blob field.
If the produsts list expands (or shrinks),
you can easily change the size of the blob
at runtime, rebuild the matrix in memory
and store again. Check the tblobStream class
in online help.
--
Roman
KRE...@mbox.cesnet.cz
(please remove STOPSPAM. in header]

Re:How to design tables for this situation?


use a master child setup. Master table contains basic resin info. for
each resin master, Child table contains record for each resin that
cannot be cooked after

to use, link the two tables, filter the child table to the resin to be
cooked next. In the master table, find the current resin. If the child
table is now Eof you are OK

Alterntively, you can store the "Dont Cook After" List in a memo field
of the same table and use the IndexOf method to see if it is there.

Hope this helps.

Steve Griffiths

Quote
S.L.Ong wrote:
> Please allow me some time to explain my problem.

> A plant produce a range of resin products say Resin1,Resin2,..ResinN.
> A reactor is used to cook the resin. The sales manager will  plan the
> production schedule and come out with something like this based on
> product demand

> BatchNo1  Resin2
> BatchNo2  Resin9
> :               :

> There exists a set of rules which decide which product can or cannot
> be cooked following the cooking of a product. The chart looks
> something like this:

>                         Next Batch
>                 Resin1  Resin2  Resin3 .....    ResinN
>         Resin1      -   Y       N       ....    Y
>         Resin2      Y   -       Y
> This    Resin3      Y   Y       -
> Batch   :           :
>         :           :
>         ResinN     N

> Y=Yes, N=No

> For example, refering to 1st row, you can't cook Resin3 immediately
> after Resin1 is cooked. But you can cook Resin2, ResinN etc.

> My question is how to design tables to store this information.
> Hard-coding  the info is not possible because the product list will
> continue to expand. Can someone give me some guides?

> TIA
> See Liang
> GeniurSoft Enterprise
> sa...@pc.jaring.my

Other Threads