Mapping Gestures to Features

March 12, 2009 by slholmes
Filed under: General 
purchase acomplia online buy cialis on internet cheap viagra overnight delivery find cheap viagra online buy viagra us acomplia prescription order viagra no prescription cheap cialis overnight delivery cheapest propecia purchase viagra overnight delivery buy cheap soma purchase levitra cialis bangkok propecia generic compare viagra prices cheap generic propecia order ultram buy cialis us cialis approved propecia no prescription online soma buy viagra no prescription required order no rx cialis cheap propecia order viagra no prescription required cheap propecia tablets purchase propecia online cheapest viagra levitra prescription cheapest cialis cheap tramadol tablets where to buy viagra buy viagra from india buy tramadol online buying generic viagra buying cialis buy viagra without prescription cialis for order cheap cialis online cialis from canada viagra for sale buy cialis cheap purchase cialis overnight delivery buy cialis online discount cialis online buy cheapest cialis on line viagra prices order viagra from canada price of viagra cheap generic cialis cialis buy online order cialis without prescription order viagra in us cheap viagra buy levitra cheap cheap viagra in uk soma without a prescription purchase viagra no rx generic levitra cialis pills buy viagra low price price of propecia buying viagra cheap viagra from uk cialis overnight delivery cialis pharmacy online cialis drug cheapest viagra price lowest price viagra discount acomplia order viagra order no rx viagra buy generic propecia tramadol online stores free viagra online propecia cialis cheap price online viagra cialis sales soma without prescription online pharmacy cialis soma online stores buy propecia cheap acomplia prices find cialis without prescription order cialis in us buy tramadol viagra pills cheapest propecia prices viagra us cialis online cheap cialis tablet acomplia sale cheap cialis without prescription cheapest soma certified cialis order cialis purchase viagra without prescription discount cialis no rx order propecia order cialis on internet buy cialis from india cialis buy purchase ultram online overnight cialis cialis without a prescription cialis cheapest price viagra online stores cheap price cialis tramadol no prescription buy viagra discount cialis without prescription price of acomplia levitra prices purchase cialis online generic cialis buy tramadol cheap purchase soma online find cheap viagra soma prescription lowest price propecia find viagra online viagra price levitra online stores order viagra on internet buy cialis generic order cialis from us buy cheap cialis cheapest levitra soma discount acomplia pharmacy online pharmacy viagra order viagra online cheap cialis from usa ultram without prescription levitra online cheap acomplia tablets buy cheap propecia online drug viagra online purchase cheap viagra tablets where to buy tramadol find discount viagra online pharmacy cialis buy ultram cheap viagra from canada cheap cialis internet cheap cialis no rx tramadol without prescription acomplia cheap generic levitra cialis in australia generic ultram order levitra online no rx viagra buy ultram without prescription buy no rx viagra cheap cialis no prescription buy viagra from us where to buy acomplia viagra side effects cheapest generic cialis online generic acomplia cheap ultram tablets buy cialis lowest price viagra online without prescription ultram generic acomplia without a prescription buy cheapest viagra on line buy cheap viagra buy generic ultram cheap viagra in canada order acomplia cialis online cheap soma low cost cialis cheap cialis on internet cheapest generic viagra where to buy levitra cheapest cialis online order cialis in canada discount tramadol lowest price tramadol find viagra viagra free delivery viagra malaysia generic viagra buying viagra online cialis canada order cialis no prescription cialis medication viagra tablets viagra buy drug order viagra in canada cialis free sample levitra without a prescription cialis pill cialis buy drug ultram without a prescription cialis in malaysia where to buy soma cialis online without prescription cheapest viagra prices generic soma ultram pharmacy viagra cheap drug buy discount cialis order tramadol order cialis no prescription required buy cialis in canada buy discount cialis online soma cheap viagra online pharmacy viagra medication buy soma cheap cialis internet viagra sale buy viagra in us discount ultram buy tramadol without prescription cheap soma lowest price ultram order cialis overnight delivery viagra compare viagra prices online sale viagra order cheap cialis online cialis free delivery cialis information buy cialis no rx viagra internet order tramadol online discount levitra viagra online review online cialis acomplia online cheap find viagra no prescription required lowest price for cialis buy viagra online viagra drug pharmacy viagra cialis india cialis without rx purchase cialis no rx viagra overnight delivery propecia without prescription buy viagra cheap buy propecia without prescription viagra no prescription order acomplia online buy cheap acomplia online buy cheap ultram online cheap generic acomplia cheap cialis viagra information cheap cialis in canada purchase cialis without prescription lowest price soma buy soma without prescription buy viagra on internet find cheap cialis buy cheap propecia propecia online stores purchase cialis cialis no online prescription acomplia no prescription viagra without rx cialis australia viagra approved viagra in malaysia cialis order tramadol pharmacy cialis without prescription cialis sale buy generic viagra online find cialis on internet cialis purchase buy cheap viagra internet price of soma find discount cialis find no rx cialis levitra no prescription viagra canada cialis from india cheapest ultram prices discount viagra overnight delivery viagra in uk drug cialis propecia for sale levitra cheap order viagra without prescription where to order viagra cheap propecia online find discount viagra purchase soma viagra no rx generic viagra online cialis vendors cost of cialis online tramadol buy cheap tramadol lowest price cialis buying cialis online order discount viagra online cheapest cialis price cialis rx cialis no rx soma pharmacy ultram cheap cialis discount cost of viagra buy no rx cialis acomplia without prescription soma prices buy cialis from us lowest price acomplia order viagra from us discount soma viagra free sample where to order cialis order discount cialis purchase tramadol buy viagra from canada compare cialis prices cheap cialis pill buy cheap cialis online purchase tramadol online cheap cialis pharmacy acomplia generic propecia pharmacy buy viagra overnight delivery purchase levitra online cheap viagra pill buy cialis without prescription tramadol for sale viagra india propecia viagra buy online find viagra on internet buy viagra lowest price order discount cialis online order ultram online cost viagra cheap tramadol online best price for cialis acomplia discount buy levitra without prescription tramadol prices cheap viagra online propecia prices ultram pills buy generic acomplia cialis uk online levitra propecia discount drug cialis online purchase buy viagra internet ultram online tramadol generic cialis overnight shipping soma pills levitra pharmacy cheap viagra tablet cheap generic tramadol ultram online stores buy cheap acomplia buy discount viagra online generic propecia cialis malaysia viagra online cheap ultram online cheap viagra without a prescription buy cialis no prescription required cheapest viagra online free cialis cheap generic ultram viagra pharmacy levitra sale order soma tramadol discount purchase acomplia viagra cheap price buy viagra online cheap buy generic cialis fda approved cialis cheap cialis in usa ultram prices buy viagra no rx order generic viagra online ultram cheap cialis from uk cialis online pharmacy cialis prescription lowest price levitra buy cialis cheap levitra online sale cialis cialis us levitra pills propecia prescription generic tramadol cheapest tramadol prices cialis generic discount viagra online buy viagra on line online acomplia propecia online levitra for sale order viagra cheap online order propecia online cheapest levitra prices price of tramadol viagra from india buy propecia online fda approved viagra price of ultram levitra viagra purchase soma sale buy generic tramadol buy acomplia online discount viagra cheap soma online cheap cialis in uk buy discount viagra viagra vendors order viagra no rx discount cialis buy cialis online cheap cialis online stores buy soma viagra in us buy ultram online best price viagra cialis tablet buy ultram viagra pharmacy online cheap viagra without prescription find cialis no prescription required viagra no online prescription cheap levitra tablets discount propecia cheap viagra no prescription buy cheap levitra ultram where to buy propecia cheap acomplia find no rx viagra viagra generic overnight viagra ultram prescription cheap viagra from canada purchase ultram order cheap cialis acomplia pills viagra discount tablet cialis soma online cheap viagra australia cialis for sale purchase propecia cheap ultram generic cialis cheap generic cialis online cialis in bangkok buy levitra online cost cialis no prescription cialis lowest price for viagra find discount cialis online price of levitra cheap tramadol buy cialis from canada buy cheapest viagra cialis online review viagra cost levitra without prescription price of cialis drug viagra ultram for sale buy cialis internet viagra in bangkok viagra cheap compare cialis prices online cheap soma tablets certified viagra soma for sale buy cheap levitra online buy viagra in canada cheap levitra tablet viagra cheap viagra from usa viagra buy cialis no rx required buying generic cialis order viagra overnight delivery cialis no prescription propecia online cheap viagra prescription tramadol cheapest tramadol cialis in uk viagra cheapest price tramadol online cheap order cialis from canada buy levitra cialis overnight no rx cialis buy generic soma cialis tablets viagra no rx required viagra online buy generic levitra viagra overnight buy cialis overnight delivery approved viagra pharmacy viagra pill buy propecia cheap viagra no rx buy cheap tramadol online viagra sales best price cialis viagra overnight shipping find cialis viagra in australia cheap generic viagra tramadol sale propecia pills cialis side effects cialis buy cheapest cialis online cheapest ultram buy cheap cialis internet discount viagra without prescription discount viagra no rx buy acomplia without prescription acomplia cheap levitra online cheap acomplia for sale buy cheapest viagra online viagra order ultram no prescription buy soma online find viagra without prescription tramadol online discount cialis overnight delivery acomplia online cheap viagra on internet ultram sale buy cheap soma online propecia without a prescription cheap cialis from canada buy cialis in us buy acomplia cheap find cialis online viagra rx ultram discount order cheap viagra online tramadol without a prescription cheap generic soma order cheap viagra order generic cialis viagra uk order soma online tramadol prescription purchase viagra online propecia cheap cheap viagra pharmacy tramadol pills order levitra viagra tablet cheap acomplia online best price for viagra tramadol cheap levitra discount cheapest cialis prices cheap viagra in usa cheapest acomplia prices find cheap cialis online buy cheap viagra online no prescription viagra generic viagra cheap cheap price viagra purchase viagra levitra generic where to buy ultram cialis in us cheapest generic viagra online acomplia online stores cialis cheap drug soma online buy acomplia buy cialis low price cheapest generic cialis viagra for order where to buy cialis cialis cheap order cialis no rx soma no prescription approved cialis pharmacy order discount viagra propecia sale low cost viagra order cialis cheap online cheapest soma prices buy cialis on line buy generic cialis online cialis price cheap cialis tablets cheap viagra internet cialis pharmacy order cialis online viagra bangkok buy cheap ultram soma generic buy viagra generic cialis prices buy generic viagra viagra without prescription cheap ultram online cheapest acomplia buy cheapest cialis cialis cost

