Thursday, August 23, 2007

Just a quick note, if you happen to be running a service that will call automated tests like WatiN or IEUnit that need to open a browser or interact with the desktop in some way, you need to go into Computer Management, open the properties for that service and check the box that says "Allow this service to interact with the desktop."

Wednesday, August 22, 2007 11:57:30 PM (GMT Standard Time, UTC+00:00)
 Friday, August 03, 2007
 #
 

This is just a minor thing, but there were some assemblies I needed in the GAC and wanted to reference them with minimum hasslehoff, so I just copied them out of the C:\windows\assembly\gac folder using the command prompt.  I got the solution from this post

Friday, August 03, 2007 2:00:11 PM (GMT Standard Time, UTC+00:00)
 Wednesday, August 01, 2007

Strategy

Notes:
shove dynamic behavior into interfaces.  have the main base compose the behavior interfaces.  Then you can dynamically assign the behavior interface instances in the child classes of the main base class.

Decorator:

Basically think of an abstract class like a vehicle.  Then you have a couple of classes inherited directly off of it: truck, bike broken down Chevy, etc.  Then u have a base decoration class, which inherits off of vehicle and also contains a member instance of vehicle, so it both "has a" and "is a" vehicle, and has a constructor that takes a vehicle type.  Next, you've got a bunch of decorations, each of which inherits off of the root decoration class, such as pimped out, racing striped, washed, waxed, painted pink, etc. 

So in code, you can create any of these decorations and pass them in a vehicle or a decorated vehicle.  This way you can have pink truck just as easily as you can have a pimped out-washed-waxed-racing striped broken down Chevy, without having to create a complicated inheritance tree for each possible combination.

  • Some Notes:
    sort of define your own inheritance tree on the fly
  • defines an "is a"/"has a" relationship between the decorations and the object they're decorating
  • one possible use:  to dynamically aggregate functionality of semi-heterogenous items
  • composition + inheritance
Wednesday, August 01, 2007 6:08:40 PM (GMT Standard Time, UTC+00:00)