Re: more dimensional method like a query...



Responding to Pi421...

i have a problem with a query.
First i have stocks, depending on 4 attributes. Its like a tree, so
there are 16 possible querys. Like the stock hat batchs, and the one
patchs is reserverd for diffrent projekts and some of the materials in
the stoch habe diffrent qualitys....

Could you clarify some things, please...

Does every Stock entity have a value for all four attributes? (That is, when you say, "It's like a tree..." are you referring to the query or the stock?)

What is the context of the dependency among the values? That is, do the values depend on each other? For example,

Project values      allowable Conditions
==============      ====================
A                   X or Y
B                   Z
C                   Y or Z

so that if a Stock entity has a value for Project of 'B', then it must have a value of 'Z' for its Condition attribute and if a Stock entity has a value of 'C' for its Project attribute it cannot have a value of 'X' for its Condition attribute. (Note that this is an issue of Normal Form compliance in the definition of objects or data schemas.)

Or does the dependency exist at a higher level, such as the need to access all Stock entities that happen to have Project values of 'B' AND a Condition value of 'Z'? (Note that this is an issue of relationship participation and navigation among objects in a problem solution.)

So i want to programm a Method with 4 attributes. All combinations of
the attributes are possible. Like getStock(batchA, ProjektX, QualityZ,
conditionF).

Who do you see as "owning" this Method in your application? That is, what object would have this responsibility?


My question: How do i store the stock and how do i programm the
getStock method. I think arrays are not the best way...

To second Parker's question: when you say 'stored' do you mean the in-memory solution to some customer problem (the object view) or the way the information is persisted between application executions (e.g., the RDB view)?



************* There is nothing wrong with me that could not be cured by a capful of Drano.

H. S. Lahman
hsl@xxxxxxxxxxxxxxxxx
Pathfinder Solutions  -- Put MDA to Work
http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman
(888)OOA-PATH



.