I spent the last several weeks working on a prototype application I’m calling RDFBurner. The purpose of this application is to provide a user interface that allows for the rapid composition of triples. The triples will be parsed and used to compose RDF. The user interface provides four entries:


  • Domain
  • Subject
  • Predicate
  • Object

The idea is that you type a new Domain in or choose an existing one from a list, then type or choose a subject, predicate and object. Then save that to create a new triple. Below the entries, you’ll see a list of previously entered triples. The intent behind the user interface is to provide instant visual feedback of your work. Seeing the triples laid out in a tabular modular fashion provides you with many clues as to what sorts of triples you would need to describe your particular domain.

Composing Triples with RDFBurner

During the construction of the prototype, I became frustrated with the complexity of the code. Simply developing the user interface, I could see already how the code was turning into a tangled web of gibberish. This is a fairly typical result when coding to Microsoft’s “Event Driven” programming paradigm. The idea of Events letting your program know that some thing has occurred such as a key press or a record selection is, on the surface, a good idea. But in practice, if you’re not careful (and Lord knows I’m careful but I want to see results quickly so I’m not that careful) you end up with a big mess. Crafting OOP classes helps to some degree but generally, the paradigm leads to sloppy difficult to follow code.

So, once again, I began to think about the challenge of managing the complexities of a user interface. I realize that it might be possible to de-couple the intent of the user from the features in the program, thereby adding some much needed programming structure. If a user gestures by pressing a key or clicking a record in a grid, I could simply make a note of it and move on. Later, a timer in the program would wake up periodically and process these gestures. When an event fires, the logic would be extremely simple as the only task is to queue up the user’s intent. Features in the program would be simplified as they could be coded as very atomic local scope processes.

  1. When an event fires such as Control_KeyDown or Form_SelectionChange, create a Gesture object that represents the intent of the user’s action.
  2. Using a map, translate that gesture object into one or more program features invocation objects.
  3. Send an invocation object to each active form/control that supports those features.

