Hello,
this seems like it should be more strait forward but I feel like I am missing the boat on best practices somewhere.
I have inherited types with contractual insert update and delete methods. I also have an inherited "EditData" form wherein the Base form takes my base type in its constructor. My trouble comes when I want to assign the control values of the form to the properties of the sub- type. The base form calls the base type's insert method but since the base type is highly generic it doesn't know which properties need to be mapped to the forms controls.
I seems like I have to do that in the sup-type but the sub-type has no access to the form. Also NOT all the properties of the type are going to be changed by this form only one or two but it will vary from type to type.
SO... after that mouthfull, my question is should I...
1) give access to the form by passing the form to the insert method and make the form controls public and have the insert method set the type's properties accordingly?
or
2) make the insert method take a bunch of parameters (9 to be exact) and have the type set its properties from those accordingly?
OR is some other option I am not seeing?
let me know if you dont get my question of if you need to see some code
thanks in advance
this seems like it should be more strait forward but I feel like I am missing the boat on best practices somewhere.
I have inherited types with contractual insert update and delete methods. I also have an inherited "EditData" form wherein the Base form takes my base type in its constructor. My trouble comes when I want to assign the control values of the form to the properties of the sub- type. The base form calls the base type's insert method but since the base type is highly generic it doesn't know which properties need to be mapped to the forms controls.
I seems like I have to do that in the sup-type but the sub-type has no access to the form. Also NOT all the properties of the type are going to be changed by this form only one or two but it will vary from type to type.
SO... after that mouthfull, my question is should I...
1) give access to the form by passing the form to the insert method and make the form controls public and have the insert method set the type's properties accordingly?
or
2) make the insert method take a bunch of parameters (9 to be exact) and have the type set its properties from those accordingly?
OR is some other option I am not seeing?
let me know if you dont get my question of if you need to see some code
thanks in advance
Comment