Hi,
I am designing an application, and I am unable to point out the correct design for the same. I have one in my mind, but it does not seem to be part of the GOF pattern and so I am not sure whether it is a nice way to go.
My project creates data from any of the possible 15-20 documents (the documents are all of same type, but the data can vary widely). Once the data is obtained, it needs to be formatted in any of the supported 4 formats and displayed. Also, to complicate matters, even though the documents itself are broadly classified to 4-5 types, few of the documents (across these classifications) are formatted in a similar way.
Now, I split it in the following way:
- Data Creation
- Data Display
Data creation creates an interface data object with common interface which can handle all these documents.
Data display reads through the data object and displays it in the way it is required.
My first question is that - I did not see about such an interface object in the GOF pattern set. Is this a good design decision to have such a thing?
As I mentioned before, just two documents are formatted the similar way - across classifications. The problem here is that other documents - which should have been formatted the similar way - are not. So, I find myself cloning the code in one scenario while getting the data, which I dont want to.
So, my second question is - what is the best way to handle this?
I will be very thankful if someone can help me out here.