This is an old revision of the document!
Representing RFID-tagged physical objects as mutable software objects.
The RFID-enabled library is a mobile RFID-enabled application and illustrates the kind of application we target. The application runs on a mobile device, such as a smartphone and shows the books that are in the vicinity of the user and allows certain operations to be performed on them. Users can attach a small review message to a book, rate a book or associate keywords with the book, etc. This data is all stored on the book directly, using RFID tag(s). The application lets the user also filter the books based on rating or comparison with a keyword profile describing the user's preferences. For example, the user could just swipe his smartphone over a shelf of books and discover which books on the shelf are must-read books!
Developing such mobile RFID-enabled applications with traditional software abstractions is a daunting task given the extreme volatility of connections to RFID tags. Simple repositioning of the mobile (reader) device, interference, etc. cause such applications to be very prone to failures. Currently the programmer is left to deal with these issues manually.
We even go one step further, by representing RFID-tagged objects as full-blown software objects. State-of-the-art RFID applications merely use RFID tags as digital barcodes and remain oblivious to the enormous potential of RFID technology in ubiquitous computing scenarios. For example, they do not use the writable memory on RFID tags to store contextual information.
Using the abstractions we present further on this page, programming RFID applications becomes more natural as application logic can be directly expressed in terms of the presence or absence of software objects representing physical items. Building on the ambient oriented programming model of AmbientTalk we provide integrated support for fault-tolerant connections and asynchronous communication with RFID tags.
In short, we consider RFID tags as the bridge between the physical and digital world. They effectively store digital stand-ins for real world items.
The movies below show a small prototype showing discovery of books on a shelf and a user adding a comment to a book.
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, it must adhere to the following requirements:
Here we will illustrate our model by presenting small code snippets that, in the end, will bring us to the RFID-enabled library application above.
Physical objects are represented using a digital counterpart. This is done by simply defining an object with appropriate methods and slots.
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;
whenever: Book discovered: { |book| whenever: book disconnected: { // react on disappearance }; whenever: book reconnected: { // react on reappearance }; };
when: book<-getTitle() becomes: { |title| system.println(title) }; system.println("here first!");
def myReview := "not suitable for beginners"; when: book<-addReview(myReview)@Due(10.seconds) becomes: { |ack| // message processed successfully } catch: TimeoutException using: { |e| // message timed out };
def books := ambient: Book; def computerScienceBooks := ambient: Book where: { |b| b.category == "Computer Science"; };
def shelfFuture := computerScienceBooks<-getShelf()@Any; when: shelfFuture becomes: { |shelf| system.println("The book should be on shelf: " + shelf); }; computerScienceBooks<-setShelf("5D")@Sustain;
def books := ambient: Book; whenEach: books<-getBookInfo()@Sustain becomes: { |infoAndRef| GUI.addBookInfoAndReferenceToList(infoAndRef); }; whenever: Book discovered: { |book| whenever: book disconnected: { GUI.removeBookFromList(book) }; };
def addReviewToBook(book, text) { when: book<-addReview(text)@Due(5.seconds) becomes: { |ack| showOkDialog("Review added succesfully!"); } catch: TimeoutException using: {|exc| showWarningDialog("Failed to add review!"); }; };
By implementing an example mobile RFID-enabled application, we have ob- served that the requirements that we set forward for programming mobile RFID- enabled applications are met in the following ways: