I am designing a service that handles ATP printing which is what takes place at airport kiosk ticket counters and at the gate. From the viewpoint of the client it will not care where or how a document is printed. It will simply call the print service and pass what is to be printed. There are three types of printing and formats of printing. They are called CUTE, CUSS and Loyal printing. The meaning of each isn't important.
The print service will determine which type is to be printed from an application properties file and call the appropriate class. That;s where my question comes in. I can see having the same method in the service as the sub classes although these may or may not be descendents. They would all have init methods as well as print methods. If the sub classes are descendents of the top level service can the ancestor contain class variables of each of the descendants such as in the following :
class PrintService CUTEPrintService cuteps; CUSSPrintService cussps; LoyalPrintService lylps;