Skip to Content.
Sympa Menu

gang-of-4-patterns - RE: [gang-of-4-patterns] Advice Sought Regarding Proper Design

gang-of-4-patterns AT lists.cs.illinois.edu

Subject: Design Patterns discussion

List archive

RE: [gang-of-4-patterns] Advice Sought Regarding Proper Design


Chronological Thread 
  • From: Ray Ye <rayye AT Catena.com>
  • To: "'Hainer, Neil'" <hainern AT jivanet.net>, gang-of-4-patterns AT cs.uiuc.edu
  • Subject: RE: [gang-of-4-patterns] Advice Sought Regarding Proper Design
  • Date: Tue, 10 Jun 2003 13:59:02 -0400
  • List-archive: <http://mail.cs.uiuc.edu/pipermail/gang-of-4-patterns/>
  • List-id: Design Patterns discussion <gang-of-4-patterns.cs.uiuc.edu>

The point here is that you don't want to write two RDF_writer classes to
take two unique result object classes to produce RDF files, which there will
be a lot of similarities and redundancies.

So is that possible that you can adapt one vender's result object to another
one's? If so, you can use adapter pattern, and reuse the logic in RDF_Writer
(which takes only one vender's result object) as input parameter.

Another approach is if you are able to access (or override) XML_writer, and
let the writer to product the same result objects (interface wise), and then
you can use the same RDF_writer to take the result objects uniformly. You
may have to define a new interface for both result objects from the two
venders.

Cheers,

Ray


-----Original Message-----
From: Hainer, Neil
[mailto:hainern AT jivanet.net]
Sent: Tuesday, June 10, 2003 11:25 AM
To:
gang-of-4-patterns AT cs.uiuc.edu
Subject: [gang-of-4-patterns] Advice Sought Regarding Proper Design


Hi,

I was wondering if someone could offer some advice regarding the best design
strategy to use to handle the following situation:

I am using an off the self product that analyzes text documents and produces
a results object, that I can output in XML and/or SGML. I need to output the
results in another markup language called RDF.

To product XML output, something quite similar to the following is done:

process input document producing vendor's results object

Writer xml_writer;

xml_writer.apply( results object, xml output file name);

I could create an RDF_Writer class that uses the same results object and
outputs a file containing RDF statements.

But....

I know I will have to do the same thing for another vendor's document
extraction product. That product will have its own unique results object and
have unique method names.

So....

How can I design my code so I can re-use the RDF code with different
vendor's results objects?

Thanks in advance,

Neil


Neil Hainer
Booz Allen & Hamilton
JIVA System Integration Project
703-289-3881


_______________________________________________
gang-of-4-patterns mailing list
gang-of-4-patterns AT cs.uiuc.edu
http://mail.cs.uiuc.edu/mailman/listinfo/gang-of-4-patterns




Archive powered by MHonArc 2.6.16.

Top of Page