0

I'm migrating an application (ERP System) to .NET. The application is distributed on 2 Windows form Apps: One on server side and one client side. Both applications will be .NET. I'll been reading a lot on Microsoft WCF technology, and I'm planning to use it to transport data between layers.

Now to communícate client and server i was planning to use ADO.NET DataSet. I´m Reading about this and know that is not recommend method. I should used something like strong type classes. But with this method if for example i'm showing a sales report (from a stored procedure), I have to create a class with all the columns in the query in the client and the server side. So if I need to add a new column, I need to modify the stored procedure, and modify both client and server code!

If I return a dataset, client don't need to know what dataset contains, only need to know how to show it, and business layer only need to know how to extract data from DB and how to transmit to the client?

Am I missing something here? Thanks!!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
ericpap
  • 2,917
  • 5
  • 33
  • 52
  • hard to say for sure based on your info, but IMO it is fine to start out with a dataset for a simple application,especially if it is a simple report. Make sure though that it doesn't become the default pattern for future development. You may want to consider just returning the datatable. – PatFromCanada Feb 25 '14 at 17:23
  • I actually would be much more concerned about using Winform, that is a dead end and you may as well learn WPF now. – PatFromCanada Feb 25 '14 at 17:25
  • Thanks for you comment PatFromCanada.I´m Reading about other technologies like Entity Framework combined with POCOs to use it over WCF. But why you say WinForm is dead end? you mean about desktop applications or just winforms? Should i use WPF instead? thank you again! – ericpap Feb 26 '14 at 00:27
  • 1
    Desktop applications (WPF) are great for what they do, click-once technology is a big part of that. check out http://stackoverflow.com/questions/15681352/transitioning-from-windows-forms-to-wpf. I would guess that Entity framework is overkill for what you are doing, though if you want to go that route it is best to start simple. – PatFromCanada Feb 26 '14 at 14:37
  • What you mean with "Entity framework is overkill"? Too complex maybe?Would you recommend an alternative technology for what i want to develope? Thanks – ericpap Feb 26 '14 at 15:47

1 Answers1

1

If you can, you should try to centralize all your business logic into a service back-end and treat all your Windows Forms as just pure UI to access the back-end via WCF. Using DataSet may appear to help new columns being added without problems but most of the time, there will be some form of logic tied to the new column as well. Therefore, I would recommend going for POCOs instead.

You may want to refer here for samples of Winforms calling service backend via WCF in a Layered Architecture http://layersample.codeplex.com/

You can also read more about layered architecture here http://serena-yeoh.blogspot.com/2013/06/layered-architecture-for-net.html

  • Thank you. I'm already going with the approach you mention. Rigth now i have my server side with 4 proyects: DAL, Business, Model and WCF Service (all send data to each others using POCOs), and then use a WPF Client to consume WCF Service and show data using MVVM pattern. I'm considering to merge all 4 server side project in only two or even only one project for simplicity. Otherwise i need to pass POCOs object from one layer to another every time i need to process something. Thanks! – ericpap Mar 26 '14 at 12:51