Delphi Cookbook 3ed is out!

Here’s the 3rd edition of the Delphi Cookook! Delphi Cookbook is a best sellers for PacktPub in its category since the 1st edition back in the 2014.

Delphi Cookbook 3rd Edition
Delphi Cookbook 3rd Edition

This edition is the first in co-authoring with Daniele Spinetti. Daniele Spinetti is an Embarcadero MVP wich works with me in bit Time Professionals (site in english here). We works together every days, so has been a pleasure to share this experience too.

What’s new in 3rd edition

In this third edition we wanted to add content to keep the book updated with emerging technologies and new features made available by Delphi. Like the 2nd edition, some chapters are completely new while all the others has been updated, evolved and integrated with new contents. The new chapters are devoted to Linux Development and IoT. Moreover there are many new contents about FireDAC and RTTI attributes.
This edition contains all the recipes from the previous version updated to Delphi 10.2 Tokyo. We reached now 780 pages and 78 recipes!

Delphi Cookbook 3rd edition lets you learn all the development possibilities provided by Delphi

  • Cross-platform
  • Mobile with FireMokey (Android and iOS)
  • Server-side programs (Linux and Windows)
  • Integration with IoT
  • Working with data (FireDAC, JSON, XML)
  • a lot more…

Topics of the book

  • Develop visually stunning applications using FireMonkey
  • Deploy LiveBinding effectively with the right OOP approach
  • Working with data (JSON, XML)
  • Design, develop and deploy server-side programs to serve RESTful web services (Linux and Windows) and provide data to your mobile and web apps
  • Use well-defined GUI design patterns to build mobile applications that provide a great user experience
  • Extremely useful recipes on FireDAC database access framework
  • Build mobile apps that read data from a remote server efficiently
  • Call the platform native API on Android and iOS even for an unpublished API
  • Manage software customization for your customer by making better use of an extended        RTTI
  • Implement the most popular design pattern without wasting too much time on debugging and bug fixing
  • Enrich your knowledge of Delphi deepening the libraries made available
  • Integrate your applications with Internet of Things

As I told also at the time of 1st and 2nd edition, Delphi Cookbook is not an introductory book, you will not find any “Introduction to the Object Pascal language”, however the majority of the chapters are not too complex and can be grasped also by the new Delphi programmers.

Where to buy

The book is available for sale on the editor website and on Amazon.

PacktPub (Official book page)

Amazon

Source code is on github

Table of contents

Chapter 1: Delphi Basics

  • Changing your application’s look and feel with VCL styles
  • Changing the style of your VCL application at runtime
  • Customizing TDBGrid
  • Using owner-draw combos and listboxes
  • Making an owner-draw control aware of the VCL styles
  • Creating a stack of embedded forms
  • Manipulating JSON
  • Manipulating and transforming XML documents
  • I/O in the 21st century – knowing the streams
  • Creating a Windows Service
  • Using the TService.LogMessage method
  • Be coherent with the Windows look and feel using TTaskDialog
  • The amazing TFDTable – indices, aggregations, views, and SQL
  • ETL made easy – TFDBatchMode
  • Data integration made easy – TFDLocalSQL

Chapter 2: Becoming a Delphi Language Ninja

  • Fun with anonymous methods – using higher-order functions
  • Writing enumerable types
  • Using enumerable types to create new language features
  • RTTI to the rescue – configuring your class at runtime
  • Duck typing using RTTI
  • BOs validation using RTTI attributes
  • Creating helpers for your classes

Chapter 3: Knowing Your Friends – The Delphi RTL

  • Checking strings with regular expressions
  • Consuming RESTful services using native HTTP(S) client libraries
  • Coping with the encoded internet world using System.NetEncodings
  • Saving space using System.Zip
  • Decoupling your code using a cross-platform publish/subscribe mechanism

Chapter 4: Going Cross-Platform with FireMonkey

  • Giving a new appearance to the standard FireMonkey controls using styles
  • Creating a styled TListBox
  • Impressing your clients with animations
  • Using master/details with LiveBindings
  • Showing complex vector shapes using paths
  • Using FireMonkey in a VCL application
  • Reinventing your GUI, also known as mastering Firemonkey controls, shapes, and effects

