I'm creating a "Document Viewer". My main view is just a grid that displays a list of documents based on certain criteria. Every document has some properties that are the same such as DocumentID, DateReceived, DocumentType, etc.
My MainView is working correctly.
When the user clicks a 'View Document' button, I want to show the details of the document in question. Unlike the main view, each document may have different properties that the other documents don't have so I immediately thought that I would create
a view for each document type and then instantiate that view when the view document button was clicked.
Since I have many document types, I would like to avoid a large select statement in the code. I was wondering if I could use inheritance or a generic class to somehow pick the correct view based on the document type.
Does anyone have any strategies to achieve something like this? Would I be better off just using a Factory pattern or something similar?
Any ideas would be helpful.
View Complete Post