SLIDE 1 A ¡Model-‑Driven ¡Approach ¡for ¡ Incorpora4ng ¡Reac4ve ¡Rules ¡ ¡ in ¡Declara4ve ¡Interac4ve ¡TV ¡ Applica4ons ¡
Patrícia ¡Dockhorn ¡Costa, ¡João ¡Paulo ¡A. ¡Almeida, ¡Igor ¡Magri ¡ Vale, ¡Izon ¡Thomaz ¡Mielke ¡ CS ¡Department, ¡Federal ¡University ¡of ¡Espírito ¡Santo, ¡Brazil ¡ ¡ ¡ pdcosta@inf.ufes.br, ¡jpalmeida@ieee.org, ¡ igormagrivale@gmail.com, ¡izontm@gmail.com ¡
SLIDE 2 Context-‑Aware ¡Applica1on ¡
Context ¡ Applica1on ¡
Context-‑aware ¡applica1on ¡is ¡a ¡distributed ¡applica1on ¡ whose ¡behaviour ¡is ¡affected ¡by ¡its ¡users’ ¡context. ¡
SLIDE 3
Some ¡Applica1on ¡Areas ¡
§ Health ¡Care; ¡ § Smart ¡Home; ¡ § Business ¡Processes; ¡ § Social ¡Network; ¡ § Network ¡Security; ¡ § Interac4ve ¡Digital ¡TV. ¡
SLIDE 4
Basic ¡Requirements ¡
Capture ¡ Process ¡ React ¡
SLIDE 5
Capture ¡Context ¡and ¡Model ¡ Behaviour ¡
SLIDE 6
Various ¡Sensors ¡in ¡a ¡ Distributed ¡environment ¡
SLIDE 7
Suppor1ng ¡Context-‑Aware ¡ Applica1on ¡Development ¡
SLIDE 8 Suppor1ng ¡Context-‑Aware ¡ Applica1on ¡Development ¡ (cont.) ¡
§ Quite ¡some ¡work ¡on ¡that: ¡ ¡ § context-‑aware ¡paMerns; ¡ § services ¡plaNorm ¡(context ¡sources, ¡managers, ¡ controllers, ¡ac1on ¡resolvers, ¡etc.); ¡ § context ¡and ¡situa1on ¡models; ¡ § situa1on ¡reasoning ¡and ¡(distributed) ¡detec1on; ¡ § ECA ¡language ¡for ¡modelling ¡reac1ve ¡behaviours, ¡
SLIDE 9
The ¡SBTVD ¡
§ BeMer ¡quality ¡of ¡images/videos; ¡ § Provides ¡interac1vity; ¡ § Includes ¡standards ¡for ¡data ¡modula1on, ¡ transmission, ¡data ¡encoding, ¡and ¡a ¡ middleware ¡(coined ¡Ginga). ¡
SLIDE 10 Middleware ¡Ginga ¡
(SOARES e CASTRO, 2008) ¡
SLIDE 11 Nested ¡Context ¡Language ¡
§ Hypermedia ¡authoring ¡language ¡used ¡to ¡ describe ¡mul1media ¡applica1ons ¡with ¡space-‑ 1me ¡synchroniza1on ¡between ¡media ¡objects ¡ (e.g., ¡video, ¡audio, ¡images, ¡etc.); ¡ ¡ § As ¡such, ¡it ¡does ¡not ¡have ¡built-‑in ¡concepts ¡for ¡ context-‑handling ¡and ¡reac1vity; ¡ § NCLua ¡
§ Scrip1ng ¡language; ¡ § Allows ¡execu1on ¡of ¡impera1ve ¡code ¡in ¡the ¡ declara1ve ¡environment. ¡
SLIDE 12
§ Domain-‑specific ¡language; ¡ § Rule-‑based; ¡ § Describes ¡the ¡reac1ve ¡behaviour ¡of ¡context-‑ aware ¡applica1ons ¡in ¡the ¡Interac1ve ¡TV ¡ Domain; ¡ ¡ § In ¡line ¡with ¡the ¡event-‑condi4on-‑ac4on ¡paMern; ¡ § Rules ¡are ¡defined ¡based ¡on ¡both ¡context ¡and ¡ situa1on ¡models ¡(vocabulary ¡for ¡rule ¡ defini1on). ¡
ECA-‑DL ¡TVD ¡
SLIDE 13 MDA ¡Approach: ¡Overview ¡
Context ¡and ¡ Situa4on ¡ ¡ Models ¡(UML ¡ Profile ¡ ECA-‑DL ¡TVD ¡ Rules ¡ Context-‑Aware ¡Applica1on ¡Models ¡ Controller ¡ (NCL ¡ Document) ¡ Context ¡ Sources ¡ Ac4on ¡ Resolvers ¡ Context-‑Aware ¡Applica1on ¡ (implementa1on) ¡ T1 ¡ Context ¡Manager ¡ PlaNorm ¡ Ginga ¡PlaNorm ¡ developer ¡
SLIDE 14 Transforma1on ¡Overview ¡
ECA-‑DL ¡TVD ¡ metamodel ¡ transforma1on ¡ specifica1on ¡ NCL ¡ metamodel ¡ context ¡and ¡ situa1on ¡models ¡ and ¡ECA-‑DL ¡rules ¡ NCL ¡model ¡ NCL ¡document ¡ (XML-‑like) ¡and ¡ NCLua ¡scripts ¡ transforma1on ¡ ac1vi1es ¡ (eclipse ¡tools) ¡ transforma1on ¡ language ¡(java) ¡
instance ¡of ¡ defined ¡in ¡ ¡ terms ¡of ¡ defined ¡in ¡ ¡ terms ¡of ¡ instance ¡of ¡ instance ¡of ¡ generated ¡by ¡
SLIDE 15 John uses a web- based bank application through his TV
Case ¡Study ¡
Context-aware bank application that hides private information autonomously
SLIDE 16
Context-‑Aware ¡Applica1on ¡ in ¡NCL ¡
SLIDE 17
Case ¡Study: ¡Context ¡Model ¡
SLIDE 18 Case ¡Study: ¡Situa1on ¡Model ¡
§ Situa1on ¡“One ¡person ¡in ¡the ¡room”: ¡
SLIDE 19 Case ¡Study: ¡Situa1on ¡Model ¡
§ Situa1on ¡“Accessing”: ¡
SLIDE 20 ECA-‑DL ¡TVD ¡rules ¡
Upon ¡EnterTrue ¡Situa1onAccessing ¡(person1) ¡ When ¡Situa1onOnePersonInRoom ¡(room1) ¡ Do ¡startWithBalance(account1) ¡ ¡ ¡ Upon ¡EnterTrue ¡Situa1onAccessing ¡(person1) ¡ When ¡Situa1onMoreThanOnePersonInRoom ¡(room1) ¡ Do ¡startWithoutBalance(account1) ¡ ¡ ¡ Upon ¡EnterTrue ¡Situa1onOnePersonInRoom ¡(room1) ¡ Do ¡showBalance(account1) ¡ ¡ ¡ Upon ¡EnterTrue ¡Situa1onMoreThanOnePersonInRoom ¡(room1) ¡ Do ¡hideBalance(account1) ¡ ¡ ¡ Upon ¡EnterTrue ¡Situa1onNoPersonInRoom ¡(room1) ¡ Do ¡logout(account1)
SLIDE 21
Ecore ¡Model ¡
SLIDE 22 En11es, ¡Context ¡and ¡ situa1ons ¡in ¡NCL ¡
§ En11es: ¡mapped ¡to ¡Media ¡elements; ¡ § Intrinsic ¡context ¡types: ¡mapped ¡to ¡Property ¡ Anchor ¡elements; ¡ § Rela1onal ¡Context ¡types ¡and ¡Situa1on ¡types: ¡ mapped ¡to ¡Media ¡elements, ¡whose ¡proper1es ¡ are ¡the ¡en11es ¡and ¡contexts ¡involved ¡in ¡that ¡
SLIDE 23 Generated ¡NCL ¡Document ¡
§ En11es ¡and ¡Intrinsic ¡Context ¡types: ¡ § Rela1onal ¡Context ¡types: ¡
… <media id="Presence_person1_room1" src="scripts/Presence_person1_room1.lua" descriptor="Presence_person1_room1_Desc"> <property name="person" value="person1" /> <property name="place" value="room1" /> <property name="value" value=" " /> <property name="exists" value="false" /> </media> … … <media id="person1" src="scripts/person1.lua" descriptor="person1Desc"> <property name="name" value=" " /> </media> …
SLIDE 24 Rules ¡in ¡NCL: ¡connectors ¡ and ¡links ¡
§ Used ¡to ¡implement ¡synchronism ¡between ¡NCL ¡ elements ¡ ¡
§ E.g.: ¡at ¡the ¡end ¡of ¡a ¡video, ¡starts ¡another ¡video ¡
§ Allows ¡(with ¡some ¡adapta1on) ¡ implementa1on ¡of ¡context-‑aware ¡reac1on ¡ rules ¡(ECA-‑DL ¡TVD ¡rules) ¡
SLIDE 25 Generated ¡Context ¡ Situa1ons ¡
… <causalConnector id="SituationMoreThanOnePersonInRoom_room1_EnterFalse"> <compoundCondition operator="and"> <simpleCondition role="upon10" transition="stops" eventType="attribution" /> <assessmentStatement comparator="lte"> <attributeAssessment role="when8" attributeType="nodeProperty" eventType="attribution" /> <valueAssessment value="1"/> </assessmentStatement> </compoundCondition> <simpleAction role="action11" actionType="set" eventType="attribution" value="true" / > </causalConnector> … <link xconnector="SituationMoreThanOnePersonInRoom_room1_EnterFalse"> <bind component="Presence_person1_room1" interface="value" role="upon10" /> <bind component="Presence_person1_room1" interface="value" role="when8" /> <bind component="SituationMoreThanOnePersonInRoom_room1" interface="end" role="action11" /> </link> …
Upon onEndAttribution (room1.has.value) When room1.has.value <> 1 Do EnterFalse SituationOnePersonInRoom (room1)
SLIDE 26 Generated ¡ECA-‑DL ¡TVD ¡
… <causalConnector id="eca_dl_tvd_rule3"> <compoundCondition operator="and"> <simpleCondition role="upon11" /> <assessmentStatement comparator="eq"> <attributeAssessment role="upon12" attributeType="nodeProperty" eventType="attribution" /> <valueAssessment value="true"/> </assessmentStatement> </compoundCondition> <simpleAction role="action14" actionType="set" eventType="attribution" value="true" /> </causalConnector> … <link xconnector="eca_dl_tvd_rule3"> <bind component="SituationOnePersonInRoom_room1" interface="start" role="upon11" /> <bind component="SituationOnePersonInRoom_room1" interface="start" role="upon12" /> <bind component="account1" interface="showBalance" role="action14"/> </link> …
Upon EnterTrue SituationOnePersonInRoom (room1) Do showBalance(account1)
SLIDE 27
§ Our ¡approach ¡provides ¡high-‑level ¡abstrac4ons ¡ to ¡express ¡applica1on ¡behavior ¡conveniently ¡in ¡ terms ¡of ¡context ¡events ¡and ¡corresponding ¡ applica4on ¡reac4ons; ¡ § Main ¡challenge: ¡transforming ¡a ¡rule-‑based ¡ specifica1on ¡at ¡the ¡plaNorm-‑independent ¡level ¡ into ¡an ¡implementa1on ¡plaNorm ¡that ¡is ¡not ¡ rule-‑oriented, ¡while ¡preserving ¡conformance ¡to ¡ the ¡standard. ¡
Final ¡Considera1ons ¡
SLIDE 28 § Improving ¡the ¡ECA-‑DL ¡TVD ¡editor ¡(which ¡is ¡ currently ¡the ¡standard ¡tree ¡editor ¡generated ¡by ¡ Eclipse); ¡ § Looking ¡into ¡mobile ¡interac1ve ¡TV ¡context-‑ aware ¡applica1ons: ¡
§ NCL ¡at ¡the ¡set-‑top ¡box ¡and ¡rule-‑based ¡ implementa1ons ¡on ¡back-‑end ¡servers ¡(Drools?); ¡ § Cope ¡with ¡scalability ¡challenges ¡that ¡arise ¡from ¡ managing ¡a ¡large ¡number ¡of ¡mobile ¡devices ¡and ¡ context ¡sources. ¡
¡
On-‑going ¡and ¡Future ¡Work ¡
SLIDE 29
Thank ¡you! ¡