form or seperate class code
Posted: 18 Nov 2013, 10:33
Hi guys. I am struggling to understand when do I put code in the form class and when do I create a seperate class to insert the code into there. An example would be. I created a program that stores meta data for movies in a xml file using xml serialization. I never created any classes and inserted all the code into the forms class. My question is should I have created the xml serialization into a different class and just called that up from a button click event. My main question is when do I use a seperate class and when do I write the code into my forms class.
Would if of been better if I created a property for the movie so in abuttons event when I save the xml I could just say
movie.year = txtyear.text
Movie.genre = "Comedy"
Thank you
Would if of been better if I created a property for the movie so in abuttons event when I save the xml I could just say
movie.year = txtyear.text
Movie.genre = "Comedy"
Thank you