Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Reflection or Strongly Typed data sets

Posted on 2004-08-01
5
Medium Priority
?
261 Views
Last Modified: 2010-04-15
I've been using reflection for some time now to easily translate database schema's to c# objects. Basically my reflection updates/Inserts/ deletes itself from a database. I also have an init function that uses a stored procedure to get it's own data from the database.

The beauty of this thing is that when I add a column to a table all I have to do is update the stored procedures that I'm using and add a property in the object. I don't have to manually create and fill out more properties.

I'm wondering if I should move to strongly typed data sets or not? I've tried to read up on it but I'm still a little unsure as to how they work and the pros and cons of em.

Please some information on this subject would be most helpful.

I'm looking for a solution that is flexible enough to handle changes to the underlying schema and is easy to maintain.
0
Comment
Question by:jayrod
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 1000 total points
ID: 11689125

have you considerred looking at an object persistance layer ? take a look at gentle.net or dataobjects.net both do VERY well at this task ... it would actually only be adding a property and an attribute in your class ...

as for typed datasets, I personally don't like them ... one of the main problems I have been seeing in MS lately is a division between the object persistance people and the typed dataset people. Due to this choosing which way to go is becoming difficult as some things offer support for one and not the other.

One advantage of moving towards a persistance layer is that yukon essentially contains a persistance layer in the database which will make moving your code to it a bit easier with a persistance layer than with typed datasets.
0
 
LVL 20

Assisted Solution

by:TheAvenger
TheAvenger earned 1000 total points
ID: 11691694
I think the answer to the quesion lays in the needs you have. If you want to update objects that have a structure you don't know or which changes often, I would not go for a typed dataset. However if you objects have a relatively stable structure and you don't have to work with any kind of objects, then using a typed dataset will make your development life much easier, will save you some mistakes, etc.
0
 
LVL 3

Author Comment

by:jayrod
ID: 11693307
I guess often is a word that has to be defined :P  I would say that the schema can change often enough to cause annoying problems.

I looked into gentle.net and looks like a great Idea.. I spent some time trying to use it but haven't gotten it to work just yet.

Thank you both.
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11694905
TheAvenger: I know I am stepping into a religious war here ... but are true object persistance layers not more flexible than types datasets ?
0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 11694950
gregoryyoung: Unfortunately I have no info about object persistance layers... I can only guess what it is by the name. And would expect the answer to your question to be: yes, they are. But look at my post: it said that typed datasets would be better only if the data structure is well fixed, does not change, is known at design time, etc. In this case the complexity of an additional layer just to have the data in a more flexible (which is not needed in such case) format....

So, if you are working with a fixed database, I would suggest typed datasets - easy to implement, designer supported, go for it and make it fast and clean. If the case is not such one, other options have to be considered and then I suppose your answer will be just OK
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question