Re: [TFUI] Dialogs and EventHandlers

Cory Foy <[email protected]> Tue, 08 Nov 2005 01:09:05 -0500
Newsgroups gmane.comp.programming.test-first-user-interfaces
Message-ID <[email protected]>
Ron Jeffries wrote:
> In the FontFactory, I might have had the factory contain a default
> implementation consisting of an instance of the real font, and
> override that with my test instance with a static setter that I
> could fire from the test, rather than the boolean.

Well, there was a specific reason I chose that way. Currently we're 
dealing with a big legacy C# Winform app. It acheived "customization" 
through a giant XML config file, and dynamically building all of the 
forms on the form using a set of other XML files that were serialized 
representations of the control layouts.

In addition, it called throughout the form other various forms that also 
needed to be customized. The way I did it was similar to what I did in 
the article, which was have the main UI get the form from a factory, 
from which it would load a customized version from a custom assembly, or 
the default instance if nothing was specified.

For the record, I didn't like the boolean either, but the challenges of 
loading controls from assemblies while leaving the default one was not 
something I wanted to focus on there. ;)

> Whether I did that or not would depend on how much in my way the
> language got. I probably wouldn't use reflection, as one of the
> notes suggested, in Java, but in Smalltalk, where a class is an
> object I might well just store the class in the variable and send in
> the message new (since in Smalltalk new is a message, not a
> keyword).

As I mentioned above, we have a configuration setting that loads a 
custom assembly where we can put customized versions of the forms in. 
The factories know to check first for this key, and if present, in the 
assembly for the form. If it isn't there, it gets it from the default 
assembly.

And, since we're making web service calls for 2MB responses over a 
wireless access card on a Tablet PC the slowdown doesn't seem noticable. 
;) (Another story for another day)

Cory



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

To unsubscribe, email:
TestFirstUserInterfaces-unsubscribe-hHKSG33TihhbjbujkaE4pw@public.gmane.org
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/TestFirstUserInterfaces/

<*> To unsubscribe from this group, send an email to:
    TestFirstUserInterfaces-unsubscribe-hHKSG33TihhbjbujkaE4pw@public.gmane.org

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/