The code snippet below shows that during an event, we simply queue up a new Gesture object (that’s what LogGesture does). Presumably, some program feature is going to know what to do with the mouse and keyboard focus so the event framework’s key press is suppressed by setting the KeyCode equal to zero.

 Visual Basic |  copy code |? 
Private Sub Entry_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
    Case 9 'Tab key
        LogGesture Me.Tag & "_Entry_Tab", CStr(Shift)
        KeyCode = 0
    Case 40 ' Arrow Key Down
        LogGesture Me.Tag & "_Entry_Arrow", "Down"
        KeyCode = 0
    Case 38 ' Arrow Key Up
        LogGesture Me.Tag & "_Entry_Arrow", "Up"
        KeyCode = 0
End Select

Now later, a timer event will fire and process the Gesture objects waiting in the Queue. In my prototype, I have the timer set to 50 msec. This gives the application a nice snappy feeling. From the code snippet below, you should be able to see that the Gesture is translated into one or more Features. Each feature is supported by one or more forms. Each form is notified that the feature needs to be invoked.

 Visual Basic |  copy code |? 
Private Sub Form_Timer()
' Translate GlobalGestures Into Features
Dim pGesture As Gesture, pFeature As Feature, pFeatureQueue As FeatureQueue, pFormWithFeature As FormWithFeature, pFormsWithFeatureList As FormsWithFeatureList
For Each pGesture In globalGestures ' Process Gestures Loop
    Set pFeatureQueue = TranslateGestureIntoFeatures(pGesture)
    If Not (pFeatureQueue Is Nothing) Then
        For Each pFeature In pFeatureQueue
            Set pFormsWithFeatureList = GetFormsThatSupportFeature(pFeature)
            If Not (pFormsWithFeatureList Is Nothing) Then
                For Each pFormWithFeature In pFormsWithFeatureList ' For every form that supports the feature
                    pFormWithFeature.Form.FeatureQueue.Add pFeature ' queue up the feature - note this a form level object unlike the GestureQueue which is global
                    pFormsWithFeatureList.Remove pFormWithFeature ' We're done so get rid of the form from the list
                Next pFormWithFeature
            End If
        Next pFeature
    End If
