Hello I design an objected oriented application using C# with database back end, for some time I was building same application using procedural way in which I feel storing data to database is little bit easier using simple SQL statement. I my application I want to store the objects attribute to database, for example for an item object
Class Item {
private string itemId;
private string itemname;
private Invoice inv; //assume Invoice object
//method
public bool storetodb() {
//..something like this
}
}
The problem is I feel a little bit complex when storing and retrieving object data to database. When I searched on some resource also they use like collection class to map between object on the application and relational database. Even I have searched SO but I couldn't find any related information. One source I got was
- http://www.codeproject.com/KB/database/AONETOOP.aspx ..... The author uses collection to store and retrieve data
- I hear also about ORM technology although I have never tried it.
So what is good practice for designing these types of applications? can you give any links, article, recommended book or response for tackling these types of problem.
Thanks
Update
It seems ORM tools mainly nhibernate is most promising from your suggestion. Thanks all of for your help, I will consider ORM