0

I see that MVVM is used for Windows Store/ WinRT C++ applications but can the pattern be applied to Win32 applications? What patterns do developers normally use?

I need to create an application with a ribbon UI. I've looked at all the higher lever ribbon reimplementations such as MFC, Forms wrappers, WPF and 3rd party WPF. They're all buggy and substandard.

The only path for a high quality ribbon application is to use the native Windows Ribbon Framework. However I'm having a hard time finding information about patterns and best practices for Windows API applications.

Monstieur
  • 7,992
  • 10
  • 51
  • 77

1 Answers1

0

Model-View-Presenter.

Actually, most Winforms developers just try to push as much of the logic as they can out of the Winform and into separate classes. But it is possible to do MVP with Winforms in a more or less standard way. See here for a good conceptual introduction.

See Also
http://winformsmvp.codeplex.com/
http://windowsribbon.codeplex.com/

Community
  • 1
  • 1
Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
  • Windows Ribbon Framework is only for the Windows API, not WinForms. – Monstieur Aug 02 '13 at 04:43
  • Have a look at http://windowsribbon.codeplex.com/. It is a managed wrapper for the Ribbon framework that allows you to use it from C# in Winforms. – Robert Harvey Aug 02 '13 at 04:46
  • As I mentioned I already looked at the wrapper and it's not good enough. – Monstieur Aug 02 '13 at 04:47
  • Then you'll have to go with one of the commercial ribbon offerings. I can't stress this strongly enough; *you do not want to go all the way back to win32.* It will at least triple your development effort. – Robert Harvey Aug 02 '13 at 04:49
  • It's a simple two-screen application that just reads a file, draws it on the screen and writes some output. I will need to communicate with a proprietary USB interface (preferrably WinUSB without any drivers). I was also considering Direct2D for doing the drawing and that seems to work best in C++ as like with the ribbon wrappers, the managed Direct2D wrappers are all buggy. – Monstieur Aug 02 '13 at 04:58
  • I'm worried that you think you need a ribbon for what you consider a very simple application. So this is a control panel for the USB interface? It doesn't seem like you need much architecture, TBH. – Robert Harvey Aug 02 '13 at 05:01
  • It's going to be mounted in a touchscreen appliance and the ribbon buttons are big enough to use comfortably and also look decent. A regular menu would be unusable. – Monstieur Aug 02 '13 at 05:04
  • Or, y'know, you could just use ordinary Win32 buttons and tabs. And you wouldn't even be restricted to Win32. Hell, you could probably fake a ribbon with a Winform. – Robert Harvey Aug 02 '13 at 05:05
  • That still doesn't answer my question. What programming patterns do developers use for Win32 applications? – Monstieur Aug 02 '13 at 05:06
  • It was called MDI (Multiple Document Interface). Seriously, you don't want to know. If you asked a developer from that era, they would retort "What's a programming pattern?" – Robert Harvey Aug 02 '13 at 05:07
  • MDI s not a pattern like MVC or MVVM. – Monstieur Aug 02 '13 at 05:08
  • MVC and MVVM are for big applications. This isn't a big application. – Robert Harvey Aug 02 '13 at 05:09
  • MDI is present even in WinForms. MDI has nothing to do with code separation patterns like MVVM and MVC. – Monstieur Aug 02 '13 at 05:10