S
Snedker
Hi folks,
I need some help to get this right:
On the data side I have two tables:
WishList
- WishListID
- UserID
- Description
Wish
- WishID (PK)
- WishListID (FK)
- ProductID (FK)
- Amount
- Bought
I've made two classes also named WishList and and Wish. I want for the
calls to the SQL-server (add, update, delete) to be abstracted to a
separate class, so I also have a class called Data.
Both classes of WishList and Wish have a Save() method (among others).
It's my thought to have a common Save() method for both classes, ie
Data data = new Data;
data.Save(..parameters..)
But the amount of parameters vary from WishList to Wish. So my
question is:
Can I have a common Save, or should I have a Data class for each of
the two classes (ie "WishData" and a "WishListData").
I hope I've explained myself well enough and very much look forward to
your responses.
Kind regards
Morten
I need some help to get this right:
On the data side I have two tables:
WishList
- WishListID
- UserID
- Description
Wish
- WishID (PK)
- WishListID (FK)
- ProductID (FK)
- Amount
- Bought
I've made two classes also named WishList and and Wish. I want for the
calls to the SQL-server (add, update, delete) to be abstracted to a
separate class, so I also have a class called Data.
Both classes of WishList and Wish have a Save() method (among others).
It's my thought to have a common Save() method for both classes, ie
Data data = new Data;
data.Save(..parameters..)
But the amount of parameters vary from WishList to Wish. So my
question is:
Can I have a common Save, or should I have a Data class for each of
the two classes (ie "WishData" and a "WishListData").
I hope I've explained myself well enough and very much look forward to
your responses.
Kind regards
Morten