Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

advanced .net gui programming

Hello all,
Could someone recommend some books (or any other resources) that describe how to design and implement Windows-based programs using .NET? The projects I am facing have really interactive GUIs with a lot of controls that emulate and control my company's hardware products. And I don't need just another introduction to doing GUI programming in .NET -- I am way past "Hello World". Thanks!

adriana
Tuesday, March 22, 2005

Try this for starters:

http://www.aw-bc.com/catalog/academic/product/0,1144,0321116208,00.html

BillT
Tuesday, March 22, 2005

Thank you, I will look into it.

Adriana
Tuesday, March 22, 2005

Also see http://www.WindowsForms.net for articles, sample code, and other resources.

Chris Weed
Tuesday, March 22, 2005

You may also want to check out Syncfusion's FAQ (these are some of the folks who did Stingray MFC lib way back when):

http://64.78.52.104/FAQ/WinForms/default.asp

BillT
Thursday, March 24, 2005

Go here and look at some of the Rich Client Patterns. They will really help you trying to organize a complex gui.

http://www.martinfowler.com/eaaDev/index.html


I personally recommend the following pattern

http://www.martinfowler.com/eaaDev/ModelViewPresenter.html

In WinForms a View will be a form with a lot of calls to its corresponding presenter class.

My most successfull applications have incorporated the Command Pattern into this mix. The View calls the Presenter, which creates and execute a object implementing ICommand, which modifies the model. The use of the command pattern makes implementing undo/redo very easy.

The prime reason for using the presenter class is for automated testing, for ease of changing the look of the software for custom situations. With all your UI logic in the present you can right automated UI tests very easily.

For trival dialogs (like preferences, requesting a file name, or a parameter) A View-Presenter setup is overkill. Just create the dialog in the library where the command object resides and have the command directly access the dialog.

Finally if you are not familair with design patterns. A command Interface works like this

Interface ICommand
Function Clone as ICommand
Sub Execute
Sub UnExecute
Property Name as String
End Interface

Public Class SumFoo
    Implements ICommand

    rsData as RecordSet

Public Sub New
   
Public Sub New(Data as RecordSet)
      rsData = Data
End Sub

Public Function Clone as ICommand Implments ICommand.Clone
    Return New SumFoo(rsData)
End Function

Public Property Name as String Implements ICommand.Name
          Get
                Return "Sum Foo"
          End Get
End Property

Public Sub Execute Implements ICommand.Execute
  If Not rsData is nothing then

  'Do sum algorithm
  end if
End Sub

Public Sub UnExecute Implements ICommand.UnExecute
End Sub

Rob Conley
Thursday, March 31, 2005

*  Recent Topics

*  Fog Creek Home