I am developing an application and I cannot specify the correct design for it. I have one in my mind, but it doesn't seem to be part of the GOF template, and so I'm not sure if this is a great way to go.
My project creates data from any of the possible 15-20 documents (all documents are of the same type, but the data can vary widely). As soon as the data is received, it must be formatted in any of the supported 4 formats and displayed. In addition, to complicate matters, although the documents themselves are widely classified into 4-5 types, some of the documents (according to these classifications) are formatted in a similar way.
Now I break it as follows:
- Data creation
- Data display
Creating data creates an interface data object with a common interface that can process all of these documents.
The data mapping reads the data object and displays it as required.
My first question: I have not seen such an interface object in the GOF template set. Is it a good design decision to have such a thing?
As I mentioned earlier, only two documents are formatted in the same way - according to classifications. The problem here is that other documents that should have been formatted in a similar way are not. So, I found that I was cloning the code in one script, getting data, which I donโt want.
So my second question is: what's the best way to handle this?
I would be very grateful if someone could help me here.
source share