Control Use - Good Practice?
-
Hi Guys - I have an application which contains a number of discrete controls. The app is working, but i have a particular control which is quite complex and i have the following options: 1) Implement the control and the model together and simply serialize the controls contents. 2) Implement the control and model seperately and keep them syncrhonised. I realise that 1 works nicely with minimum development, but in order to validate the data (The rules are external to the control), i would have to load it into the control and validate it there. To hide this from the UI, the validation would need to create an instance of the control purely for validation purposes. Would this be considered bad practice? What are other peoples thoughts on this matter? Cheers Tris
------------------------------- Carrier Bags - 21st Century Tumbleweed.
-
Hi Guys - I have an application which contains a number of discrete controls. The app is working, but i have a particular control which is quite complex and i have the following options: 1) Implement the control and the model together and simply serialize the controls contents. 2) Implement the control and model seperately and keep them syncrhonised. I realise that 1 works nicely with minimum development, but in order to validate the data (The rules are external to the control), i would have to load it into the control and validate it there. To hide this from the UI, the validation would need to create an instance of the control purely for validation purposes. Would this be considered bad practice? What are other peoples thoughts on this matter? Cheers Tris
------------------------------- Carrier Bags - 21st Century Tumbleweed.
Tristan Rhodes wrote:
- Implement the control and the model together and simply serialize the controls contents. 2) Implement the control and model seperately and keep them syncrhonised.
I would use the MVC pattern. Use the model and put the validation in there.
Deja View - the feeling that you've seen this post before.