Re: Faking inheritance in VBA to remove code duplication
On Sat, 10 Apr 2004 14:27:45 GMT, "rkc" <rkc@yabba.dabb a.do.rochester. rr.bomb>
wrote:
[color=blue]
>
>"Steve Jorgensen" <nospam@nospam. nospam> wrote in message
>news:fo5f701t2 qqc0fo2bif15i5t tgb1dtb1ti@4ax. com...[color=green]
>> On Sat, 10 Apr 2004 02:52:55 GMT, "rkc"[/color]
><rkc@yabba.dab ba.do.rochester .rr.bomb>[color=green]
>> wrote:
>>[color=darkred]
>> >
>> >"Steve Jorgensen" <nospam@nospam. nospam> wrote in message
>> >news:3aid7097p ulfbnim70lt41oh mr0to1ph38@4ax. com...[/color][/color]
>[color=green]
>> In my case, the PreInitialize function makes it look a little like a[/color]
>Template[color=green]
>> Function pattern, and the meta-data looks a little bit like an Entity[/color]
>pattern,[color=green]
>> but an Entity would not usually do much more than validation and parsing.[/color]
>
>I'm leaning towards it looking somewhat like a Visitor pattern at the
>moment.
>
>Whadda'ya think?[/color]
Hmm, I think a Visitor as something that's used to perform a specific
operation on a collection, not something that's permanently embedded in
another object to specify some details of its behavior. For instance, I have
a function that compares 2 collections, and it has an optional parameter of
type IComparator that has a method called .IsEqual(var1 As Variant, var2 As
Variant). That way, you can pass an object to the function that compares the
collections to tell it what Equal means for the items in the collection to be
compared.
On Sat, 10 Apr 2004 14:27:45 GMT, "rkc" <rkc@yabba.dabb a.do.rochester. rr.bomb>
wrote:
[color=blue]
>
>"Steve Jorgensen" <nospam@nospam. nospam> wrote in message
>news:fo5f701t2 qqc0fo2bif15i5t tgb1dtb1ti@4ax. com...[color=green]
>> On Sat, 10 Apr 2004 02:52:55 GMT, "rkc"[/color]
><rkc@yabba.dab ba.do.rochester .rr.bomb>[color=green]
>> wrote:
>>[color=darkred]
>> >
>> >"Steve Jorgensen" <nospam@nospam. nospam> wrote in message
>> >news:3aid7097p ulfbnim70lt41oh mr0to1ph38@4ax. com...[/color][/color]
>[color=green]
>> In my case, the PreInitialize function makes it look a little like a[/color]
>Template[color=green]
>> Function pattern, and the meta-data looks a little bit like an Entity[/color]
>pattern,[color=green]
>> but an Entity would not usually do much more than validation and parsing.[/color]
>
>I'm leaning towards it looking somewhat like a Visitor pattern at the
>moment.
>
>Whadda'ya think?[/color]
Hmm, I think a Visitor as something that's used to perform a specific
operation on a collection, not something that's permanently embedded in
another object to specify some details of its behavior. For instance, I have
a function that compares 2 collections, and it has an optional parameter of
type IComparator that has a method called .IsEqual(var1 As Variant, var2 As
Variant). That way, you can pass an object to the function that compares the
collections to tell it what Equal means for the items in the collection to be
compared.
Comment