Specific Questions:
- What is the best design pattern or strategy for this particular problem?
- How can I prevent potential cascading effects & re-writing the code?
Details:
I am developing a program in which I have three data sources (A, B, C). In order to grab data from B, I need information from A. In order to pull data from C, I need information from B.
Current Approach:
Description:
I used four classes. A mediator class that handles the passing of data from A, B, & C. Then, a separate class for A, B, & C that handles extracting, formatting, sub-setting, etc.
Process Flow:
- Inside the mediator class I instantiate classes A, B, & C.
- I run a function inside the mediator class called create_A_files().
- The data from A that B needs is then passed as an argument to B's create_B_files(A_necessary_data) function.
- Finally, the same is done from B to C through a create_C_files(B_necessary_data) function.
Problems with Current Approach:
I am fighting cascading effects. Any changes I make in A propagate and cause errors & bugs in B & C. Therefore, I have to go back and rewrite B & C to accommodate the changes from A.
Thank you in advance for your help! Narnia649
Aucun commentaire:
Enregistrer un commentaire