I have two essentially separate applications for configuring two pieces of hardware sold by this company.
I've been asked to put the two applications together so that they can be accessed from within the same program in such a way that both are accessible. An analogy to the idea would be opening a program, selecting a file to open, then opening a document editor or a spreadsheet editor depending on the type of the file.
This isn't particularly difficult for most aspects of the application, but my problem comes mostly from the main toolbar for the consolidated application. Each of the two different applications has its own set of functions relating to a common set of buttons, as well as having its own set of buttons.
I could separate the button responses in code with typechecking, i.e.
If documentOpened.isSpreadsheet
spreadSheetFunction()
Else
documentFunction()
but this seems messy to me, incorporating the functions of two classes into one bloated interface class.
Is there some way to achieve a greater degree of encapsulation, here, given that the two interfaces are so different?