DelphiMVCFramework
DelphiMVCFramework
Leverage the power of REST and JSON-RPC using the most popular framework for Delphi
About the Book
DelphiMVCFramework is a solid and proven framework to build websolutions. If you ever think to build a distributed system, DelphiMVCFramework is one of the best choice you could do.
Translations
About the Contributors
bit Time Professional Software Developer
bit Time Professionals Senior Software Developer
CEO at VEditIndia and Embarcadero MVP
Table of Contents
- Foreword
- Reviewers
- Collaborators
- Translations
- What users say about DMVCFramework
- Fetching This Book’s Code
- Using This Book’s Code
- Book Release Notes
-
Chapter 1: Getting Started with DelphiMVCFramework
- What you’ll learn
- DMVCFramework is “batteries included”
- Installation of DelphiMVCFramework 3.2.1-carbon
- Your first RESTful server with DelphiMVCFramework
- Your first DMVCFramework-style “Hello World”
- Built-in System Actions
- What’s Next
-
Chapter 2: Controllers and routing
- The Router
- MVCPath attribute
- Handling Parameters
- Query-String parameters
- URL mapped parameters
- Multiple Paths for a Single Action
- More about URL Mapped parameters
- Strongly Typed Actions
- MVCHTTPMethod attribute
- MVCProduces attribute
- MVCConsumes attribute
- MVCDoc attribute
- Action Filters
- What’s Next
-
Chapter 3: Renders
- What you’ll learn
- The Rendering Phase
- Rendering Data Must be Simple!
- Rendering Objects and List of Objects
- Customize Objects Serialization
- Rendering TStream descendants
- Rendering Nested Objects
- Serializing TDataset descendants
- Rendering Dictionaries
- Rendering images, pdf and other binary contents
- Rendering Exceptions
- Rendering Custom Data Structures
- Support HATEOAS in your APIs
- Deserialization
- Deserialize Simple Objects
- Deserializing List of Object
- Deserializing Hierarchical Structures
- The IMVCList Interface
- Sending Binary Contents
- Using multipart/form-data
- Custom Type Serializers
- Using custom serializer
- What’s Next
-
Chapter 4: Municipal Library System - The Database
- What you’ll learn
- The Municipal Library System
- The Database
- What’s Next
-
Chapter 5: Municipal Library System - The APIs
- What you’ll learn
- APIs design Overview
- Design an API for the Books Lending System
- The actual APIs
- What’s next
-
Chapter 6: Municipal Library System - Creating APIs using Datasets
- What you’ll learn
- The CRUD acronym
- Implementing the API using datasets
- What’s Next
-
Chapter 7: Municipal Library System - Creating APIs with MVCActiveRecord
- What you’ll learn
- The ActiveRecord Design Pattern
- ActiveRecord in MVCFramework a.k.a. MVCActiveRecord
- What’s Next
-
Chapter 8: Municipal Library System - Complete APIs with MVCActiveRecord
- What you’ll learn
- WebModule Configuration
- Establish a Database Connection
- TAuthorsController
- TControllerBase
- Handling pagination in TCustomersController.GetCustomers
- Terminate a lending
- Users management with TUsersController
- What’s Next
-
Chapter 9: Authentication & authorization
- What you’ll learn
- Authentication vs Authorization
- The Authentication/Authorization Subsystem
- Securing an API
- HTTP Basic Authentication
- JSON Web Token Authentication and Authorization
- Accessing Logged User Information
- What’s Next
-
Chapter 10: Middlewares
- What you’ll learn
- What’s a middleware?
- The IMVCMiddleware Interface
- Built-In Middleware
- CORS Middleware
- Compression Middleware
- Analytics Middleware
- Trace Middleware
- Static Files Middleware
- What’s Next
-
Chapter 11: Municipal Library System - Authentication and Authorization
- What you’ll learn
- How to choose an authentication schema
- Defining a roles system
- Create a Python client
- What’s Next
-
Chapter 12: JSON-RPC: why, when and how use it
- What you’ll learn
- JSON-RPC Overview
- JSON-RPC 2.0 Requests
- JSON-RPC 2.0 Notifications
- Response Error Object
- JSON-RPC vs REST
- Publishing PODOs
- The MVCInheritable Attribute
- Inspecting the published methods
- Defining Hooks
- What’s Next
-
Chapter 13: Document and test your REST API with the Swagger middleware
- What you’ll learn
- How to use
- MVCSwagSummary attribute
- MVCSwagAuthentication attribute
- MVCSwagParam attribute
- MVCSwagResponses attribute
- MVCSwagJSONSchemaField attribute
- MVCSwagIgnorePath attribute
- Simple Swagger Tutorial
- What’s Next
-
Chapter 14: Tips and Tricks
- Tip #1: Redirecting users to a different URL only when are using browser
- Tip #2: Don’t load system controllers
- Tip #3: Remove X-Powered-By Header
- Tip #4: Change or remove the Server Header
- Tip #5: Testing API using Python
- Tip #6: Storing users password
- Tip #7: Use RQL for simple query
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them