Constant Trees and Subtrees in .NET

  • Thread starter Thread starter tekiegreg
  • Start date Start date
T

tekiegreg

Hey there, what kind of structure is best for building a Constant tree/
subtree mix, for example if the following values would be constant:

Readings.OpenReading
Readings.CloseReadings
Discounts.EmployeeDiscount
Discounts.PoliceDiscount

etc...

What would be the best structure to build for this model so I could
read keys and subkeys of a given item? I've tried enumerations but
couldn't quite figure out how it works in nesting below (for example
you can enumerate "Readings" but not "OpenReading", thanks!
 
tekiegreg,

You might consider creating classes with constants, and grouping them in a
namespace, such as:

Namespace Consts
Public Class Readings
Public Const OpenReading As Integer = 15
Public Const CloseReadings As Integer = 31
End Class

Public Class Discounts
Public Const EmployeeDiscount As Double = 15
Public Const PoliceDiscount As Double = 17.5
End Class
End Namespace

Hope this helps,


Steve
 
Back
Top