In my project I have a very simple database:
Candidates table
PK Cand_Id
Name
Country
Rules Table
FK Cand_Id
Descr
Here I have a 1...* relationship between the candidates table and the rules table
Tle laws of 3 tier says that I have to define a collection that will represent this model... The following classes will be created
Candidate class
private candid as integer
private name as string
private country as string
Rules class
private elements() as Rule
private parentkey as integer
Rule class
private desc as string
The rules collection class has a constructor which takes a key (cand_id) because in good architecture a collection musn't stand alone, it should always have a parent(laws of 3 tier)!!
NOW.. there is a question hereWhat kind of custom collection is the best to create? I have the following reqs:
* For each capabilities
e.g. For Each rule as Rule in Rules
console.writeline(rule.desc.tostring)
next
* Databind properties!! I want to be able to bind the rules of a candidate to a datareader or dropdownbox!!! How can I do this, I really have no idea.
* Strong typed! no object types like in the arraylist
E.g
VB Code:
'Rules collection is loaded from datatier using the candid key "1" dim myrules as new Rules("1") console.writeline(myrules.items(0).desc) '<--- should work without error
I hope you understand my problem and question. Which is the easiest way to create a collection class that complies with all this? Should I use the collectionbase and start from there???
Prhaps someone has already struggeled with this and has a solution?
kind regards
Henrik


What kind of custom collection is the best to create? I have the following reqs:
Reply With Quote