research:rfid
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
research:rfid [2010/07/27 16:55] – kpinte | research:rfid [2010/08/04 15:00] – kpinte | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
// | // | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | < | ||
+ | This page is under construction, | ||
+ | </ | ||
==== RFID-enabled Library ==== | ==== RFID-enabled Library ==== | ||
- | The RFID-enabled library is a //mobile RFID-enabled application// | + | The RFID-enabled library is a //mobile RFID-enabled application |
== Towards naturally expressing RFID applications == | == Towards naturally expressing RFID applications == | ||
Line 26: | Line 32: | ||
<object width=" | <object width=" | ||
</ | </ | ||
- | |||
==== Requirements ==== | ==== Requirements ==== | ||
+ | To align physical objects tagged with writable RFID tags as true mutable software objects we model these objects as proxy objects acting as stand-ins for physical objects. For this model to be applicable to mobile RFID-enabled applications, | ||
+ | |||
+ | - **Addressing physical objects** RFID communication is based on broadcasting a signal. However, to be able to associate a software object with one particular physical object, it is necessary to address a single designated physical object. Object identities of digital objects should always correspond to object identities of physical objects. | ||
+ | - **Storing application-specific data on RFID tags** Since mobile RFID- enabled applications do not rely on a backend database, the data on the RFID tags should be self-contained and stored on the writable memory of the tags. | ||
+ | - **Reactivity to appearing and disappearing objects** It is necessary to observe the connection, reconnection and disconnection of RFID tags to keep the proxy objects synchronized with their physical counterparts. Differentiating between connection and reconnection is important to preserve the identity of the proxy object. Furthermore, | ||
+ | - **Asynchronous communication** To hide latency and keep applications responsive, communication with proxy objects representing physical objects should happen asynchronously. Blocking communication will freeze the application as soon as one physical object is unreachable. | ||
+ | - **Fault-tolerant communication** Treating communication failures as the rule instead of the exception allows applications to deal with temporary unavailability of the physical objects and makes them resilient to failures. For example, read/write operations frequently fail due hardware phenomena. | ||
==== Software Abstractions ==== | ==== Software Abstractions ==== | ||
- | == RFID event loop == | + | Here we will illustrate our model by presenting small code snippets that, in the end, will bring us to the RFID-enabled library application |
== RFID tags as mutable proxy objects == | == RFID tags as mutable proxy objects == | ||
+ | |||
+ | Physical objects are represented using a digital counterpart. This is done by simply defining an object with appropriate methods and slots. The code example shows the definition of a book object in AmbientTalk. | ||
+ | |||
+ | < | ||
+ | deftype Book; | ||
+ | |||
+ | def aBook := object: { | ||
+ | def ISBN := 123; | ||
+ | def title := "My Book"; | ||
+ | def reviews := Vector.new(); | ||
+ | |||
+ | def setTitle(newTitle)@Mutator { | ||
+ | title := newTitle; | ||
+ | }; | ||
+ | |||
+ | def addReview(review)@Mutator { | ||
+ | reviews.add(review); | ||
+ | }; | ||
+ | } taggedAs: Book; | ||
+ | </ | ||
+ | |||
+ | In this example a book contains an ISBN, a title and a set of review messages. There are two methods that allow to change the title and to add a review. By annotating the message with //Mutator// the programmer specifies when the software object is to be synchronized with the RFID tag. | ||
+ | |||
+ | Discovering books that are tagged with such an object happens by installing a discovery handler. To react upon disconnection or reconnection of a book, similar handlers are used: | ||
+ | |||
+ | < | ||
+ | whenever: Book discovered: { |book| | ||
+ | whenever: book disconnected: | ||
+ | whenever: book reconnected: | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | The example above uses // | ||
+ | |||
+ | The [[at: | ||
+ | < | ||
+ | when: book< | ||
+ | system.println(title) | ||
+ | }; | ||
+ | system.println(" | ||
+ | </ | ||
+ | This method invocation is [[at: | ||
+ | |||
+ | In case the book is not available at the time of the message send, no exception is raised but the message is simply buffered. When the book reappears in range the message is delivered and will be processed. The programmer can control the amount of time a message is buffered. For example, if the book does not respond within 10 seconds, the programmer might no longer be interested in the result. The code below exemplifies how this can be achieved by annotating the message send with a //Due// annotation. | ||
+ | |||
+ | < | ||
+ | def myReview := "not suitable for beginners"; | ||
+ | when: book< | ||
+ | // message processed successfully | ||
+ | } catch: TimeoutException using: { |e| | ||
+ | // message timed out | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | If the message send does not yield a result within 10 seconds, the catch block will be executed. | ||
== Ambient References == | == Ambient References == | ||
+ | |||
+ | RFID tags very frequently appear in groups of the same kind of item. For example, the set of books, or in a supermarket a set of jars of jam, etc. Thanks to [[: | ||
+ | |||
+ | < | ||
+ | def books := ambient: Book; | ||
+ | def computerScienceBooks := ambient: Book where: { |b| | ||
+ | b.category == " | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | On the first line, we have an ambient reference //books// that designates the set of all books that are detected. Note that this set changes dynamically when the user moves about and books become available or unavailable. | ||
+ | |||
+ | The last three lines define // | ||
+ | |||
+ | < | ||
+ | def shelfFuture := computerScienceBooks< | ||
+ | when: shelfFuture becomes: { |shelf| | ||
+ | system.println(" | ||
+ | }; | ||
+ | |||
+ | computerScienceBooks< | ||
+ | </ | ||
== Multiway References == | == Multiway References == | ||
+ | {{: | ||
+ | |||
+ | |||
+ | == Sample Application == | ||
+ | |||
+ | < | ||
+ | def books := ambient: Book; | ||
+ | whenEach: books< | ||
+ | GUI.addBookInfoAndReferenceToList(infoAndRef); | ||
+ | }; | ||
+ | whenever: Book discovered: { |book| | ||
+ | whenever: book disconnected: | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | def addReviewToBook(book, | ||
+ | when: book< | ||
+ | showOkDialog(" | ||
+ | } catch: TimeoutException using: {|exc| | ||
+ | showWarningDialog(" | ||
+ | }; | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | ==== Conclusions ==== | ||
+ | |||
+ | By implementing an example mobile RFID-enabled application using our model of aligning physical objects with mutable proxy objects we have observed that the requirements that we set forward for programming mobile RFID-enabled applications are met in the following ways: | ||
+ | - **Addressing physical objects** The implementation of the application shows that mobile RFID-enabled applications can be written in an object-oriented fashion, where application-level proxy objects uniquely represent physical objects in one’s physical environment. | ||
+ | - **Storing application-specific data on RFID tags** The data needed to con- struct these proxy objects is stored on the RFID tags themselves. | ||
+ | - **Reactivity to appearing and disappearing objects** Application logic is ex- pressed in terms of reactions to changes in the physical environment by relying on a number of expressive abstractions that are integrated into a communicating event loops framework. | ||
+ | - **Asynchronous communication** Interacting with physical objects is achieved by using the message passing metaphor on the proxy objects, by means of asynchronous message passing and asynchronous signaling of return values. | ||
+ | - **Fault-tolerant communication** Communication failures are considered the rule rather than the exception. Failures that must be considered permanent are detected and raise the appropriate exceptions. | ||
research/rfid.txt · Last modified: 2011/09/12 18:50 by kpinte