Jeremy D. Miller -- The Shade Tree Developer

Sponsors

The Lounge

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
The big cutover

Dear Diary,

Last week I said that there's a "Great Refactoring" on every project -- and I just committed ours to SVN.  For what I thought were good reasons at the time, we started out with pure WinForms for our presentation layer.  Starting today, we're mixing in WPF for some of the little data entry screens.  I'm a complete newbie to WPF, so some of the learning curve hurt.  Anyway, here's my original reasons for using WinForms and other thoughts.

  • Risk.  I knew we could deliver in WinForms, and I didn't want to stop to ramp up with WPF.  I still think that was valid, but we're going to use WPF so simply that I don't think it would matter much.
  • I was initially hesitant to try WPF because the scuttlebutt was that WPF was hard or impossible to test.  So far I've been able to adapt my infrastructure and approach to testing WinForms and apply it almost unchanged to WPF.  All I really had to do was just put a little adapter code in my test automation for the different set of controls.  WPF doesn't really do anything to *help* you do automated testing, but it doesn't hamper testing (whatever that Automation API is supposed to be for, it isn't all that useful for testing).  Simulating events with the new RoutedEvent stuff was pure klooge, otherwise it's been fine.
  • The rendering performance is much, much better than the equivalent screens were in WinForms.  Even when we're just hosting WPF inside of a WinForms Panel the performance is still better.
  • We're doing some dynamic layout of screens with a little home cooked DSL.  The WPF layout controls are head and shoulders better than the WinForms analogues.  This was actually the main reason we switched, truth be told.
  • That whole "do Separated Presentation to protect yourself from changes in Presentation technology" bromide?  Yep.  The cutover really wasn't that bad because we had very little code that actually touched the WinForms classes.  The Fluent Interface stuff we use to drive the screens payed off in a big way here.
  • I thought we could reuse a lot of WinForms layout code from an earlier version of the system.  As usual, the old code is of dubious usefulness.  From this point on I'm only using the old code as reference.
Anyway, I'm alive.  If that's the worst thing that happens in our code, I'm a happy camper.  Back to building real code now.

Posted 03-18-2008 1:14 PM by Jeremy D. Miller

[Advertisement]

Comments

Mike Jones wrote re: The big cutover
on 03-18-2008 2:21 PM

Wow, WPF has been out almost 2 years, even more if you include the betas.  Makes you wonder about ALT.NET's (your) rhetoric:

"...while keeping an eye out for a better way."  Ignorance of WPF doesn't seem like keeping an eye out.

"You reach outside the mainstream to adopt the best of any community."  If WinForms is the mainstream, in .NET client applications, WTF?

"You're not content with the status quo." If WinForms is the status quo in .NET client applications, WTF?

Is ALT.NET simply for evaluating others and not yourself?

Carlton wrote re: The big cutover
on 03-18-2008 2:31 PM

This should be interesting....

Chad Myers wrote re: The big cutover
on 03-18-2008 3:05 PM

@Mike: What would you consider mainstream then?

For __thick client .NET apps__, WinForms is most definitely the mainstream. WPF is catching on, but I don't see a lot of WPF apps out there yet (including and especially from Microsoft themselves).

The Windows Live stuff is from MSFT and Windows Live Writer appears to be the only managed (.NET) app and is all WinForms.

If WPF is mainstream, why didn't Microsoft use WPF for WLW? It's a new product, so it seems reasonable they would dogfood it.

Wah wah waaaah wrote re: The big cutover
on 03-18-2008 3:14 PM

Rut Row Raggy

Jeremy D. Miller wrote re: The big cutover
on 03-18-2008 3:17 PM

What can I say Mike?  The best blog posts are often about the mistakes we make.  Besides, WPF wasn't interesting to me until we started trying to do dynamic layout stuff on this project.

Bryan Reynolds wrote re: The big cutover
on 03-18-2008 4:09 PM

Can you point me to information about best pratices with WPF?  

Bryan

