Joe,
Lets say you're implementing a something that uses a data access class,
but you don't want to lock it a particular data storage system. So
someone could implement a file that reads data from a CSV file, and
another from SQL server. The underlying impelmentation of those
classes would likely be unique to each class, but you want to be able
to talk to them the same way.
At a previous employer, we had some meta data to describe some other
data we were storing (think of a survery system which lets
administrators define their own questions). We had a UI which used the
meta data to gather the actual data and we needed to export this data
to different vendors, each which had their own unique export format.
So we created seperate assemblies to deal with each particular export.
The classes we used to store the data logically should be able to
export it, but given we needed to add new formats an any time we
created the seperate dlls to handle each format.
Each assembly had a class named Exporter that implemented an interface
that lived with the data storage dll.
Our code to do the export looked like this (VB6 code).
oData.Load()
oData.Export( "format1" )
Export looked like this
Sub Export( sFormat as string )
Dim oExporter as IExporter
set oExporter = CreateObject( sFormat & ".Exporter" )
oExporter.Export( Me )
end sub
HTH
Andy