passing the ball

  • Thread starter Thread starter Treefrog
  • Start date Start date
T

Treefrog

Hi,

I have a program that creates some data, this data needs to be parsed but
depending on the data created, it'll need to be parsed in a different
method. I need the facility to add different parsing methods at will without
the need to recompile. The only way I could think to do this (apart from
writing a parsing script language ;o) was to create separate programs to
manage the data. Maybe diagram would explain this better.


main program (test.exe)
--------------
if (datatype == 1) data > parse1.exe
results < parse1.exe
if (datatype == 2) data > parse2.exe
results < parse2.exe

I think that explains it?

My question is, how can I pass a large string (about 3k) to and from the
parser programs? For speed, I'd like to avoid writing to a file and keep
everything in RAM of at all possible.

Thanks in advance.

Treefrog
 
Treefrog said:
I have a program that creates some data, this data needs to be parsed but
depending on the data created, it'll need to be parsed in a different
method. I need the facility to add different parsing methods at will without
the need to recompile. The only way I could think to do this (apart from
writing a parsing script language ;o) was to create separate programs to
manage the data. Maybe diagram would explain this better.

No - a better way of doing this is to create a plugin architecture
which provides an interface used for parsing, and which can load
specified assemblies which contain types which implement the interface.
 
Back
Top