-Edit- This is for a finance API I am designing. I am in the process of creating some empty classes, getting a feel for the general structure. My primary concern is designing a pleasant user experience without requiring a manual to explain how to use it. -End Edit-
I have been scratching my head trying to think of the best way to go about designing a specific class. I will create a general example to illustrate.
Namespace SomeNamespace
Public Class Results
Public a1 as Integer
Public a2 as Integer
...
Public b1 as Integer
...
Public z1 as Integer
End Class
End Namespace
The example above is generic, but the point is there are many values within the class. The letter in the variable name represents a similar group of results. The “a” results are similar, “b” similar, etc. I had thought to make a class for each type of result value (since they are a type of result, but separate concepts from each other) within the Results class such as…
Public Class Results
Class a
Public a1 as Integer
End Class
Class b ... End Class
End Class
The problem with this is that it is not explicit that when a person uses the class
Dim ResultObject as new SomeNamespace.Results.a()
the Results object would have to be instantiated first, because any of the sub-classes a,b, etc would rely on the Results object. But the user would see the objects a,b, etc and perhaps not know that they must create the parent object first.
I thought about making the classes separate and each constructor would create a Result object, but that seems backwards logically. Any Advice? Sorry if it was confusing.
Why not make an Abstract class Result and create an inheritance structure ResultTypeA, ResultTypeB etc.? With no details on the problem it is really hard to give a meaningfull answer.