presentation evrythng

52
A Model-Driven, Component Generation Approach for the WoT University of Fribourg

Upload: andreas-ruppen

Post on 18-Aug-2015

97 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Presentation evrythng

A Model-Driven, Component Generation Approach for the WoTUniversity of Fribourg

Page 2: Presentation evrythng

Overview

• Vision

• Short Technological Background

• The xWoT

• A component approach for the xWoT

• Meta-Modeling

• The xWoT Compiler

• S2Mashup Editor

• Semantic Discovery for the xWoT

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 3: Presentation evrythng

INTRODUCTION& Vision

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 4: Presentation evrythng

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.

• Allow Models to be enhanced semantically.

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 5: Presentation evrythng

BACKGROUNDHistorical and Technological

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 6: Presentation evrythng

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)

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 7: Presentation evrythng

Meta-Model

• Given• α:S→M

• Then

• ∃ SUS1, SUS2 ∈ S|α(SUS1) = α(SUS2) ⇏SUS1 = SUS2

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 8: Presentation evrythng

Meta-Model

• Given• α′ : M → MM

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

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

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 9: Presentation evrythng

The xWoTAn Extension for the WoT

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 10: Presentation evrythng

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.

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 11: Presentation evrythng

Data Integration

• Mashups already rely on services like Facebook or Twitter.

• How to turn a Book into a Smart-Book?• Leveraging the power of established computational

resources to the WoT, e.g. Business Processes.

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 12: Presentation evrythng

Events

• Today: use of IoTaaS platforms like Xively.• Problem: Smart-Devices are no longer WoT Compliant.

Instead the IoTaaS Platform is.• Events must propagate in an (energy) efficient manner.• WebHooks: spare events, alerting• WebSockets: many events, live monitoring

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 13: Presentation evrythng

Components

• Hide the inner guts from clients.• Define a clear interface for users (RESTful).• Build reusable components.• Use Meaningful URIs.• Use Predictable URIs (plus HATEOAS)

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 14: Presentation evrythng

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.

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 15: Presentation evrythng

COMPONENTSReusable xWoT Components

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 16: Presentation evrythng

Corridor - ExampleUniversité de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 17: Presentation evrythng

Expected Output

• One component representing the corridor.• One component for each instantiated corridor.

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 18: Presentation evrythng

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/ variousSmartCorridor

http://service2.com/corridor/ GET

http://service2.com/corridor/{id} GET

http://service2.com/corridor/{id}/oc GET / PUT

http://service2.com/corridor/{id}/oc/pub/ various

http://service2.com/corridor/{id}/lu/ GET / PUT

http://service2.com/corridor/{id}/lu/pub/ various

Page 19: Presentation evrythng

META-MODELINGThe xWoT Meta-Model

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 20: Presentation evrythng

Partial xWoT Meta-Model

Virtual Entity

Resource

Actuator Resource

Sensor Resource

Service Resource

1..*

Publisher Resource

Context Resource

Physical Entity

Entity

0..1 1

DeviceTag SensorActuator

1..*

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 21: Presentation evrythng

Full xWoT Meta-Model

Virtual Entity

Resource

Actuator Resource

Sensor Resource

Service Resource

1..*

Publisher Resource

Context Resource

Physical Entity

Entity

0..1 1

DeviceTag SensorActuator

1..*

name: EStringmethod: MethodOperationoutput: MethodOutputinput: MethodInput

Method

style: MethodStyleMethodParam

style: MethodStyleVEntityParam

name: EStringtype: EString

ParamTEMPLATEQUERY

MethodStyleXMLJSONMULTIPARTRELATEDFORMNONE

MethodInputXMLJSONMULTIPARTRELATEDFORMNONE

MethodOutputGETPUTPOSTDELETE

MethodOperation

0..* 0..*

0..*

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 22: Presentation evrythng

Smart Door Example (UC)Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 23: Presentation evrythng

Smart Door Example (HW)Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 24: Presentation evrythng

Smart Door Example (M)Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 25: Presentation evrythng

Smart Door Example (M)Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 26: Presentation evrythng

Smart Door Example (M)Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 27: Presentation evrythng

Smart Door Example (M)Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 28: Presentation evrythng

Smart Door Example (M)Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 29: Presentation evrythng

COMPILERA Model Compiler for the xWoT

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 30: Presentation evrythng

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.

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 31: Presentation evrythng

Smart Door Example (rev)Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 32: Presentation evrythng

Smart Door Example (rev)Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 33: Presentation evrythng

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.

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 34: Presentation evrythng

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.

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 35: Presentation evrythng

Smart Door Example (rev)Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 36: Presentation evrythng

Reusability

• The Compiler takes care of:• The reusability of the generated components.• To create a new RESTful service for each Composite

(according to the composed flag).

• Of the Application Scenario Service

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 37: Presentation evrythng

Smart Room Example (UC)Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 38: Presentation evrythng

Smart Room Example (UC)Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 39: Presentation evrythng

METHODOLOGY

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 40: Presentation evrythng

Three Steps

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

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 41: Presentation evrythng

Methodology

Implement HTTP Responses

Define Entity

Model Entity

Physical2

Virtual

RESTSkeleton

ModelPhysical Entity

ModelVirtual Entity

RefineVirtual Entity

Create SeverSkeleton

Link Code to Hardware

Build Hardware

Model Representations

CreateXSD

Create Code Artifacts

Model Database

CreateERM

Forward Engineer

DB

Create Code

Artifacts

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 42: Presentation evrythng

S2MashupSmart, Semantic Mashup Editor

Page 43: Presentation evrythng

Ingredients

• Consumer friendly Mashup Editor (drag and drop).

• Include Semantics:• Discovery.

• Late-Binding.

• (Semi)-Automatic-Binding.

• Write once, deploy everywhere.

08/07/2015Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

Page 44: Presentation evrythng

08/07/2015Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

Page 45: Presentation evrythng

08/07/2015Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

Page 46: Presentation evrythng

DISCOVERYA quick Outlook

08/07/2015Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

Page 47: Presentation evrythng

Requirements

• Implement a discovery mechanism respecting RESTful principles (as far as applicable).

• Inject semantics into the discovery based on the meta-model.

• Extend semantics depending on a situation’s needs.• Adopt current standards (JSON-LD, Tuples)

08/07/2015Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

Page 48: Presentation evrythng

Limitations

• Implementation based on multicast/unicast between devices.

• Limited to the multicast network boundaries.• Startup a little wiggly.

08/07/2015Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

Page 49: Presentation evrythng

Demo08/07/2015

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

Page 50: Presentation evrythng

CONCLUSION& Outlook

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 51: Presentation evrythng

Benefits

• Allow fast prototyping.

• Support developers.

• Give end users the possibility to build re-usable mashup applications.

Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT

08/07/2015

Page 52: Presentation evrythng

Future Work

• Bring the different projects together• S2Mashup

• Semantics

• Discovery

• Meta-Model

• Propose a fully integrated tool for developers as well as for end users to either create new smart Things or exploit deployed ones.

08/07/2015Université de fribourg | FACULTÉ des sciences | Andreas / Ruppen | A Model-Driven, Component Generation Approach for the WoT