Ok, I have a question, wich might sound weird.
Let's say I have the following home made objects : cTask ,cPriority, cResource
My task object has a property Priority (as cPriority) and a property Resource (as cResouce). In my data model, a task got a priorityID and I have a table 1 to many for the resources (having TaskID and ResourceID)
So I get something like : task.priority.id, task.priority.name, task.resource(1).name, and so on.
I also have the following methods in cTask : Add(), Delete(), Update().
What would be the best way to handle those methods ?
Here are the option I can think about :
Look at the propertys to save the "normal" fields and add optionnal parameters to save the ResourceID in the same call (like task.update(SomePriorityID)). But it's ugly.
Doing something like :
dim xPriority as new cPriority(somecontrol.selectedvalue) dim xTask as new cTask xTask.Priority = xPriority ... more code xTask.Add()
Again here, I find this solution ... not perfect.
- Finally I could add other propertys to cTask such as ResourceID.
What is the best practice for this situation ?
Thanks !