Workshop 6 (ws6C) native Entwicklung für mobile Geräte

20
© Zühlke 2013 Romano Roth Workshop 6 (ws6C) native Entwicklung für mobile Geräte Lektion 2: Service 18. February 2013 Folie 1 von 19

description

Workshop 6 (ws6C) native Entwicklung für mobile Geräte. Lektion 2: Service. Unser Plan. 18.2 (Romano) Einführung , « Mega CRM», Aufsetzen 25.2 (Romano) Einführung in Windows Phone 8 Entwicklung 04.3 (Romano) Umsetzung « Mega CRM» mit Windows Phone 8 - PowerPoint PPT Presentation

Transcript of Workshop 6 (ws6C) native Entwicklung für mobile Geräte

Page 1: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013

Romano Roth

Workshop 6 (ws6C) native Entwicklung für mobile GeräteLektion 2: Service

18. February 2013Folie 1 von 19

Page 2: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

Unser Plan

18.2 (Romano) Einführung, «Mega CRM», Aufsetzen

25.2 (Romano) Einführung in Windows Phone 8 Entwicklung

04.3 (Romano) Umsetzung «Mega CRM» mit Windows Phone 8

11.3 (Oliver) Einführung in Mono Entwicklung

18.3 (Oliver) Umsetzung «Mega CRM» mit MonoTouch

25.3 (Oliver) Umsetzung «Mega CRM» mit MonoDroid

01.4 Kein Workshop (Ostern)

08.4 (Michael) Einführung in iOS Entwicklung

15.4 (Michael) Umsetzung «Mega CRM» mit iOS

22.4 (Michael) Umsetzung «Mega CRM» mit iOS18. February 2013 Folie 2 von 19

Page 3: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

Lektion 2

• Der REST Service

• Ab damit in die die Cloud

• Retrospective (5’)– Was war gut?– Was kann verbessert werden?

18. February 2013 Folie 3 von 19

Page 4: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

Big Picture

Azure CloudREST Service

18. February 2013 Folie 4 von 23

Page 5: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

REST Representational State Transfer

• REST stammt aus der Dissertation von Roy Fielding aus dem Jahre 2000

• REST ist ein Architekturstiel– SOAP ist ein implementationsdetail einer RPC

Architektur

• Prinzipien– Adressierbarkeit

Eindeutige URI– Unterschiedliche Repräsentationen

z.B. HTML, JSON oder XML– Zustandslosigkeit – Operationen

GET, POST, PUT und DELETE– Verwendung von Hypermedia

Links auf weitere Resourcen

18. February 2013 Folie 5 von 19

Page 6: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

MEGA CRM REST Service

<Customer> <AssistantName>String</AssistantName> <Birthday>DateTime</Birthday> <City>String</City> <Company>String</Company> <Country>String</Country> <Department>String</Department> <Email>String</Email> <FaxNumber>String</FaxNumber> <FirstName>String</FirstName> <Id>Integer</Id> <Image>Byte</Image> <LastName>String</LastName> <ManagersName>String</ManagersName> <Margin>Integer</Margin> <MiddleName>String</MiddleName> <MobileNumber>String</MobileNumber> <Nickname>String</Nickname> <Office>String</Office> <PhoneNumber>String</PhoneNumber> <PostalCode>String</PostalCode> <Profession>String</Profession> <Sales>Integer</Sales> <State>String</State> <Street>String</Street> <Title>String</Title> <WebPage>String</WebPage></Customer

• GET– /customer

– Liste aller Kunden– /customer/{id}

– Kunde mit id=={id}

• POST– /customer

– Erstelle den Kunden

• PUT– /customer

– Ersetze den Kunden– Erstelle den Kunden

• DELETE– /customer/{id}

– Lösche den Kunden

18. February 2013 Folie 6 von 19

Page 7: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

Service Stack

• REST Web Service Framework für .NET und Mono– Web Services done right, REST Service done easy

;-)

18. February 2013 Folie 7 von 19

Page 8: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

• Eine Cloud verwendet man um Rechenkapazität, Datenspeicher, Netzwerkkapazitäten und Software dynamisch über das Netz zur Verfügung zu stellen.

• IaaS – Infrastructure as a Service – Cloud bietet virtualisierte Computerhardware (Rechenzenter).

