I have a class "A" which reads an XML file and does some processing. I put a method "load" in the constructor, but I'm wondering what happens if the XML file size is large and it takes time to be loaded.
class A
{
public String fileName;
A(String fileName)
{
this.fileName = fileName;
load();
}
private load()
{
//here i load some xml file by given file name;
}
public searchByTag(String sometag)
{
//some search
}
public extractData()
{
//extract some data
}
}
For example if we have the following scenario:
A a = new A("somefile");
a.searchByTag("tag");
a.extractData();
The object "a" is created just after file is loaded, right?