When use Collection Framework?
Hello guys,
As I finished learning about Collection Framework, there is this question that i couldn't find an answer for.
When to use this framework? Only when i'm manipulating data that is stored temporarely?
For example, i wrote an address book program that manipulates the data using the CF. But once the program stops running, i use all the data. I know i could use a database or a file, but once i use either of these, does it mean i won't use the CF anymore?
I'm a bit confused.
Thanks for your replies guys in advance
Re: When use Collection Framework?
If you want the data you have stored in memory to persist when the program is not running you will have to write it to a file or DB.
Data is kept in memory so that it can be worked with by your program. It depends on your application as to how much of the data needs to be in memory or can remain on disk.
Re: When use Collection Framework?
So i can use the collections framework only when i'm manipulating data that is stored in memory during run-time?
Re: When use Collection Framework?
Not sure what you are asking.
If a program is not running, there is no data stored in memory.
The CF is part of the code that is loaded into memory with your program.
You use the CF as a tool to manipulate/store data in memory.
Re: When use Collection Framework?
That was not what I was talking about.
I meant, if I want to use the data from my database and manipulate them with CF, i have to extract them first, put them in a list for example, and then manipulate them?
I just thought there is a way to store your data in a list or set for example.
Re: When use Collection Framework?
Quote:
a way to store your data in a list
Where is the data when it is stored? Probably on disk somewhere.
To get the data into your program you will need to read it from disk.
There are many ways to do this, depending on how the data is stored.
Re: When use Collection Framework?
You didn't get my point again unfortunately. I just thought that there is a way to store your data in a list like in a database or a file.
Re: When use Collection Framework?
Quote:
I just thought that there is a way to store your data in a list like in a database or a file.
I said: Where is the data when it is stored? Probably on disk somewhere.
DB and files are on disks or some kind of permanent storage.
No, I don't have any idea what your point is.
Data is store in some storage like a disk file when the program is not running and/or the computer is turned off.