I would just like to know what your general approach is when you decide its time to make a form for your project.
I understand that its a good idea to keep your form code seperate from the business logic - what is the best way to implement this?
Here is my idea - but not sure if its right:
1) Create a class called Foo, that makes an instance of the form in question.
2) In the form code make an Init(Foo myFoo) method, where you pass in the Foo object.
3) Back in the Foo class you do a Form.show(this) - where you are sending the Foo object into the form.
4) You work with the Foo class to update/operate certain controls etc on the Form - so now you are not sticking business logic code etc in the form class at all, and therefore are maintaining a separatio of concerns.
Is this right?? I would be interested on your thoughts and ideas.
Regards
I understand that its a good idea to keep your form code seperate from the business logic - what is the best way to implement this?
Here is my idea - but not sure if its right:
1) Create a class called Foo, that makes an instance of the form in question.
2) In the form code make an Init(Foo myFoo) method, where you pass in the Foo object.
3) Back in the Foo class you do a Form.show(this) - where you are sending the Foo object into the form.
4) You work with the Foo class to update/operate certain controls etc on the Form - so now you are not sticking business logic code etc in the form class at all, and therefore are maintaining a separatio of concerns.
Is this right?? I would be interested on your thoughts and ideas.
Regards