1. 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?

new topic     » topic index » view message » categorize

2. Re: Extensibility vs... ?

----- 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 message » categorize

3. Re: 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?
>
> 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

True! This is basically a wrapper, and I could even provide a wrapper to the
base functions.

> 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.

Yeah, I can appreciate that.

Thanks, Derek.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu