D
DelphiLover
Hi.
I'm reading and reading, testing and testing, trying to figure out how
to do things, how to do things according to best practises and how to
do things in the best object oriented way.
So... Best practises, in good object oriented fashion: how do I do it.
I'm thinking making classes for data access. An Example that ALL books
do - customer - and orders. So I'm thinking: Making a customer class
and a orders class. The customer class has methods for accessing the
customer table (or datasource of some kind) and it also has
functionality to get the related orders.
I can use generic factoring in the class, so this does NOT make my code
database specific.
Secondly I can put a ObectDataSource on my form, point it to my class,
tell it what functions will fill the dataset etc. (btw: do I need one
separate datasource for each of the functions I wanna point to in the
class... ?)
Then I connect the gridview to the object datasource to publish my data
to the user.
Well, does this sound like I'm on the right track.. ?
You wouldn't happen to have some code on how you do it.... ?
I will greatly appreciate a discussion about this!
Thanx,
Fritjolf
I'm reading and reading, testing and testing, trying to figure out how
to do things, how to do things according to best practises and how to
do things in the best object oriented way.
So... Best practises, in good object oriented fashion: how do I do it.
I'm thinking making classes for data access. An Example that ALL books
do - customer - and orders. So I'm thinking: Making a customer class
and a orders class. The customer class has methods for accessing the
customer table (or datasource of some kind) and it also has
functionality to get the related orders.
I can use generic factoring in the class, so this does NOT make my code
database specific.
Secondly I can put a ObectDataSource on my form, point it to my class,
tell it what functions will fill the dataset etc. (btw: do I need one
separate datasource for each of the functions I wanna point to in the
class... ?)
Then I connect the gridview to the object datasource to publish my data
to the user.
Well, does this sound like I'm on the right track.. ?
You wouldn't happen to have some code on how you do it.... ?
I will greatly appreciate a discussion about this!
Thanx,
Fritjolf