<p>Everyone I work with is obsessed with the data-centric approach to enterprise development and hates the idea of using custom collections/objects.  What is the best way to convince them otherwise?</p>

[{'answer_id': 37383, 'author': 'Mark Glorie', 'author_id': 952, 'author_profile': 'https://Stackoverflow.com/users/952', 'pm_score': 2, 'selected': False, 'text': "<p>Datasets/tables aren't so bad are they?  </p>\n\n<p>Best advise I can give is to use it as much as you can in your own code, and hopefully through peer reviews and bugfixes, the other developers will see how code becomes more readable. (make sure to push the point when these occurrences happen).  </p>\n\n<p>Ultimately if the code works, then the rest is semantics is my view.</p>\n"}, {'answer_id': 37392, 'author': 'Mark Biek', 'author_id': 305, 'author_profile': 'https://Stackoverflow.com/users/305', 'pm_score': 4, 'selected': False, 'text': "<p>Do it by example and tread lightly.  Anything stronger will just alienate you from the rest of the team.</p>\n\n<p>Remember to consider the possibility that they're onto something you've missed.  Being part of a team means taking turns learning &amp; teaching.</p>\n\n<p>No single person has all the answers.</p>\n"}, {'answer_id': 37394, 'author': 'Eugene Yokota', 'author_id': 3827, 'author_profile': 'https://Stackoverflow.com/users/3827', 'pm_score': 2, 'selected': False, 'text': '<p>I guess you can trying selling the idea of O/R mapping and mapper tools. The benefit of treating rows as objects is pretty powerful.</p>\n'}, {'answer_id': 37404, 'author': 'Orion Edwards', 'author_id': 234, 'author_profile': 'https://Stackoverflow.com/users/234', 'pm_score': 3, 'selected': False, 'text': '<blockquote>\n  <p><i>Remember to consider the possibility that they\'re onto something you\'ve missed. Being part of a team means taking turns learning &amp; teaching.</i></p>\n</blockquote>\n\n<p>Seconded. The whole idea that "enterprise development" is somehow distinct from (and usually the implication is \'more important than\') normal development really irks me.</p>\n\n<p>If there really is a benefit for using some technology, then you\'ll need to come up with a considered list of all the pros and cons that would occur if you switched.<br>\nPresent this list to your co workers along with explanations and examples for each one.</p>\n\n<p>You have to be realistic when creating this list. You can\'t just say "Saves us lots of time!!! WIN!!" without addressing the fact that sometimes it is going to take MORE time, will require X months to come up to speed on the new tech, etc.  You have to show concrete examples where it will save time, and exactly how.</p>\n\n<p>Likewise you can\'t just skirt over the cons as if they don\'t matter, your co-workers <em>will</em> call you on it.<br>\nIf you don\'t do these things, or come across as just pushing what you personally like, nobody is going to take you seriously, and you\'ll just get a reputation for being the guy who\'s full of enthusiasm and energy but has no idea about anything.</p>\n\n<p>BTW. Look out for this particular con. It will trump everything, unless you have a <em>lot</em> of strong cases for all your other stuff:</p>\n\n<ul>\n<li>Requires 12+ months work porting our existing code. You lose.</li>\n</ul>\n'}, {'answer_id': 37406, 'author': 'Jon Limjap', 'author_id': 372, 'author_profile': 'https://Stackoverflow.com/users/372', 'pm_score': 4, 'selected': True, 'text': "<p>If you are working on legacy code (e.g., apps ported from .NET 1.x to 2.0 or 3.5) then it would be a bad idea to depart from datasets. Why change something that already works?</p>\n\n<p>If you are, however, creating a new apps, there a few things that you can cite:</p>\n\n<ul>\n<li>Appeal to experiencing <em>pain</em> in maintaining apps that stick with DataSets</li>\n<li>Cite performance benefits for your new approach</li>\n<li>Bait them with a good middle-ground. Move to .NET 3.5, and promote LINQ to SQL, for instance: while still sticking to data-driven architecture, is a huge, huge departure to string-indexed data sets, and enforces... voila! Custom collections -- in a manner that is hidden from them.</li>\n</ul>\n\n<p>What is important is that whatever approach you use you remain consistent, and you are completely honest with the pros and cons of your approaches.</p>\n\n<p>If all else fails (e.g., you have a development team that utterly refuses to budge from old practices and is skeptical of learning new things), this is a <strong>very, very clear sign</strong> that you've outgrown your team it's time to leave your company!</p>\n"}, {'answer_id': 37409, 'author': 'icelava', 'author_id': 2663, 'author_profile': 'https://Stackoverflow.com/users/2663', 'pm_score': 3, 'selected': False, 'text': '<p>Of course, "it depends" on the situation. Sometimes DataSets or DataTables are more suited, like if it really is pretty light business logic, flat hierarchy of entities/records, or featuring some versioning capabilities.</p>\n\n<p>Custom object collections shine when you want to implement a <em>deep hierarchy/graph</em> of objects that cannot be efficiently represented in flat 2D tables. What you can demonstrate is a large graph of objects and getting certain events to propagate down the correct branches without invoking inappropriate objects in other branches. That way it is not necessary to loop or Select through each and every DataTable just to get the child records.</p>\n\n<p>For example, in a project I got involved in two and half years ago, there was a UI module that is supposed to display questions and answer controls in a single WinForms DataGrid (to be more specific, it was Infragistics\' UltraGrid). Some more tricky requirements</p>\n\n<ul>\n<li>The answer control for a question can be <em>anything</em> - text box, check box options, radio button options, drop-down lists, or even to pop up a custom dialog box that may pull more data from a web service.</li>\n<li>Depending on what the user answered, it can trigger more sub-questions to appear directly under the parent question. If a different answer is given later, it should expose another set of sub-questions (if any) related to that answer.</li>\n</ul>\n\n<p>The original implementation was written entirely in DataSets, DataTables, and arrays. The amount of looping through the hundreds of rows for multiple tables was purely mind-bending. It did not help the programmer came from a C++ background attempting to <em>ref</em> everything (hello, objects living in the heap use <em>reference variables</em>, like pointers!). Nobody, not even the originally programmer, could explain why the code is doing what it does. I came into the scene more than six months after this, and it was stil flooded with bugs. No wonder the 2nd-generation developer I took over from decided to quit.</p>\n\n<p>Two months of tying to fix the chaotic mess, I took it upon myself to redesign the entire module into an <a href="http://icelava.net/forums/thread/1215.aspx" rel="nofollow noreferrer">object-oriented graph to solve this problem</a>. yeap, complete with abstract classes (to render different answer control on a grid cell depending on question type), delegates and eventing. The end result was a 2D dataGrid binded to a deep hierarchy of questions, naturally sorted according to the parent-child arrangement. When a parent question\'s answer changed, it would raise an event to the children questions and they would automatically show/hide their rows in the grid according to the parent\'s answer. Only question objects down that path were affected. The UI responsiveness of this solution compared to the old method was by orders of magnitude.</p>\n'}, {'answer_id': 37412, 'author': 'liammclennan', 'author_id': 2785, 'author_profile': 'https://Stackoverflow.com/users/2785', 'pm_score': 1, 'selected': False, 'text': "<p>You can't convince them otherwise. Pick a smaller challenge or move to a different organization. If your manager respects you see if you can do a project in the domain-driven style as a sort of technology trial.</p>\n"}, {'answer_id': 37417, 'author': 'azamsharp', 'author_id': 3797, 'author_profile': 'https://Stackoverflow.com/users/3797', 'pm_score': 2, 'selected': False, 'text': '<p>I think you should focus on the performance. If you can create an application that shows the performance difference when using DataSets vs Custom Entities. Also, try to show them Domain Driven Design principles and how it fits with entity frameworks. </p>\n'}, {'answer_id': 37475, 'author': 'Brian Leahy', 'author_id': 580, 'author_profile': 'https://Stackoverflow.com/users/580', 'pm_score': 1, 'selected': False, 'text': '<p>If you can profile, just Do it and profile.  Datasets are heavier then a simple <code>Collection&lt;T&gt;</code></p>\n\n<p>DataReaders are faster then using Adapters...  </p>\n\n<p>Changing behavior in an objects is much easier than massaging a dataset</p>\n\n<p>Anyway: Just Do It, ask for forgiveness not permission.</p>\n'}, {'answer_id': 37574, 'author': 'csmba', 'author_id': 350, 'author_profile': 'https://Stackoverflow.com/users/350', 'pm_score': 2, 'selected': False, 'text': "<p>Don't make it a religion or faith discussion. Those are hard to win (and is not what you want anyway)</p>\n\n<p>Don't frame it the way you just did in your question. The issue is not getting anyone to agree that this way or that way is the general way they should work. You should talk about how each one needs to think in order to make the right choice at any given time. give an example for when to use dataSet, and when not to.</p>\n\n<p>I had developers using dataTables to store data they fetched from the database and then have business logic code using that dataTable... And I showed them how I reduced the time to load a page from taking 7 seconds of 100% CPU (on the web server) to not being able to see the CPU line move at all.. by changing the memory object from dataTable to Hash table. </p>\n\n<p>So take an example or case that you thing is better implemented differently, and win that battle. Don't fight the a high level war...</p>\n"}, {'answer_id': 37636, 'author': 'Skizz', 'author_id': 1898, 'author_profile': 'https://Stackoverflow.com/users/1898', 'pm_score': 1, 'selected': False, 'text': '<p>Most programmers don\'t like to stray out of their comfort zones (note that the intersection of the \'most programmers\' set and the \'Stack Overflow\' set is the probably the empty set). "If it worked before (or even just worked) then keep on doing it". The project I\'m currently on required a lot of argument to get the older programmers to use XML/schemas/data sets instead of just CSV files (the previous version of the software used CSV\'s). It\'s not perfect, the schemas aren\'t robust enough at validating the data. But it\'s a step in the right direction. The code I develop uses OO abstractions on the data sets rather than passing data set objects around. Generally, it\'s best to teach by example, one small step at a time.</p>\n'}, {'answer_id': 274743, 'author': 'MusiGenesis', 'author_id': 14606, 'author_profile': 'https://Stackoverflow.com/users/14606', 'pm_score': 3, 'selected': False, 'text': "<p>Ironically, I wanted to post a question that was the exact opposite of this.  Most of the programmers I've worked with have gone with the custom data objects/collections approach.  It breaks my heart to watch someone with their SQL Server table definition open on one monitor, slowly typing up a matching row-wrapper class in Visual Studio in another monitor (complete with private properties and getters-setters for each column).  It's especially painful if they're also prone to creating 60-column tables.  I know there are ORM systems that can build these classes automagically, but I've seen the manual approach used much more frequently.</p>\n\n<p>Engineering choices always involve trade-offs between the pros and cons of the available options.  The DataSet-centric approach has its advantages (db-table-like in-memory representation of actual db data, classes written by people who know what they're doing, familiar to large pool of developers etc.), as do custom data objects (compile-type checking, users don't need to learn SQL etc.).  If everyone else at your company is going the DataSet route, it's at least technically possible that DataSets are the best choice for what they're doing.</p>\n"}, {'answer_id': 366611, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>There is already some very good advice here but you\'ll still have a job to convince your colleagues if all you have to back you up is a few supportive comments on stackoverflow.\nAnd, if they are as sceptical as they sound, you are going to need more ammo.\nFirst, get a copy of Martin Fowler\'s "Patterns of Enterprise Architecture" which contains a detailed analysis of a variety of data access techniques. \nRead it. \nThen force them all to read it. </p>\n\n<p>Job done. </p>\n'}, {'answer_id': 708516, 'author': 'Abhijeet Patel', 'author_id': 84074, 'author_profile': 'https://Stackoverflow.com/users/84074', 'pm_score': 2, 'selected': False, 'text': "<p>If Interoperability is/will be a concern down the line, DataSet is definitely not the right direction to go in. You CAN expose DataSets/DataTables over a service but whether you SHOULD or is debatable. If you are talking .NET->.NET you're probably Ok, otherwise you are going to have a very unhappy client developer from the other side of the fence consuming your service</p>\n"}, {'answer_id': 1076355, 'author': 'alchemical', 'author_id': 61639, 'author_profile': 'https://Stackoverflow.com/users/61639', 'pm_score': 0, 'selected': False, 'text': "<p>data-centric means less code-complexity.</p>\n\n<p>custom objects means potentially hundreds of additional objects to organize, maintain, and generally live with.  It's also going to be a bit faster.</p>\n\n<p>I think it's really a code-complexity vs performance question, which can be answered by the needs of your app.</p>\n"}, {'answer_id': 1903262, 'author': 'Ryan Lundy', 'author_id': 5486, 'author_profile': 'https://Stackoverflow.com/users/5486', 'pm_score': 0, 'selected': False, 'text': "<p>Start small.  Is there a utility app you can use to illustrate your point?</p>\n\n<p>For instance, at a place where I worked, the main application had a complicated build process, involving changing config files, installing a service, etc.</p>\n\n<p>So I wrote an app to automate the build process.  It had a rudimentary WinForms UI.  But since we were moving towards WPF, I changed it to a WPF UI, while keeping the WinForms UI as well, thanks to Model-View-Presenter.  For those who weren't familiar with Model-View-Presenter, it was an easily-comprehensible example they could refer to.</p>\n\n<p>Similarly, find something small where you can show them what a non-DataSet app would look like without having to make a major development investment.</p>\n"}]
['https://Stackoverflow.com/questions/37378', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2701/']