CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Jeremy D. Miller -- The Shade Tree Developer

Under the hood and working with .Net, TDD, Software Design, and Agile Stuff

How you're writing WinForms apps - The results

Last time I asked the question "How are you building WinForms applications?" just to get a sense of how everyone else is doing things.  Here's my tabulation of results with some comments below.  I had to apply some interpretation here, so take the numbers with a grain of salt.  Besides, it's also a little bogus to tabulate because I'll use a combination of Passive View, Supervising Controller, and Presentation Model within the same application depending upon the screen.  Plenty of you said the same.

  1. Composite Application Block:  4
  2. Presentation Model or Model-View-ViewModel:  5
  3. Passive View (I'm including Presenter First in this bucket):  8
  4. Supervising Controller:  11 
  5. Legacy Code ported from VB6 that's not my Fault!:  6

plus one vote for Wendy's View to Command wiring.

Lots of folks doing Model centric validation.  I was pleasantly surprised by that, but shouldn't have been.

Comments

The decisions seem to be based on the logical things.  If you trust data binding or at least think it's a time saver you're more likely to choose Presentation Model or Supervising Controller.  If you're paranoid about test coverage, you pick Passive View. 

If you ported from VB6 you're out of luck.  When I was coding VB6 I didn't have a clue about View/Controller separation, and I'd bet the mass majority of my peers were in the same predicament there.

 

Next time, I'm going to try to compile a list of what everybody thought was hard and see if I can connect some links and patterns to some of it.  I was glad to see I wasn't the only person unhappy enough with Data Binding to go their own way.



Comments

actionsx » How you're writing WinForms apps - The results said:

Pingback from  actionsx » How you're writing WinForms apps - The results

# October 30, 2007 1:27 PM

Todrom.Com » How you're writing WinForms apps - The results said:

Pingback from  Todrom.Com » How you're writing WinForms apps - The results

# October 30, 2007 1:47 PM

Derick Bailey said:

I don't understand the issues with Databinding being so troublesome... can you elaborate on the issues?

My typical use of databinding is that I have IList<t> collections and I assign them as the datasource in my view. i can still unit test against the presenters that load up the IList<t>... for complex databinding scenarios (where I need to actually update the list and have it reflected in a grid, etc), I wrap my IList<t> inside of an IBindingList<t> when i send the list to the view:

public IMyView.MyMethod(IList<whatever> whateverCollection)

{

 BindingList<whatever> bindingList = new BindingList<whatever>(whateverCollection);

 myGrid.DataSource = bindinglist;

}

from there, i can update the original IList collection from within my presenter and it shows up in the view automatically.

# October 30, 2007 2:32 PM

Florian Krüsch said:

It would be interesting to hear what people answer if you were asking for WPF.

# October 30, 2007 5:26 PM

Derick Bailey said:

WPF is a giant hunk of crap, at the moment. (my personal opinion) and is not ready for prime-time use, by any means.

I tried implementing it for one of the most simple scenarios I could think of, in a recent project. it tooks two weeks to get a panel bar created and working (there are no good control suites for WPF, that i know of, yet) and the end result took 15 to 20 seconds to load the form, every time. I switched it out for a Telerik based standard winform in 2 hours and the form takes about 2 seconds to load.

# October 30, 2007 10:55 PM

Kent Boogaart said:

@Derick. I don't think any WPF dev would deny that there's a significant learning curve to it. However, I can promise you - my personal opinion - that WPF brings many benefits to application developers once you grok it.

Did you try running existing WPF samples on your machine to check whether they had performance issues? To me, 15-20 seconds sounds like something may be wrong with your installation / hardware / code. Trying an existing sample would at least rule out your code.

# October 31, 2007 8:41 AM

Mark Lindell said:

@Derick

I have to disagree as well based on my experiences.

I've been prototyping a large data visualization project in WPF and the performance has been incredible!  I'm accomplishing things with WPF that would NOT BE POSSIBLE by my talent in GDI or using Direct X.

I've been using Infragistrics controls for WPF.

I must admit, I don't use the beta designers VS2005 or beta 2008.  I hand code the XAML to assist in groking WPF.

# October 31, 2007 4:55 PM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Jeremy D. Miller

Jeremy began his IT career writing "Shadow IT" applications to automate his engineering documentation, then wandered into software development because it looked like more fun. Jeremy previously worked as a systems architect building mission critical supply chain software for a Fortune 100 company and learned agile development practices as a .Net consultant at ThoughtWorks, one of the pioneers of agile development. Jeremy is the author of the open source StructureMap (http://structuremap.sourceforge.net) tool for Dependency Injection with .Net and the forthcoming StoryTeller (http://storyteller.tigris.org) tool for supercharged FIT testing in .Net. Jeremy's thoughts on just about everything software related can be found on his weblog "The Shade Tree Developer" at http://codebetter.com/blogs/jeremy.miller, part of the popular CodeBetter site. Jeremy is a Microsoft MVP for C#. Check out Devlicio.us!

This Blog

Syndication

News

All opinions expressed here constitute my (Jeremy D. Miller's) personal opinion, and do not necessarily represent the opinion of any other organization or person, including (but not limited to) my fellow employees, my employer, its clients or their agents.

About Me

"Best Of" Compendium

StructureMap (Dependency Injection for .Net)

StoryTeller (Supercharged Fit)

Build your own Cab

TestDriven

MVP