Introduction
Much data are organized in a hierarchical manner - for example as Region.Country.Office
or Fund.ShareClass.Account
. Each level of these requires a foreign key up to its parent level and this is usually a primitive data type (string, GUID or integer for example) with a meaningful name.
A good habit to get into is the creation of interfaces for these hierarchical layers to tag the properties involved in the hierarchy. For example, if we are using integers for our hierarchy navigation then the fund->shareclass->account, we could create interfaces like:
Public Interface IFundRecord
ReadOnly Property FundIdentifier As Integer
End Interface
Then share class inherits from this:
Public Interface IShareClassRecord
Inherits IFundRecord
ReadOnly Property ShareClassIdentifier As Integer
End Interface
And because .NET allows multiple interface inheritance, we could make an account link to both a share class and an investor:
Public Interface IAccountRecord
Inherits IShareClassRecord, IInvestorRecord
ReadOnly Property AccountIdentifier As Integer
End Interface
History
- 22nd June, 2014: Initial version