[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Design-Question: Inheritance of HL7Paser and LDTParser

ralf

4/5/2006 8:39:00 PM

Hi,

I have a design question about 2 Parser I (nearly) wrote. They read
medical result messages in the international HL7-format and the german
LDT-format.
The two share part of their constructors, the main public method
(called "eat"). Most of the private methods do nearly the same. But LDT
and HL7 have very different complexity, so these methods cannot be
merged into a single one.

What I want to achieve is a main Parser -class I can feed the HL7 and
LDT Strings with. The user/using program does not have to know anything
about the existance of the HL7Parser class or the LDTParser class. The
Parser should find out the format of the string and delegate any
further mehod call to the appropriate (Sub)Parser. HL7Parser and
LDTParser should be some kind of hidden to the user of the Parser
class.

I know there are the "Delegator"- and the "Forwardable"-lib, but I am
not sure, if this is the right case for using them. I did not use them
so far.

expecting :)
Ralf