Hey folks,
I have a toppic I would like to discuss:
Many authors write that business objects should have the CRUD behavior
implemented (create, read, update, delete). Which means that a class
Customer has a method Load() etc...
In my opinion this is not the right way, because this means that you
implement the way a class is saved in the class itself.
What I do is creating DataAdapter classes for the business object. e.g.
XMLDataAdapter, SqlDataAdapter, TxtDataAdapter etc. The all implement
the same interface DataAdapter who has the CRUD behavior.
The way I do it, it is possible to save the same object as a textfile,
as an xml string or in a relational database (Sql Server e.g.)
What do you guys think is the best way?
I have a toppic I would like to discuss:
Many authors write that business objects should have the CRUD behavior
implemented (create, read, update, delete). Which means that a class
Customer has a method Load() etc...
In my opinion this is not the right way, because this means that you
implement the way a class is saved in the class itself.
What I do is creating DataAdapter classes for the business object. e.g.
XMLDataAdapter, SqlDataAdapter, TxtDataAdapter etc. The all implement
the same interface DataAdapter who has the CRUD behavior.
The way I do it, it is possible to save the same object as a textfile,
as an xml string or in a relational database (Sql Server e.g.)
What do you guys think is the best way?
Comment