Blog
All Blog Posts | Next Post | Previous PostTMS XData v1.0 released
Tuesday, August 19, 2014
We're pleased to introduce today TMS XData, another important part in the TMS Business Subscription line-up of tools & components to let you write better & faster business logic for local, Windows-only, cross-platform and multi-tier solutions, in short, the entire spectrum of Delphi applications you can develop.TMS XData is a full-featured Delphi framework that allows you to create HTTP/HTTPS servers that exposes TMS Aurelius, our Delphi ORM, objects through REST/JSON calls. With JSON being the defacto language for data communication via internet, these objects can be consumed by Delphi desktop or mobile clients but also any other client written in other languages.
TMS XData builds upon TMS Sparkle, the framework that offers classes for high performance HTTP/HTTPS client and server services for Windows, Mac-OSX, iOS, Android. TMS Sparkle is fully cross-platform but uses behind the scenes platform native APIs for the best possible performance.
To see how TMS XData can help you build multi-tier applications that consume TMS Aurelius ORM objects, suppose you have an Aurelius class mapped like the following.
[Entity, Automapping] TCustomer = class strict private FId: integer; FName: string; FTitle: string; FBirthday: TDateTime; FCountry: TCountry; public property Id: Integer read FId write FId; property Name: string read FName write FName; property Title: string read FTitle write FTitle; property Birthday: TDateTime read FDateTime write FDateTime; property Country: TCountry read FCountry write FCountry; end;
GET /tms/xdata/Customer(3) HTTP/1.1 Host: server:2001
{ "$id": 1, "@xdata.type": "XData.Default.Customer", "Id": 3, "Name": "Maria Anders", "Title": "Sales Representative", "Birthday": "1980-05-20", "Country": null }
You can perform changes to objects through the REST interface, using POST method to create new objects, DELETE to remove objects, and PUT or PATCH to update the objects. The following example will change the value of Title property of the customer resource specified in previous example:
PATCH /tms/xdata/Customer(1) HTTP/1.1 Host: server:2001 { "Title": "Marketing Manager" }
GET /tms/xdata/Customer?$filter=Country/Name eq 'USA'&$orderby=Name&$top=10 HTTP/1.1 Host: server:2001
There is much more to explore in this exciting new framework. You can get started by downloading the trial version for Delphi XE2.. XE6 at https://www.tmssoftware.com/site/xdata.asp and check out the full documentation
Bruno Fierens
This blog post has not received any comments yet.
All Blog Posts | Next Post | Previous Post