I am developing a java application, in my application i have to move data with large size from one object to another and i don't know the perfect way to do it so i can save memory and increase the processing speed because performance is very important in my project.
please can you tell me which scenario is better and why:
1-to include the large data in an string object for ex. and then send the reference of the object to the other object.
2-to save the large data in an file and to send the location of the file to the other object so the other object can read the file and process data.
what cost more saving and reading data in/from the file or transmitting the object referencing to the data from place to place.