Upload
raju-golla
View
396
Download
0
Embed Size (px)
Citation preview
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
Raju Golla…………………………………….…………………………….
Microsoft.NET Web Services Architect………………………………..………………………………….
Introduction to Service Stack
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
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
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
Stack of services
Serializers
IoC container
ORM
Caching
Messaging
Security
Razor plug-In
Logging & profiler
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
Why ServiceStack?
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
Benchmarks
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
Benchmarks
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
Benchmarks
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
Benchmarks
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
Component Overview
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
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
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
Architecture
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
Architecture
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
Philosophy
Martin flower’s DTO pattern
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
ServiceStack: Architecture
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
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)
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
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.
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
Views in ServiceStack
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
Views in ServiceStack
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
Installing Razor
• Package manager console
• PM>install-package -servicestack.Razor• Reference: razor.servicestack.net• Registar in Global.asax
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
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/
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
References
Martin flower (Data Transfer Objects)http://martinfowler.com/aboutMe.html
………………………………………………………………………………………………………………………………………….……………………………………….…..……………………………
……………………………………………………………………………………………………………………………………………………………………………………….……………………………….
UK DATA ARCHIVE
Hands on