I am developing an application with exactly 90 different DataTables. and 3 TypedDataSets, one with aprox 50 tables one with aprox 30, and one with aprox 20. But I am thinking about change that and use only one DataSet. The reasons: -Well you can not have relationships between tables in 2 differents datasets. And in real world application almost everything is related with everything else, and if the right way of doing things is using multiple dataset ¿why DataReltion can NOT work INTER-Dataset' -Because you cannot have DataRelations you cannot have contraints between your data. -I built a Data Persistency Manager that analyses the structure of a dataset and its data and automatically translates all of its changes to SQL, so I don't have to manually mantain over 90 OleDbDataAdapters and over 270 OleDbCommands, but to be able to do that I need to know all the relationships between the datatables, and if they are in different dataset, I cannot know their relationship on runtime. -Different datasets are also a bad idea because there is NO WAY to tell to 2 TypedDataSets that if they both have a DataTable "Customer", the generated "CustormerDataRow" class it IS THE SAME, so if you write code for CustomerDataRow in TypedDataSet1, you wont be able to use it with CustomerDataRow in TypedDAtaSet2, so you end up writing code to deal only with untyped DataRows, and If that is the way of doing things ¿for what do I want a TypedDataSet anyway?
¿Why am I currently using 3 datasets? -Well, I think the developers of the visual designer think that no one is going to build anything else than small apps with less than 20 tables, and that is why it does not have Zooming and it is really hard to mantain a real life application xsd with such a poor designer.
¿What do I think about DataSets? They are a bad solution for this problem, they are just a relational way of representing a copy of the data in memory,and you cannot embbed behavior inside them, because they are really hard to inherit in a good way (almost NOTHING is Virtual), you cannot load the related data that you need, only when you need it because it has no support for lazy loading, you cannot write the algorithm for a calculated datacolumn in C#, you have to use the unexpressive "Expression" column, you cannot automatically save you dataSet, it is hard to work visually with a Dataset with 2 Master - Detail Forms, and many other problems I have to deal with every day.
System.Data is not an ObjectRelational Framework, maybe in 1 year, maybe in 2 years ObjectSpaces will be released, and then we are going to make real Object Oriented Data Programming, in the mean while, am starting to build my own ObjectRelational Framework, and am taking a close look at projects like Bamboo and .NET Hibernate, or at Thona's EntityBroker.
|