Chapter 5: The Thousand Faces of Multithreading

  • Synchronizing shared resources with TMonitor
  • Talking with the main thread using a thread-safe queue
  • Synchronizing multiple threads using TEvent
  • Communication made easy with Delphi Event Bus
  • Displaying a measure on a 2D graph like an oscilloscope
  • Using the Parallel Programming Library in the real world: Tasks
  • Using the Parallel Programming Library in the real world: Futures
  • Using the Parallel Programming Library in the real world: Parallel For/Join

Chapter 6: Putting Delphi on the Server

  • Developing web client JavaScript applications with WebBroker on the server
  • Converting a console application into a Windows service
  • Serializing a dataset to JSON and back
  • Serializing objects to JSON and back using RTTI
  • Sending a POST HTTP request for encoding parameters
  • Implementing a RESTful interface using WebBroker
  • Controlling remote application using UDP
  • Using app tethering to create a companion app
  • Creating DataSnap Apache modules
  • Creating WebBroker Apache modules
  • Using native HTTP(S) client libraries
  • Logging like a pro using LoggerPro

Chapter 7: Linux Development

  • Creating Linux TCP/IP servers
  • How to correctly handle Linux signals
  • How to build a modern Linux daemon
  • Building a TCP/IP Linux server and daemonizing it
  • Building a RESTFul server for Linux
  • Building a complete RESTful server with database access and web client interface
  • Creating WebBroker Apache modules for Linux

Chapter 8: Riding the Mobile Revolution with FireMonkey

  • Taking a photo, applying effects, and sharing it
  • Using TListView to show and search local data
  • Using SQLite databases to handle a to-do list
  • Do not block the main thread!
  • Using a styled TListView to handle a long list of data
  • Customizing the TListView
  • Taking a photo and location and sending it to a server continuously
  • Talking with the backend
  • Making a phone call from your app
  • Tracking the application’s life cycle
  • Building your own SMS sending service with the REST API

Chapter 9: Using specific platform features

  • Using Android SDK Java classes
  • Using iOS Objective-C SDK classes
  • Displaying PDF files in your app
  • Sending Android Intents 554
  • Letting your phone talk – using the Android TextToSpeech engine
  • Using Java classes in Android apps with Java2OP
  • Doing it in the background, the right way – Android services

Chapter 10: Delphi and IoT

  • How to blink an LED using Arduino
  • How to drive multiple relays with Arduino and Delphi
  • Reading data from Arduino
  • How to blink an LED using Raspberry Pi
  • How to drive multiple relays with Raspberry Pi and Delphi
  • Reading data from Raspberry PI

 

We have the number, “Delphi Cookbook 2nd Edition” is a bestseller!

Delphi Cookbook 2nd Edition was published by PacktPub at the end of June 2016. I’m very happy to see that in just 30 days, it has become a bestseller in its category.

So far, the book has sold 13 copies each day, which is a good figure for a tech book (it should increase in the following months because the book will be available in more stores).
Currently the book is available on all the big online stores.

PacktPub Store

https://www.packtpub.com/application-development/delphi-cookbook-second-edition

Amazon 

https://www.amazon.com/Delphi-Cookbook-Second-Daniele-Teti-ebook/dp/B01A14X6IC/ref=sr_1_1?s=digital-text&ie=UTF8&qid=1470390240&sr=1-1#nav-subnav

Apple iTunes

https://itunes.apple.com/us/author/daniele-teti/id923580889?mt=11

O’REILLY

http://shop.oreilly.com/product/9781785287428.do

 

Some notes about ITDevCon 2016

PacktPub will be a sponsor of the upcoming ITDevCon in Rome (ITDevCon is the biggest Delphi Conference in Europe – www.itdevcon.it)  and they have organized a nice offer for all the ITDevCon attendants!

If you are a Delphi developer (or you want to know why Delphi is so interesting now) you cannot miss ITDevCon 2016.

Get your ticket here http://www.itdevcon.it/registration#ticket

