Re: OO idiom avoiding switch and if

2009-04-09 Thread Greg Guerin
Jeffrey Oleander wrote: Advice on what's least messy overall or pointers to sources of info would be appreciated. http://en.wikipedia.org/wiki/Finite_state_machine http://en.wikipedia.org/wiki/Reflection_(computer_science) "Convert a string matching the symbolic name of a class or function

Re: OO idiom avoiding switch and if

2009-04-09 Thread Michael Ash
On Thu, Apr 9, 2009 at 11:20 PM, Sherm Pendley wrote: > On Thu, Apr 9, 2009 at 9:45 PM, Jeffrey Oleander wrote: > >> >> There's a programming idiom to avoid using complex if statements and >> switch/case statements, and instead to just send a message to a different >> class of object. >> >> I'm d

Re: OO idiom avoiding switch and if

2009-04-09 Thread Sherm Pendley
On Thu, Apr 9, 2009 at 9:45 PM, Jeffrey Oleander wrote: > > There's a programming idiom to avoid using complex if statements and > switch/case statements, and instead to just send a message to a different > class of object. > > I'm doing some parsing of an old text data format which > has a hiera

OO idiom avoiding switch and if

2009-04-09 Thread Jeffrey Oleander
There's a programming idiom to avoid using complex if statements and switch/case statements, and instead to just send a message to a different class of object. I'm doing some parsing of an old text data format which has a hierarchy with a record and then sub-records and sub-sub records, 1 per "