main logo
Subject: Re: Design question
Author: Michael Babcock
Posted: 2006/07/31 14:00:40
 
View Entire Thread
New Search


Ed Leafe wrote:
> The example I gave back when I used to give this topic at
> conferences was a light switch in a room. In your app, you want to
> control the lighting by turning the switch on and off. Now let's
> imagine the switch is a typical mechanical switch with contacts that
> are opened and closed when you flip the toggle. In code, you could
> write oSwitch.contact1.Closed = .T., or oSwitch.TurnOn(), and either
> code would work great. However, if at a later date the switch was
> replaced by a mercury switch, or an electronic switch, or a dimmer
> switch, the first example of code would probably fail, since it was
> written to use an implementation detail of a particular switch,
> instead of the public interface all switches are designed to use. By
> coding to the public interface, such as the TurnOn() method, the code
> will work no matter how the switch works internally.

I meant to reference that example too in my session at FoxForward! I
recall you saying that...I think it was in the Profox archives from 2001?

--

Thanks,
--Michael




 
©2006 Michael Babcock
<-- Prior Message New Search Next Message -->