Next pGesture
globalGestures.RemoveAll
Set pFeature = Nothing
' Check for any incoming feature requests
For Each pFeature In FeatureQueue ' Process incoming Features Loop
    DispatchFeature pFeature ' Execute the subroutine associated with the feature
Next pFeature
FeatureQueue.RemoveAll
End Sub

Finally, the code above is running in what I consider the “master” form which has it’s own queue of feature requests. The queues here are very simple. The DispatchFeature does nothing but checks the name of the Feature from the FeatureObject and calls the subroutine with the same name.


What about RDF?

Because I am building an RDF composition utility, it makes sense to encode the gesture to program feature map in RDF and use SPARQL to retrieve (parts of) the map at runtime. I’ve not done this yet in my current prototype. The purpose of the RDFBurner prototype is to compose triples that will be converted into RDF - a task which I have yet to program. The gesture to program feature mapping is currently implemented as an SQL Query against my rather simple triple store. Once I start actually generating RDF with the utility, I’ll refactor the translator portion to use RDF and SPARQL.

Inserting an RDF map into the Event logic of a typical application has some interesting connotations:

  • The resulting RDF could possibly be combined the mapping RDF of other applications, implying the compositions of a type of mash-up that works at the user interaction level.
  • Events are not the same as Gestures. For instance, when a user presses the up-arrow key while the focus is on the top row of a grid, the Event might be evntGrid_KeyPressed(UpArrow) while the gesture or intent of the end user is to move the focus to some other control above the grid, i.e. gstrGrid_Leave(Up). An Event is hardware/form/control kind of thing. A Gesture may be triggered by an Event but represents what the user really wants to do.
  • It highly likely that there should be a translation mapping in RDF between Events and Gestures.
  • Once the mapping is in RDF, it may be possible to infer patterns and sets of patterns, especially if the RDF is coaxed into OWL. We could use such inferred knowledge to generate at minimum a skeleton of the programming logic. Obviously other parts of a given application would make use of RDF knowledgebases and the combination of the classes involved could lead to an Ontology Driven Design.

Comments

Feel free to leave a comment...
and oh, if you want a pic to show with your comment, go get a gravatar!

You must be logged in to post a comment.