Hi Stephanie
You could use the singleton
pattern for designing an application like that. This can be achieved by i) using a static method to issue and keep track of instances. We make constructor private so that the instance can be created from within the static method of the class.
One major advantage to this approach is that you don�t have to worry
about exception handling if the singleton already exists-- you simply get a
null return from the Instance method:
And, should you try to create instances of the iSpooler class directly,
this will fail at compile time because the constructor has been declared as
private.
The Second method is to throw an exception when the class is instantiated more than once.
Suneel