Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Interfaces

Status
Not open for further replies.

dragonwell

Programmer
Oct 21, 2002
863
US
I am building an application that takes an external data source and transforms/translates it and imports into a propreitary, "home" system. I want to write the bulk of this program once and when it comes time to convert a different system, I can use the same program, but only have to implement the "translator" part, since the schema of the home system does not change, but the external systems are extremely varied.

I have developed the following hypothetical interface for my ITranslator:

Code:
Customer CreateCustomer(DataRow row);
Employee CreateEmployee(DataRow row);
Product CreateProduct(DataRow row);
//there are more, but you get the idea

The DataRows will be queried out of the external system with all the necessary information to create one of our proprietry objects to be saved.

Now comes the interesting part. Sometimes this application will interact with one external system, and therefore require one ITranslator implementation. However, sometimes it will have to interact with more than one external system (one for Customer data, a differnet database for employee data, etc.) and thus require individual ITranslator implementations. To make matters worse, in one case the external Employee data is coming from TWO separate databases.

So I'm a little confused about how to design my ITranslator interface. Should the interface contain all the methods that could possibly be needed, or should I create a separate interface for each method? That is, do I need a separate ICustomerTranslator, IEmployeeTranslator interfaces, or just one ITranslator, which may or may not need full implementation depending on the external system being translated.

Thanks in advance for ANY thoughts or comments!



[pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top