Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

OOP and working with a database

$
0
0

Hi folks,

I have been writing desktop programs, with no consideration for OOP (other than inheriting from previously developed forms). These program typically use textboxes with the usual Add, Edit, Delete, Save buttons. Say my form allowed the user to add / edit a 'Customer Table'. On the form there would be a textbox which is datalinked to a datasource. But within the form I am not using a 'Customer' class. I simply write my validation as methods of the form. Hope this makes sense.

I have trying to get my head around the principles of OOP and gain a better understanding of it. But when I look at the tutorials, they always use hard coded data when constructing their objects. I would imagine in reality, there will be a datasource that would populate my 'Customer' objects. For example, say I have a 'Customer' class which has fields like, ID, name, address etc. How do get the data into these objects. Should I have a connection to a database for each object. I just cant see a correlation between OOP and database based programs.

Perhaps OOP just doesn't lend itself to this kind of programs ???

John


jppnn


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>