Moreover, since the 1st edition of ITDevCon we saw that a lot of programmers wants to be at ITDevCon because is a great conference full of practical contents (and with good italian food 🙂 ) but leaving the office for 2 days often can be a problem. So, starting by this year, you can buy also a single day of conference! So, if you cannot be with us for 2 days, check the timetable, and book the day most interesting for you!

 

 

 

 

 

My “Delphi Cookbook” has been published

Almost an year ago I started to write a book about Delphi for Packt Publishing. Today that book has been published.

Delphi Cookbook Cover
Delphi Cookbook Cover

This book is a cookbook! That’s it, in 328 pages you will find useful (I hope) “recipes” for your day-by-day Delphi job.

Topics of the book

  • Create visually stunning applications using FireMonkey
  • Effectively use LiveBindings with the right OOP approach
  • Create server-side programs to serve RESTful web services and provide data to your mobile apps
  • Develop mobile apps for Android and iOS using well-defined GUI design patterns for a great user experience
  • Build efficient mobile apps that read data from a remote server
  • Call the platform-native API on Android and iOS even for an unpublished API
  • Use extended RTTI to better manage the software customization for your customer
  • Leverage the most popular design patterns for a better design without wasting too much time debugging

It is not an introductory book, you will not find any “Introduction to the Object Pascal language”, however the majority of the chapters are not too complex and can be grasped also by the new Delphi programmers.

The book is available for sale on the editor website and on Amazon.

Official book page at PacktPub

https://www.packtpub.com/application-development/delphi-cookbook

Book at Amazon

http://www.amazon.com/Delphi-XE6-Cookbook-Daniele-Teti/dp/1783559586

— Table of Contents —

Chapter 1: Delphi Basics

Changing your application’s look and feel with VCL styles and no code

Changing the style of your VCL application at runtime

Customizing TDBGrid

Using the owner’s draw combos and listboxes

Creating a stack of embedded forms

Manipulating JSON

Manipulating and transforming XML documents

I/O in the twenty-first century – knowing streams

Putting your VCL application in the tray

Creating a Windows service

Associating a file extension with your application on Windows

Chapter 2: Become a Delphi Language Ninja

Fun with anonymous methods – using higher-order functions

Writing enumerable types

RTTI to the rescue – configuring your class at runtime

Duck typing using RTTI

Creating helpers for your classes

Checking strings with regular expressions

Chapter 3: Going Cross Platform with FireMonkey

Giving a new appearance to the standard FireMonkey

controls using styles

Creating a styled TListBox

Impressing your clients with animations

Using master/details with LiveBindings

Showing complex vector shapes using paths

Using FireMonkey in a VCL application

Chapter 4: The Thousand Faces of Multithreading

Synchronizing shared resources with TMonitor

Talking with the main thread using a thread-safe queue

Synchronizing multiple threads using TEvent

Displaying a measure on a 2D graph like an oscilloscope

Chapter 5: Putting Delphi on the Server

Web client JavaScript application with WebBroker on the server

Converting a console service application to a Windows service

Serializing a dataset to JSON and back

Serializing objects to JSON and back using RTTI

Sending a POST HTTP request encoding parameters

Implementing a RESTful interface using WebBroker

Controlling remote applications using UDP

Using App Tethering to create a companion app

Creating DataSnap Apache modules

Chapter 6: Riding the Mobile Revolution with FireMonkey

Taking a photo, applying effects, and sharing it

Using listview to show and search local data

Do not block the main thread!

Using SQLite databases to handle a to-do list

Using a styled TListView to handle a long list of data

Taking a photo and location and sending it to a server continuously

Talking to the backend

Making a phone call from your app!

Tracking the application’s life cycle

Chapter 7: Using Specific Platform Features

Using Android SDK Java classes

Using iOS Objective-C SDK classes

Displaying PDF files in your app

Sending Android intents

Letting your phone talk – using the Android TextToSpeech engine

I hope you enjoy the reading!

–Daniele

Book Review: “ZeroMQ” (PACKT Publishing)

Introduction

