S
Stephen Marjoribanks
The title may be a little off topic actually but anyway... I have an
application which every time an XML file is opened creates an instance
of a class called XMLParser. This does not extend any other classes and
it's function is to validate the XML file and retrieve all the required
data from it and store it in arrays/hashmaps.
If the user were to close the file, how long does the instance of
XMLParser exist for? Is it disposed of automatically as long as no
references to it exist or do I have to actually dispose of it manually?
The reason I ask is that should the user open a second XML file after
closing the first, another instance of XMLParser is created, with the
new arrays holding the new data. When the other classes within the
aplpication need to access the data would they not get confused between
the first instance of XMLParser and the second? Bearing in mind they
will be identical apart from the data stored within the arrays etc?
So basically, how do I ensure that the first instance of XMLParser no
longer exists or is no longer accessible when a second instance is created?
Thanks
Steve
application which every time an XML file is opened creates an instance
of a class called XMLParser. This does not extend any other classes and
it's function is to validate the XML file and retrieve all the required
data from it and store it in arrays/hashmaps.
If the user were to close the file, how long does the instance of
XMLParser exist for? Is it disposed of automatically as long as no
references to it exist or do I have to actually dispose of it manually?
The reason I ask is that should the user open a second XML file after
closing the first, another instance of XMLParser is created, with the
new arrays holding the new data. When the other classes within the
aplpication need to access the data would they not get confused between
the first instance of XMLParser and the second? Bearing in mind they
will be identical apart from the data stored within the arrays etc?
So basically, how do I ensure that the first instance of XMLParser no
longer exists or is no longer accessible when a second instance is created?
Thanks
Steve