[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [TSVN] Another refactoring opportunity?

From: SteveKing <steveking_at_gmx.ch>
Date: 2005-01-04 18:55:37 CET

Will Dean wrote:

> The TSVN codebase currently contains approximately 25 copies of a set of
> wizard-generated code (plus several message map entries, class members,
> etc), which deals with assigning an icon to a dialog box when it's used
> at the main application of a window (as most of the dialogs in TSVN are).
>
> It's a boring set of code, familiar to anyone who's written an MFC
> dialog-based application.

I know - I found this very boring myself too.

> I am instinctively offended by boring code being repeated 25 times in an
> application, and have played with a way of removing it. This is to
> create a dialog class (which contains this code) and then derive all the
> other dialog classes from it. There is an additional complication that
> dialogs in TSVN can derive either from CDialog, or from CResizableDialog
> - so I made my base class a template, which takes the type of the base
> as a parameter.
>
> To allow some discussion of whether people think this is a good idea or
> not, I have just committed this into rev 2310.
>
> I won't change any more files until there's been some discussion of
> whether this seems to be a sensible thing to do. I appreciate that it
> might be viewed as worthless obfuscation...

I've checked your template code and it looks very good. The only thing
I'm not sure about is the double BEGIN_MESSAGE_MAP(): Since
CResizableDialog is inherited from CDialog, won't that cause confusion
about which message map is used? I'm not very good with templates, so
forgive me if I don't quite understand that.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Tue Jan 4 18:57:12 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.