Some days ago I was contacted by a representative from PACKT Publishing asking me to write a review for their last book about the ZeroMQ library.

ZEROMQ BOOK COVER
ZEROMQ BOOK COVER

In 2009 I was looking for a fast, very fast, messaging system for a complex project and I meet ZeroMQ. At that time there was the 1.x version and I wrote a Delphi wrapper for the C dll that some days later has been included in the official ZeroMQ distribution.

Now, after 4 year since then, I’m using ZeroMQ for a lot of things. I’ve talked about ZeroMQ to the popular ITDevCon (The European Delphi Conference), so I’m very happy to write about ZeroMQ another time.

So, back to the book review…

The book title is simply “ZeroMQ”, but the subtitle explains what you’ll really learn from it: “Use ZeroMQ and learn how to apply different message patterns”.

Yes, this book is really a crash course in ZeroMQ. In about 100 pages, this “small but full of interesting things” book, explains all the most useful message patterns implemented in ZeroMQ. Congrats to Faruk Akgul (the author).

Traditional message queuing systems use a broker. However, ZeroMQ is brokerless. In a brokerless design, applications can directly communicate with each other without any broker in the middle. All the complexity is hidden, and handled, by ZeroMQ. In this situation there isn’t the “single point of failure”. In some cases this architecture cannot be used, but when it can be, you can gain a lot of flexibility, speed with no added complexity.

Let’s give a more  deeper overview for each chapter.

Chapter 1: Getting Started

In this chapter there are some informations about the messaging architectures in general (good for newcomers to the topic) and about ZeroMQ messaging (in particular). Some concepts introduced in this chapter are reused a lot in the rest of the book.

In chapter 1 is introduced the first and the simpler ZeroMQ pattern, the request-replay.

Chapter 2: Introduction to Socket

This chapter starts with a nice introduction to the publish-subscribe pattern and the related filtering (ZeroMQ can filter messages with a very simple “match” pattern). Then, the chapter talks about one of the most interesting patterns when speed is important: the pipeline pattern. While is talking about the pipeline, it explain the ZMQ_PULL and the ZMQ_PUSH socket types. At the end of the chapter, there is an introduction to the Valgrind’s tools suite to detect memory leaks in C/C++ programs. In Delphi can be used FastMM or other similar tools for the same thing.

Chapter 3: Using Socket Topology

In this chapter there is a small introduction to the types of Internet Sockets and TCP. There there is a nice comparison between the “plain” sockets and the ZeroMQ sockets.

At the end, there is an introduction to the CZMQ, a small helper library which lets

C developers to code their ZeroMQ applications easier and shorter. For a Delphi programmer there are a number of ZeroMQ wrapper that makes its use really a snap.

Chapter 4: Advanced Patterns

In this last chapter, are introduced some advanced variation of the previously introduced patterns. Then, there is a nice explanation of some critical situations that could happened in a messaging system. To help the programmer to handle this cases there a number of examples of the ZeroMQ “High Watermark” setting. As very last topic, there is a well known problem, the infamous “slow subscribers in a publish-subscribe pattern”.

Conclusions

The “ZeroMQ” book published by PACKT Publishing is a small but very nice book. Can be very useful to all those people that don’t know about messaging or want add the power of ZeroMQ to their messaging knowledge.

As in every single thing, there are good aspects and bad aspects.

This book is good for an introduction but is not so good for advanced users. There are some other ZeroMQ patterns and features that are not explained at all. However, these patterns are not the most used, or are advanced stuff, so this could not be a big issue.

Considering, the price, the contents and the informative density, is a definitely a good book that can be read, and studied, in few hours and could change your way to do things in everyday programming (messaging are very often not used, or used in a bad way, simply because usually is complex to write and maintain a good messaging system).

One of the more nice features about ZeroMQ is that it can use different transportation protocols. The same library and the same code can be used to do messaging between machines, between processes or between threads in the same process (ipc). As last note, ZeroMQ can handle, without much effort, millions of messages per seconds. If you need speed… consider this.

P.S. I’ll translate and publish on this blog, some of the C examples contained in the book, in Delphi. Stay tuned.