Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering ServiceStack

You're reading from   Mastering ServiceStack Utilize ServiceStack as the rock solid foundation of your distributed system

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher Packt
ISBN-13 9781783986583
Length 216 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Andreas Niedermair Andreas Niedermair
Author Profile Icon Andreas Niedermair
Andreas Niedermair
Arrow right icon
View More author details
Toc

Chapter 1. Distributed Systems and How ServiceStack Jumps in

ServiceStack is a powerful web service framework and it offers many possibilities. ServiceStack's adaptive nature makes the components of the framework fine-grained, which makes it crucial to understand the layout and its components:

  • ServiceStack: Lets you create your own service endpoint.
  • ServiceStack.Interfaces: It holds all the base interfaces that are used for the dependency injection-driven internals of ServiceStack. You can fully customize ServiceStack by implementing and registering one of these interfaces.
  • ServiceStack.Text: In this namespace reside various serialization utilities for JSON, JSV, and CSV. It also offers dynamic JSON processing, diagnostic extensions for printing a formatted dump of an object, URL extensions to deal with the common issues, such as encoding and decoding, stream extensions, and many more.
  • ServiceStack.Client: It contains the relevant clients to connect and consume JSON, XML, JSV, SOAP, and MQ services.
  • ServiceStack.Caching: It holds provider-specific endpoints that can be injected as caching storage (InMemory, Redis, Aws, Azure, Memcached, OrmLite …).
  • ServiceStack.OrmLite: It contains a fast micro-ORM with adapters for popular RDMBS, such as the SQL Server, MySQL, PostgreSQL, SQLite, and many others.
  • ServiceStack.Redis: It holds .NET's leading client for Redis, an open source and advanced key-value store.
  • ServiceStack.Authentication: It provides various authentication providers, such as OAuth, OAuth2, OpenID, in combination with its storage providers, such as OrmLite and NHibernate.
  • ServiceStack.Logging: This includes adapters for many logging frameworks such as Elmah, NLog, Log4Net, and EventLog to provide an interchangeable and loosely coupled logging experience.
  • ServiceStack.Razor: It lets you add a Razor view engine to your web service to provide a single stack implementation of your service and front-end.
  • Various other components, such as extensions to formats (ServiceStack.MsgPack and ServiceStack.Protobuf), web service client frameworks, such as ServiceStack.Api.Swagger, a bundler for web resources (ServiceStack.Bundler), a compiler for cross-platform native Desktop applications (ServiceStack.Gap), and many others.

Note

As the NuGet package names often do not match the namespaces within, the NuGet package names are mentioned separately.

Additionally, ServiceStack offers tools that are focused on simplicity and performance, so (development-) time can be spent on a hassle-free usage. This feature makes it a great alternative to Windows Communication Framework (WCF) and others.

Note

Note that some components are dependency free, such as ServiceStack.Text and ServiceStack.Client, which do not call for a coupled usage with ServiceStack.

One of the big ideas behind ServiceStack is the Code-First approach. Before you start to design your database, you should focus on the domain design and its Plain Old CLR Objects (POCOs), which then can be used through the components of your stack:

  • In Request and Response DTOs
  • In client projects by leveraging a shared assembly
  • As data models in your database
  • As entities in your cache and session
  • In serializers and configurations

Tip

If you ever find the need to apply ServiceStack to an existing database, it will be trivial to derive your POCOs from the database schema, especially, if you are dealing with a large pre-existing database and coupled usage in the codebase. Therefore, you can use T4 scripts that are bundled with ServiceStack.OrmLite, to code-gen your POCOs. You can find these at https://github.com/ServiceStack/ServiceStack.OrmLite/tree/master/src/T4.

You have been reading a chapter from
Mastering ServiceStack
Published in: Oct 2015
Publisher: Packt
ISBN-13: 9781783986583
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image