My issue is this: I am making a few activity screens that requires the use of some parts of information from all 3 Xml files. The problem comes when after parsing the xml's, I am stumped on what kind of object to store them with, to reduce the performance hit when running on the android phone, as I wish to support back to 2.2. (See below for the XML's) To complicate things more, "a" can have many "b"s, which in turn can have many "c"s. This results in about 12b's per a, and 20c's per b.
I could create an object per activity able to store everything that one activity needs, storing only the necessary parts of information from the XML's needed by the activity in arrays and 2d arrays if necessary. That way, less objects would be created but more time would be taken re-parsing when moving between activities.
I could also create an array of the necessary objects(a,b or c. Possibly 3 arrays of a,b, AND c), populated by the parser. This would be effectively simpler to code, since its more direct. Much easier to maintain as well, I would suppose. However, I am predicting a performance hit that I would probably..not like.
So heres the thing, is the performance hit small enough to forgo the necessity of creating a specialised object for each activity? Especially performance wise, in terms of load times and memory usage.(Since we are on the mobile here!)
Opinions, anyone?
The use of XML's are fixed, as is their format. They are local.
Using a XMLPullParser to retrieve their information.
My Xml(I have 3 of these; a,b & c):
<aType>
<aRecord>
<a1>SomeText</a1>
<a2>SomeText</a2>
</aRecord>
...
</aType>