On 5/31/06, Paul D. Kraus <paul.kraus / gmail.com> wrote:
> Objective: store sales & units sold information by vendor, by year, by
> month,  by class code.
>
> In my nested data structured brain i see it like this
>
> hash{vendor}{year}{month}[0..5][0..1]
>
> 0..5 = represent 6 different item classification codes
> 0..1 = represents qty, sales.
>
> I keep trying to write the pseudo code for an object and keep ending up with
> 1 attribute that is the above data structure. Which kind of defeats the
> purpose.
>
> Maybe a nested data structure is really the way to go with this?
> Or an object for each (vendor,year,month) that just increments or decrements
> the values. So my attribute would just
> be array_class[0..5][0..1].
>
> Still seems messy and overcomplicated.
>
> Thoughts?

There is one store
The store has many vendors
Vendors have many products
The store has many sales (of its vendors products)

hth

> Please don't write the class just help me sketch this out. My brain just is
> not use to the whole OO thing :)

That takes a lot of the fun out of replying ;)

> Paul
>
>


-- 
Bill Guindon (aka aGorilla)
The best answer to most questions is "it depends".