DataSet encapsulation

  • Thread starter Thread starter Chuck Bowling
  • Start date Start date
C

Chuck Bowling

The data wizard (and Server Explorer) make a mess when generating code for
connections, adapters, commands, etc.

Are there any problems I should be aware of in cutting all of this generated
code out of the form and encapsulating it in it's own DataSet derived class?
 
Chuck,

There shouldn't be anything. The great thing about the designer in
VS.NET is that everything is persisted to code, making what you want to do
much, much easier.

Hope this helps.
 
Chuck,
I normally put the connections, adapters, commands in their own
System.ComponentModel.Component derived class.

Basically Martin Fowler's Table Data Gateway pattern.

http://www.martinfowler.com/eaaCatalog/tableDataGateway.html


This way I can use the designer to get improved development time, while
isolating the Data from the UI and from the Data manipulation (the
connections, adapters, commands from the dataset itself).


Martin's book gives an example of using the Table Data Gateway in C# with a
DataSet "holder" object.

Hope this helps
Jay
 
ty Nicholas.

Nicholas Paldino said:
Chuck,

There shouldn't be anything. The great thing about the designer in
VS.NET is that everything is persisted to code, making what you want to do
much, much easier.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Chuck Bowling said:
The data wizard (and Server Explorer) make a mess when generating code for
connections, adapters, commands, etc.

Are there any problems I should be aware of in cutting all of this generated
code out of the form and encapsulating it in it's own DataSet derived class?
 
Back
Top