Mike Jones wrote re: The big cutover
on 03-18-2008 4:50 PM

"...interesting to me until...", that just seems the complete opposite of ALT.NET and simply makes your complaints about EF unfounded because those devs could simply say the same thing.  "...until we started trying to do dynamic layout", seems like a tool crutch; and doesn't smell ALT.NET to me either.

Mike Jones wrote re: The big cutover
on 03-18-2008 4:58 PM

@Mike: What would you consider mainstream then?

Not really the point, the point was this leader of ALT.NET doesn't even follow the same basic philosophy that he's so quick to use to judge other people and tools.  If he's quick to dismiss himself he should be quick to dismiss others for doing the same thing.

Mike Suarez wrote re: The big cutover
on 03-18-2008 5:21 PM

@Bryan: keep an eye on codebetter.com/.../prism-ri-first-drop.aspx

@Jeremy: I email u a couple of days ago with a basic q on how to open a WPF window to test it. Anyways now I'm using White.

But still, I wonder how are you opening a WPF window for testing: by running the App or is it possible to run a stand alone window?

Jeremy D. Miller wrote re: The big cutover
on 03-18-2008 5:33 PM

@Mike Jones,

Give me a break dude.  You're basically criticizing me for not learning the details of a specific technology that I didn't have any use for until this past week.  I *knew* what WPF was, but it wasn't germane to anything I was doing.  

Besides, it's just the presentation layer.  WinForms isn't perfect, but it hasn't been the painpoint over the last 2 years for me.

Rob wrote re: The big cutover
on 03-18-2008 5:56 PM

Cool stuff.  Looking forward to hearing more about your experiences developing with WPF; doing agile, tdd, yada yada.  If you have any WPF questions along the way, don't hesitate to contact me.  I've learned a great deal from you, so I'm happy to give back in any way I can.  You know how to reach me ;) PEACE Brotha'

Oran wrote re: The big cutover
on 03-18-2008 5:57 PM

Wow Mike Jones, you sound bitter!  A few years from now when Jeremy finally finds some limited usefulness for Windows Workflow, are you gonna be back here beating him over the head for not using it sooner?

It's not like Alt .NET is an ultra-conservative orthodox religion and Jeremy is its high priest... lighten up.

Chad Myers wrote re: The big cutover
on 03-18-2008 7:04 PM

@Mike Jones:

That's a false dichotomy. Jeremy knew OF and enough ABOUT WPF to know that he didn't want to head down that road right off the bat.

The EF team, OTOH, seemed to be totally surprised by the concept of 'Persistence Ignorance' which had existed for several years.

You'd expect someone starting a new Thickclient app to be aware of WPF (which Jeremy was), likewise you'd expect the EF team to be aware of persistence ignorance (which they apparently weren't).

Wendy wrote re: The big cutover
on 03-18-2008 8:30 PM

Hope you have fun!

I had worked in winforms for so many years and although I found the learning curve on xaml a little challenging, using patterns from winforms was simple (even better). I really love wpf and hope it spreads through the community even more :)

How's it going in Austin? Do you miss NY yet?

Scott Bellware wrote re: The big cutover
on 03-19-2008 12:51 AM

When did ALT.NET become all about adopting the latest Microsoft stuff as quickly as possible?  I guess I missed the cut-over from the expectation of pragmatic development and adoption to the Tech Ed school of software adoption imperative.  Shame on you Jeremy for countermanding the new and revised ALT.NET approach!

home automation wrote home automation
on 03-19-2008 10:07 PM

Pingback from  home automation

Charlie wrote re: The big cutover
on 03-25-2008 2:02 PM

@Mike you need to see a tree surgeon to get that stick pulled out of your a*se.

Dabbler » Blog Archive » Winforms to WPF wrote Dabbler » Blog Archive » Winforms to WPF
on 03-30-2008 9:01 AM

Pingback from  Dabbler  » Blog Archive   » Winforms to WPF

Add a Comment

(required)  
(optional)
(required)  
Remember Me?