22
………………………………………………………………………………………………………………………………………….……………………………………….…..…………………………… ……………………………………………………………………………………………………………………………………………………………………………………….………………………………. UK DATA ARCHIVE Raju Golla …………………………………….……………………………. Microsoft.NET Web Services Architect ………………………………..…………………………………. Introduction to Service Stack

ServiceStack

Embed Size (px)

Citation preview

Page 1: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

Raju Golla…………………………………….…………………………….

Microsoft.NET Web Services Architect………………………………..………………………………….

Introduction to Service Stack

Page 2: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

ServiceStack: Overview

An alternative to WCF, ASP.NET Web API

•Focused on simplicity and speed•Code first•POCOs•Strong typing•Auto configuration of formats

• XML, JSON, HTML, CSV and JSV (JSON-like Separated Values)•Endpoints

• REST, RPC, SOAP

Page 3: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

Stack of services

Serializers

IoC container

ORM

Caching

Messaging

Security

Razor plug-In

Logging & profiler

Page 4: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

Why ServiceStack?

Page 5: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

Benchmarks

Page 6: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

Benchmarks

Page 7: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

Benchmarks

Page 8: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

Benchmarks

Page 9: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

Component Overview

Page 10: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

ServiceStack: Architecture

No new concepts or constructs Built on top of ASP.NET IHttpHandlers Legacy ASP.NET providers abandoned Simple and clean Caching, Session and Authentication providers

based on POCOS supports multiple back-ends

Page 11: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

Architecture

Page 12: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

Architecture

Page 13: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

Philosophy

Martin flower’s DTO pattern

Page 14: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

ServiceStack: Architecture

Page 15: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

ServiceStack for client application

• Implement client applications replacing MVC or any other tool

• Create Views using Razor (Templating languge)

• Render views

• Use existing service as controller• Don’t use controllers at all (static content)

Page 16: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

ServiceStack for client application

• Respond differently for computer and Human(Browser)

• when computer requests for data return JSON, XML• when human html (render), which is called into view.

Page 17: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

Views in ServiceStack

Page 18: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

Views in ServiceStack

Page 19: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

Installing Razor

• Package manager console

• PM>install-package -servicestack.Razor• Reference: razor.servicestack.net• Registar in Global.asax

Page 20: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

References

ServiceStack•http://www.servicestack.net /

Github•https://github.com/ServiceStack/ServiceStack

Architecture overview•https://github.com/ServiceStack/ServiceStack/wiki/Architecture-overview

ServiceStack VS ASP.NET Web APIhttp://stackoverflow.com/questions/9699083/servicestack-vs-asp-net-web-api

Binaries on nugethttp://nuget.org/packages/ServiceStack

IoC containerhttp://funq.codeplex.com/

Page 21: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

References

Martin flower (Data Transfer Objects)http://martinfowler.com/aboutMe.html

Page 22: ServiceStack

………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………

……………………………………………………………………………………………………………………………………………………………………………………….……………………………….

UK DATA ARCHIVE

Hands on