a model-driven, component generation approach for the web of things
TRANSCRIPT
Overview
• Vision• Historical and Technological Background• The xWoT• A component approach for the xWoT• Meta-Modeling• The xWoT Compiler• Methodology• Outlook
Vision
• Instead of finding better approaches on how to combine smart devices we have to re-think how to build smart devices.• The current WoT needs to be extended to take into
consideration algorithms and handle events gracefully.• Re-usable and easy to deploy components, taking care of
aspects like events (and discovery in the future) are the way out of the “things-crisis”.
• Adopt Model Driven Architecture.
REST vs. ROA
REST• Client-Server• Statelessness• Cache• Uniform Interface• Layered System• Code-on-demand
ROA• Concepts
• Resources• Representations• URIs
• Properties• Uniform Interface• Addressability• Statelessness• Connectedness
Software Components
• According to Cox the solution to the software crisis in the early 80’s.
• A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only. A software component can be deployed independently and is subject to composition by third parties. (Szyperski)
WoT Problems
• Data Integration: Treat Algorithms and other RESTful services as first class citizens.
• Event Architecture: Define a common event architecture suitable for a wide range of applications.
• Building Blocks: Introduce components as the building blocks of the xWoT.
Formal Definition
• The extended WoT is a web made of sensors, actuators and tags forming the classical WoT plus services respecting RESTful principles.
• The aim of the xWoT is to introduce a standard approach on how to design the building blocks for novel applications and mashups exploiting the capabilities offered by smart things and other virtual goods. To achieve this goal, the xWoT introduces a component- based methodology which is underlined by a meta-model guiding the developers during crucial architectural decisions. Finally, since the architecture respects the xWoT’s meta-model, component skeletons are generated out of the specifications.
SmartDoor Component
http://service1.com/door/ GET
http://service1.com/door/oc/ GET / PUT
http://service1.com/door/oc/pub/ various
http://service1.com/door/lu/ GET / PUT
http://service1.com/door/lu/pub/ various
SmartFloor
http://service2.com/floor/ GET
http://service2.com/floor/{id} GET
http://service2.com/floor/{id}/oc GET / PUT
http://service2.com/floor/{id}/oc/pub/ various
http://service2.com/floor/{id}/lu/ GET / PUT
http://service2.com/floor/{id}/lu/pub/ various
Model Enhancer
• Since there is a one-to-one mapping from the Physical Entity to the Virtual Entity, for each physical model, its virtual side can be generated.
• The generated virtual side can be further refined manually.• Takes as input an xWoT Model and generates a new, enhanced
xWoT Model.• Where additional information is needed, the compiler asks for
user input.
Model Compiler
• Once the model finished, it can be compiled into code skeletons.• The compiler takes care of:• Resources hierarchy.• Allowed Methods.
• It can generate:• Python Code (Autobahn)• Node.js• Etc.
Model Compiler
• Takes as input an xWoT model and automatically generates a REST service for each component.
• Each components contains code skeletons to be filled in by the developer.
Reusability
• The Compiler takes care of the reusability of the generated components.
• For each Composite, the compiler takes care to create a new RESTful service (if necessary)
• The Compiler takes care of the Application Scenario Service
Entity Modeling
• Derive an xWoT compatible Model from the Use-Case diagrams.
• Refine the generated enhanced Model.
• Compile the xWoT Model to Code Skeletons.
Data Modeling
• Describe Inputs and Outputs in a generic way (XML Schemas, Database Definition)
• Derive implementations from these schemas.
Implementation
• Create one Application Scenario Service.• Create one Service for each Component.• Implement the Hardware.• Fill in the missing parts in the generated skeletons.• Link the Hardware to the REST service.