Top Banner
A Model-Driven, Component Generation Approach for the WoT Thesis
44
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Thesis Defence: A Model Driven Architecture for the Web of Things

A Model-Driven, Component Generation Approach for the WoTThesis

Page 2: Thesis Defence: A Model Driven Architecture for the Web of Things

Overview

• Vision• Historical and Technological Background• The xWoT• A component approach for the xWoT• Meta-Modeling• The xWoT Compiler• Methodology• Outlook

Page 3: Thesis Defence: A Model Driven Architecture for the Web of Things

INTRODUCTION& Vision

Page 4: Thesis Defence: A Model Driven Architecture for the Web of Things

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.

Page 5: Thesis Defence: A Model Driven Architecture for the Web of Things

BACKGROUNDHistorical and Technological

Page 6: Thesis Defence: A Model Driven Architecture for the Web of Things

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

Page 7: Thesis Defence: A Model Driven Architecture for the Web of Things

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)

Page 8: Thesis Defence: A Model Driven Architecture for the Web of Things

Meta-Model

• Given• α:S→M

• Then• ∃ SUS1, SUS2 S|∈

α(SUS1) = α(SUS2) ⇏SUS1 = SUS2

Page 9: Thesis Defence: A Model Driven Architecture for the Web of Things

Meta-Model

• Given• α′ : M → MM

• Then• ∃ m1,m2 M | α′∈

(m1) = α′(m2) ⇏ m1 = m2

Page 10: Thesis Defence: A Model Driven Architecture for the Web of Things

The xWoTAn Extension for the WoT

Page 11: Thesis Defence: A Model Driven Architecture for the Web of Things

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.

Page 12: Thesis Defence: A Model Driven Architecture for the Web of Things

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.

Page 13: Thesis Defence: A Model Driven Architecture for the Web of Things

COMPONENTSReusable xWoT Components

Page 14: Thesis Defence: A Model Driven Architecture for the Web of Things

Example

Page 15: Thesis Defence: A Model Driven Architecture for the Web of Things

Expected Output

• One component representing the floor.• One component for each instantiated door.

Page 16: Thesis Defence: A Model Driven Architecture for the Web of Things

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

Page 17: Thesis Defence: A Model Driven Architecture for the Web of Things

META-MODELINGThe xWoT Meta-Model

Page 18: Thesis Defence: A Model Driven Architecture for the Web of Things

Partial xWoT Meta-Model

Page 19: Thesis Defence: A Model Driven Architecture for the Web of Things

Full xWoT Meta-Model

Page 20: Thesis Defence: A Model Driven Architecture for the Web of Things

Smart Door Example (UC)

Page 21: Thesis Defence: A Model Driven Architecture for the Web of Things

Smart Door Example (HW)

Page 22: Thesis Defence: A Model Driven Architecture for the Web of Things

Smart Door Example (M)

Page 23: Thesis Defence: A Model Driven Architecture for the Web of Things

Smart Door Example (M)

Page 24: Thesis Defence: A Model Driven Architecture for the Web of Things

Smart Door Example (M)

Page 25: Thesis Defence: A Model Driven Architecture for the Web of Things

Smart Door Example (M)

Page 26: Thesis Defence: A Model Driven Architecture for the Web of Things

Smart Door Example (M)

Page 27: Thesis Defence: A Model Driven Architecture for the Web of Things

COMPILERA Model Compiler for the xWoT

Page 28: Thesis Defence: A Model Driven Architecture for the Web of Things

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.

Page 29: Thesis Defence: A Model Driven Architecture for the Web of Things

Smart Door Example (rev)

Page 30: Thesis Defence: A Model Driven Architecture for the Web of Things

Smart Door Example (rev)

Page 31: Thesis Defence: A Model Driven Architecture for the Web of Things

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.

Page 32: Thesis Defence: A Model Driven Architecture for the Web of Things

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.

Page 33: Thesis Defence: A Model Driven Architecture for the Web of Things

Smart Door Example (rev)

Page 34: Thesis Defence: A Model Driven Architecture for the Web of Things

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

Page 35: Thesis Defence: A Model Driven Architecture for the Web of Things

Smart Room Example (UC)

Page 36: Thesis Defence: A Model Driven Architecture for the Web of Things

Smart Room Example (UC)

Page 37: Thesis Defence: A Model Driven Architecture for the Web of Things

METHODOLOGY

Page 38: Thesis Defence: A Model Driven Architecture for the Web of Things

Three Steps

• Entity Modeling (blue)• Data Modeling (green)• Implementation (yellow)

Page 39: Thesis Defence: A Model Driven Architecture for the Web of Things

Methodology

Page 40: Thesis Defence: A Model Driven Architecture for the Web of Things

Entity Modeling

• Derive an xWoT compatible Model from the Use-Case diagrams.

• Refine the generated enhanced Model.

• Compile the xWoT Model to Code Skeletons.

Page 41: Thesis Defence: A Model Driven Architecture for the Web of Things

Data Modeling

• Describe Inputs and Outputs in a generic way (XML Schemas, Database Definition)

• Derive implementations from these schemas.

Page 42: Thesis Defence: A Model Driven Architecture for the Web of Things

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.

Page 43: Thesis Defence: A Model Driven Architecture for the Web of Things

CONCLUSION& Outlook

Page 44: Thesis Defence: A Model Driven Architecture for the Web of Things

Future Work

• Filtering of events for WebHook clients with a DSL.• What about Discovery?• What about Semantics?• Intelligent Discovery• Late Binding in Mashup Applications