0

I'm writing a program to run certain tests involving data from two databases. The idea is that such tests be implemented as plug-ins (I'm currently using the Yapsy plug-in framework). One test can be, for example, to check if some fields in one table row in the first database are equal to other fields in one table row in another database. It's very likely that several tests have to access the same table data and it would be nice if the program wouldn't duplicate the retreival of the data in such cases (the execution of the queries can be slow since remote databases are involved).

Any ideas on how to implement this in python?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Sergio
  • 4,537
  • 4
  • 33
  • 41

1 Answers1

0

If you're going to retrieve the data and then process it, and the structure of the data is known beforehand, you could make each plugin declare the data that it uses: tables or tables/columns.

Then you could create a dictionary of tables => plugins, and pass each plugin the data that it needs when you load its table(s).

Ryan Ginstrom
  • 13,915
  • 5
  • 45
  • 60