mardi 18 avril 2017

how to toggle the right class for checkbox listener?

Class B extends Class A

I have a GUI with a start button and a checkbox that creates multiple instances of Class A (A blueprint of my web service) based on given text input. The checkbox if checked writes some additional elements to the XML file (which is the main output of the entire application). Now I want to add an additional checkbox which will provide the GUI to create instances of Class B which extends Class A but provides some additional fields and logic.

My question is that how can I implement this required functionality?

Given there is a createMyXML() method which is doing the same for hardcoded arguments as Class B, should I extended it to take one of the class as a parameter and create instances for required elements in the XML?

P.S. It is probable that this question may be too subjective but I wonder what could be the approach or the 'right way' to do it.




Aucun commentaire:

Enregistrer un commentaire