Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "passive data structure" in Android/Java?

Tags:

java

android

From the Android developer web link: http://developer.android.com/reference/android/content/Intent.html, you can find that it says "It (Intent) is basically a passive data structure holding an abstract description of an action to be performed." But I don't understand what is "passive data structure"? Could anyone help to explain it? Thanks!

like image 708
Tom Xue Avatar asked Sep 17 '12 03:09

Tom Xue


People also ask

Is Intent a data structure?

An Intent is basically a passive data structure holding an abstract description of an action to be performed.

What is passive data in Android?

Passive data updates are suited for apps that need to monitor Health Services data in the background. This is meant for long-lived experiences where data updates can be infrequent and spread over time. You can use passive data updates when your app isn't in use or running at the time the update is sent.

Which data structure is best for Java?

Use a HashMap<String, JournalArticle> data structure. you can put your keywords as the key of String type in this map, however, it only supports "exact-match" kind of search, meaning that you have to use the keyword (stored as key in the Hashmap) in your search.


2 Answers

A passive data structure (opposite of active data structure, or functional data structure) is one that is managed exclusively by external threads. That is to say, it does not have some associated thread which performs operations on it.

Basically, it's like a container of information; you create it, set all its information, and it just exists to be accessed by other processes (in Android, Activity objects, usually). Hence, it is not actively being access (so it's not "active"), and it is not being operated on (not "functional"), so it should be considered passive.

like image 186
Cat Avatar answered Sep 20 '22 19:09

Cat


I think the idea is that the Intent doesn't know how to do the activity, it only contains the info to describe what needs to be done. it's up to the receiver to actually enact the action using the Intent's information. hence, the Intent is "passive" in regards to the resulting action.

like image 22
jtahlborn Avatar answered Sep 19 '22 19:09

jtahlborn