• PaaS – Platform as a Service – Cloud bieten Laufzeitumgebungen (Service Provider)

• SaaS – Software as a Service –Anwendungsprogrammen in der Cloud. (Software bei Bedarf)

Cloud

18. February 2013 Folie 8 von 19

Page 9: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

• Windows Azure (kurz Azure) ist die Microsofts Cloud

• Features– Websites

– PaaS für alle Arte von WebSeiten– Virtual maschines

– IaaS Virtuelle Maschinen und Netzwerke– Cloud Services

– PaaS für Applikationen und Services– Data Management

– PaaS SQL Datenbank– Media Services

– PaaS für streamen und encoden von Medien

Windows Azure

18. February 2013 Folie 9 von 19

Page 10: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

• Datencenter– North America

– North-central US - Chicago, IL– South-central US - San Antonio, TX– West US - California– East US – Virginia

– Asia– East Asia - Hong Kong, China– South East Asia – Singapore

– Europe– West Europe - Amsterdam, Netherlands– North Europe - Dublin, Ireland

Windows Azure

18. February 2013 Folie 10 von 19

Page 11: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

Walktrough - Azure

1. Erstellen des Windows Azure Account

1. http://www.windowsazure.com

2. Klicke auf Free Trial und folge den Schritten

3. Klicke Windows Azure Homee Account Preview Features

4. Schalte das Web Sites Preview ein

Anleitung18. February 2013 Folie 11 von 19

Page 12: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

Walktrough – Setup Entwicklungsumgebung

1. Installiere Visual Studio 2010 oder 2012

2. Installiere Windows Azure SDKAzure SDK VS 2012Azure SDK VS 2010

Anleitung18. February 2013 Folie 12 von 19

Page 13: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

Walktrough – Erstellen einer Web Site

1. http://www.windowsazure.com

2. Portal

3. New Web Site Quick Create

1. Name: <NameOfWebSite>

Anleitung18. February 2013 Folie 13 von 19

Page 14: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

1. Visual Studio

2. New Project

3. ASP.NET MVC 4 Web Application

4. http://www.windowsazure.com

5. Zu der erstellten Web Seite <NameOfWebSite> gehen und Download publishing profile klicken

6. Visual Studio rechtsklick Solution Publish

7. Import des publishing profiles von <NameOfWebSite>

8. Validate Connection Publish

Anleitung ASP.NET MVC 4

Walktrough – Deploy einer Web Site

18. February 2013 Folie 14 von 19

Page 15: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

1. Download des Source Code 2013_02_18.zip

2. Öffnen der Solution

3. Build Clean Solution Rebuild Solution

4. Rechtsklick Service Properties Use Local IIS Web Server «localhost:50722» durch Euren Rechnernamen ersetzen. Create Virtual Directory

5. Commons.Common «localhost:50722» durch Euren Rechnernamen ersetzen.

6. Rebuild All

7. Visual Studio rechtsklick Service Publish

8. Import des publishing profiles von <NameOfWebSite>

Walktrough – Deploy des Mega CRM Services

18. February 2013 Folie 15 von 19

Page 16: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

Mega CRM Service

18. February 2013 Folie 16 von 19

Page 17: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

Mega CRM Service

18. February 2013 Folie 17 von 19

Page 18: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

ZTG.Customer.Client.WPF

18. February 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth Folie 18 von 19

MainWindow(View)

MainWindowViewModel

(ViewModel)MainWindowUiServi

ce(Model)

Customer

ViewModel

ZTG.Customer.Service

ZTG.Customer.DataAccess

CustomerService

CustomerDataAccess

*.Console

Console

*.Model

Customer

*.Common

Common

Page 19: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

• Service

• DataAccess– Achtung: Daten sind in Memory reset nach neustart /

redeploy– TestDataGenerator

• Model

• Common

• WPF Client

• Console Client

Der Code

18. February 2013 Folie 19 von 19

Page 20: Workshop 6 (ws6C)  native  Entwicklung für mobile Geräte

© Zühlke 2013Workshop 6 (ws6C) native Entwicklung für mobile Geräte | Romano Roth

Retrospective

• Was war gut?

• Was kann verbessert werden?

18. February 2013 Folie 20 von 19