Category Archives: Intermediate

Articles for seasoned developers

Master Detail data in RAD Server using TEMSDataSetResource

Master Detail data in RAD Server

The TEMSDataSetResource is a very powerful component that enables rapid development of full document REST API’s for TDataSet using RAD Server. Using TEMSDataSetResource, along with traditional master detail relationship configurations, it is possible to expose, and automatically document data APIs via REST with no code at all.

In this article, I will cover sharing master detail data with no code, but also how to roll your own REST endpoint to cover more advanced detail with detail embedded calls.

In my previous article, I updated advise on getting started with Swagger UI, using the new WebFiles feature of RAD Server (from 10.3.2) as a way to view your documentation as you build your backend services API. This article will build upon the sample application created in that post.

Continue reading Master Detail data in RAD Server using TEMSDataSetResource

InterBase Temporary Tables

InterBase Temporary Tables

This last week, InterBase 2020 has been released bringing the awesome Tablespaces feature into play. This new feature enables splitting the database into groups of tables (a Tablespace) that can then be put onto different physical disks (to aid performance) but also enables partial backup of a database. I plan to cover this new feature, and some useful ideas about how to use them in an article in the coming weeks, but first, I want to address something a bit older in InterBase that I’ve not blogged about before. Why? Well recently, I was at a UK roadshow event, when content about InterBase 2020 was being previewed, and a developer said “This new stuff is cool, but what I really need is the ability to put data into a table temporarily in InterBase, and have it isolated from other transactions…. Other databases have it, when will InterBase get it?” Well, InterBase has had this for years!

Continue reading InterBase Temporary Tables

LiveBindings for VCL Developers – Webinar!

LiveBindings for VCL Developers [Webinar]

Visual LiveBindings is a technology that allows you to bind your data and objects (model) to the UI making. While LiveBindings is a key part of FireMonkey development, it is often overlooked by VCL developers.

A while ago I started a series of blogs on LiveBindings and how to use them with existing VCL applications. Covering seven blog posts, I looked at

  1. LiveBinding to DataSets
  2. LiveBinding to Objects
  3. Creating LiveBindings via Code
  4. Master Detail relationships (and objects as properties)
  5. Advanced Master Detail Relationships
  6. Mashing up Master Detail on different sources
  7. Helpful classes for LiveBindings

Following a high amount of demand and questions, you now have you chance to see me present live on this topic and ask your LiveBindings questions. Join me on Wednesday 31st August at 10am GMT.

Register now via community.embarcadero.com

The webinar will be followed by the live Q&A session.

InterBase Array Fields and FireDAC

InterBase Array Field

The IoT Award Winning database InterBase, has for a long time supported the ability to store data in an array field type. This was originally introduced as a new field type to reduce API calls and speed up data write time for a specific Boeing project many years ago. Writing each value into an array can also simplified the data model as well as benefiting database performance.

While array field in InterBase have been around for a long time, they have not aways been that easy to access from the components layer reducing their adoption.

With the growth of IoT, and the ability to store multiple data points per record becoming much more common place today, the ability to work with data in the InterBase array field type using FireDAC components has been added to 10.1 Berlin.

Explore the sample in depth, and get the link the sample below. Continue reading InterBase Array Fields and FireDAC

Accessing the address book on iOS and Android

Address Book development on iOS and Android

Accessing the Address Book on iOS and Android is a common request for many developers building line of business applications; quickly followed by “and how do I dial a phone number from code“. In this post I will explore how to explore the mobile Address Book using a common code base that works on iOS and Android using TAddressBook. (list to samples and documentation at the bottom of this article)

TAddressBook

With the launch of RAD Studio 10.1 Berlin, Delphi, C++ Builder,  comes a new component, TAddressBook, that enables easy access to the Address Book on iOS and Android.

The TAddressBook lives under Services section of the tool palette and consists of two and has very little in the way of Component properties. It does however have two events that are very useful, and a number of run time methods to call.

TAddressBook Component Events
TAddressBook Component Events

The two events provide notification when the address book has been changed (outside the application) and the result of the application asking for access to the address book.

Continue reading Accessing the address book on iOS and Android

Building Delphi Classes from JSON

JSON to Delphi Classes

I’m currently working on a new blog post showing how to integrate a popular REST API. One of my tasks is to convert JSON to Delphi Objects, so I need to define the Delphi class structures to work with so I can use the TJSON.JSONToObject that I covered previously. I decided to see if anyone had done work to convert JSON into Delphi classes.

Thankfully YES! I found this really handy project JsonToDelphiClass on GitHUB by . The project in covered in the post Introducing JsonToDelphiClass.

The JSON to Delphi Project is a Delphi FMX application that has a simple UI that allows you to modify the automatically created JSON class names which is pretty useful and the code worked first time when copied into my sample. (although I have more playing to do)

The JSON to Delphi tool is definitely a useful resource to work alongside the REST Debugger that you can find in the BIN directory of your RAD Studio install.

Stay tuned for the blog post when it arrives, but in the mean time, if your working with the REST components, I would recommend checking out Petar’s project along side my earlier post on Integrating Microsoft Azure Translation Services into Delphi.

 

Delphi 64bit Code

Updating 32bit code to Delphi 64bit

Ever since Delphi XE2, it has been possible to generate Delphi 64bit applications from the same code base as your traditional Windows 32bit Delphi code. The business case for 64-bit for business is covered in this tech paper The Impact of 64-bit Applications to your Company’s Bottom Line.

On the whole moving to 64bit (on iOS or Windows) is beautifully simple to achieve! It can be just as simple as adding the Delphi 64bit Windows target platform in the project manager and rebuilding the project.

My experience from talking to many developers who have moved up is that normally there are a few things to check in your code but typically its not a massive task to get compiling and ready to test.

A lot has been recorded on moving from Windows 32bit to Windows 64bit Delphi and this should be a useful summary if your just planning now moving up from older versions of Delphi to Delphi 10. If you are building iOS applications, then you will need to use the 64bit build now to get into the AppStore. Thankfully, Delphi has made the task of using 64bit very simple across all platforms and protected us from the headaches non Delphi Developers have had on the whole.

Lets start with this short video from David I who covers some the foundations in 7 minutes!

Continue reading Delphi 64bit Code

LiveBindings in VCL – Part 7 – More LiveBinding Classes

In my earlier posts on Delphi Visual Live Bindings I looked at how to link to bindings via code.

There are a number of classes that help along the way but there are two specific categories of classes and that is what I want to cover in this post.

LiveBindings and List v Link

Sometimes you want to fill a list with values; sometimes you want to keep a list of values updated; this is in essence the difference between using List (e.g. TBindList, TBindGridList) and Link (e.g. TBindListLink, TBindGridLink)

TBindList will fill a list with values, if the data/objects linked to changes then the data will not update unless you manually tell the list to re-populate using the bindings FillLists property.

TBindListLink however will keep the list in sync.

Before you continue… look at the samples

I recommend playing with the “OneOfEach” sample in the samples directory.

{samples}\LiveBindings\oneofeach\vcl

Try changing the fish name in the TBindGridLink and seeing how it updates over the other tabs where the FishFacts data is used.

What is a Binding Source and how is it different to the Control?

Continue reading LiveBindings in VCL – Part 7 – More LiveBinding Classes