dontsios dimitris

36
Μοντελοποίηση μη λειτουργικών απαιτήσεων λογισμικού σε μοντέλα διαδικτυακών συστημάτων REST Θεσσαλονίκη, 16 Μαρτίου 2017 ΑΡΙΣΤΟΤΕΛΕΙΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΘΕΣΣΑΛΟΝΙΚΗΣ ΠΟΛΥΤΕΧΝΙΚΗ ΣΧΟΛΗ Τμήμα Ηλεκτρολόγων Μηαχνικών & Μηχανικών Υπολογιστών Εργαστήριο Επεξεργασίας Πληροφορίας & Υπολογιστών ΦΟΙΤΗΤΗΣ Δόντσιος Δημήτριος 7526 ― [email protected] ΕΠΙΒΛΕΠΟΝΤΕΣ Ανδρέας Λ. Συμεωνίδης Χριστόφορος Ζολώτας

Upload: issel

Post on 11-Apr-2017

22 views

Category:

Education


0 download

TRANSCRIPT

REST, 16 2017

& & 7526 [email protected] .

REST 1

2

.

.

.

+ .2

Richardson Maturity ModelRepresentational State Transfer: , , , , HTTP URI Glory of RESTLEVEL 3Hypermedia ControlsLEVEL 2HTTP VerbsLEVEL 1 ResourcesLEVEL 0The Swamp of POXRESTful 3

RESTful ;Representational State Transfer ( ) World Wide Web. To REST ( web) .

(resources) web based

. Web URI (Uniform Resource Identifier ) . URI , , , HTTP.

E RMM RESTful , .

tunneling transport protocol - ( POST) URI, profilebook.org/Users, XML.

.

2 . 2 HTTP .

HATEOAS (Hypertext As The Engine Of Application State), o 2 RESTful , . 3 -> hypermedia controls Hypermedia controlsare the combinations of protocol methods and link relations in an hypermedia format that tells the client what state transitions are available and how to perform them.

Anhypermedia format defines the contract between client and server. It's the hyperlink-enabled data format you are using for a particular representation of a resource in an hypermedia application.The point of hypermedia controls is that they tell us what we can do next, and the URI of the resource we need to manipulate to do it.3

Web / RESTful API4

: 20 .

,

, , .

Web APIs , , , ( Web APIs Internet of things ). APIs, www.programmableweb.com , 16.600 APIs, 9.500 RESTful

2 .

API

APIs , www.apihound.com, APIs 50.000

4 2020

, , Web APIs . .

web APIs, RESTful Web APIs, . WEB API, Django, EMF-REST Ruby on Rails. . 4

RESTful API

5

To Ruby on Rails (framework) Ruby. Open Source MVC Ruby

EMF-Rest, framework Eclipse Ecore. , o EMF-REST web Ecore. , EMF-Rest JAX-RS, JSON JavaScript API.

Django-REST-Framework framework RESTful . python.

RESTful web .

RMM, .

frameworks Hypermedia controls, RMM. hypermedia controls, web 5

S-CASE MDE Engine MDA RESTful API 3 RMM6

T S-CASE :

H 3 RM, RESTful.

hypermedia controls. , client HTTP , server hypermedia links . links URI . , .

RESTful . MDE Engine MDE . MDE Engine S-CASE RESTful API 3 RMM.

ATL MDE Engine.

6

REST, S-CASE, .

7

;

, S-CASE, RESTful API. , RESTful .

. 2 . ;

7

.

Model Driven Engineering MDE:

8

MDE?

8

S-CASE MDE Engine

S-CASE Architecture

Extension Metamodel9

S-CASE?

S-CASE REST , , , 3 RMM. , S-CASE RESTful Web API.

.

Computational Independent Model (CIM ). . , . , . , RESTful . , web, , .

M2M (model to model) CIM Platform Independent Model (PIM ). .

PIM Platform Specific Models (PSM ). PSM PIM , frameworks , , .

PSM. , .

9

Model to Model

EMF Ecore TechnologyAtlas transformation Language Eclipse M2MMatched RulesLazy RulesUnique Lazy RulesCalled Rulesunique lazy rule createAnnCRUDActivityHandler{fromCRUDActivityHandler : COREPIMIN!CRUDActivityHandlertoAnnCRUDActivityHandler: DESPIMOUT!AnnCRUDActivityHandler(annotatesCRUDActivityHandler 0)][javaMemento()/][/if][/if]11

Acceleois an open-source code generator from theEclipse Foundationthat allows people to use amodel-drivenapproach to building applications. It is an implementation of the "MOFM2T" standard, from theObject Management Group(OMG), for performing model-to-text transformation.

Open-source . ecore model to text 11

. 12 (audit trail)Reporting

. .

(audit trail). , , (auditing) . , 2 .Reporting. . , . . .. . . . . . . . . RESTful . . RESTful . . . , RESTful API stateless ( ), RESTful . rollback. edit post blog undo.

12

Reporting

13

.13

( properties resource/endpoint) .

/ resource/endpoint .

resource/endpoint .

HTTP resources/endpoints. Builder

Observer

Memento

Bridge14

Builder: query parameter . . .

Observer: , , , e-mail query

Memento: . .Command: Rollback

Bridge: . Command: .14

CIM CIM WizardCIMGenerator

PIM ATL m2m CIMtoPIM PIMGenerator

PSM ATL m2m PIMtoPSM PSM Generator

Acceleo m2t Acceleo m2t AnnotationLayerStack.ecoreCode Generator

RESTful API JAX RS Hibernate Annotations RESTful API15

H 15

DesignPatternsLayerCIM Metamodel 16 ecore

Builder Pattern: , .

client Director, Builder. Director uilder . O Builder Director . client uilder16

DesignPatternsLayerPIM Metamodel 17 ecore

pattern 17

DesignPatternsLayerPSM Metamodel ecore 18

pattern 18

DesignPatternsLayerCIM Metamodel 19

-- , , . To (subject) (observers)

To Subject . Observers. T ConcreteSubject ConcreteObserver . observer , subject. , o ConcreteObserver 19

DesignPatternsLayerPIM Metamodel 20

pattern 20

DesignPatternsLayerPSM Metamodel 21

pattern 21

DesignPatternsLayerCIM Metamodel 22

(abstraction) . . ,

Abstraction (/ ) , Implementor. Implementor . RefinedAbstractions Abstraction ConcreteImplementor

22

DesignPatternsLayerPIM Metamodel 23

pattern 23

DesignPatternsLayerPSM Metamodel 24

pattern 24

DesignPatternsLayerCIM Metamodel 25

Memento (), . , , .

25

DesignPatternsLayerPIM Metamodel 26

pattern 26

DesignPatternsLayerPSM Metamodel 27

pattern 27

RESTMarks - ERD28 . , , .

Code Generation

29

Code Generation

30

Code Generation

31

API Test

Model Driven Engineering Model Driven ArchitectureREST 4 .ecore49 .genmodel ecore .3 ATL 900 ATL25 Acceleo 7500 Acceleo1 wizard 2000 Java 1 Java EE EcoreATL Acceleo JAX-RS Hibernate PostgreSQL Jetty Maven Postman32

2 N java Observe ObservableHandlers Controller, Handler, Hibernate java classes

java resourceRepresentationModel.java Controller Handler Hibernate Annotations N abstract Controllers Handlers Controllers Handlers java resourceModelMemento.java Controller, Handler, Hibernate java classes 33

3 * brackets,

** LocMetrics34

35

, 16 2017