Re: Extensibility vs... ?

new topic     » goto parent     » topic index » view thread      » older message » newer message

----- Original Message ----- 
From: "C. K. Lester" <euphoric at cklester.com>
To: "EUforum" <EUforum at topica.com>
Subject: Extensibility vs... ?


> 
> 
> I'm creating a program and want to allow some easy extensibility in the
> future... Please let me know your opinion on the matter:
> 
> I like the idea of
> 
>     result = MyFuncs( { "FunctionName" , { Parameters } } )
> 
> and the brevity (read: "less typing" or "fewer keystrokes") of
> 
>     result = FunctionName( Parameters )
> 
> but the former is more extensible/flexible.
> 
> Does anybody have a problem with the MyFuncs() method? A preference for one
> or the other?

Welcome to my world blink

The first method does not preclude the second method. You define a new routine
(eg. FunctionName) and use it internally by the MyFuncs method and whoever wants
to can define a traditional-style interface to it, thus...

   function FunctionName(object x)
      return MyFuncs( {"FunctionName", {x}})
   end function

I would go with the MyFuncs method because it is extensible.

In win32lib, the event handlers get passed a 'params' parameter. By using this
method, I've been able to add new data values in 'parms' without breaking
existing code.

-- 
Derek

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu