DAPUG event in Denmark

Today and tomorrow I’ll be the speaker at the DAPUG event in Denmark. The title of the event is “DELPHI IN THE ENTERPRISE”. What is an enterprise application? Obviously there isn’t a measure to know if an application is enterprise or not, but the following needs usually require and enterprise level application.

  • Critical functionality
  • Large quantity of concurrently accessed data
  • Large number of screens
  • Integration with 3rd part systems
  • Conceptual dissonance
  • Complex business rules

In such scenarios we cannot just create a larger “small” application; you have to change your mindset and adopt new tools. The OO principles, design patterns and unit tests are the first step to get success in the enterprise field (and also in all the others smaller field), but what’s next? At the DAPUG event I’ll talk about the tools and the products that can help our Delphi system to be able to play well in the enterprise field.

From this idea, these are the topics covered at the DAPUG event in Denmark:

Tuesday day 1

Real-world Linux Development with Delphi
DMVCFramework 3: RESTful services and much more

Wednesday Day 2

The amazing Redis
Analysis and searches with ElasticSearch
Using ORM in Delphi
Logging done right; How to use and extend LoggerPro

 

I think that the topics are really interesting, we’ll see what will think the DAPUG members after the workshop 🙂

 

Stay tuned

Delphi 10.2 Tokyo: REDIS Client is ready for Linux (VIDEO)

Now that Delphi can compile for Linux, I’d like to show how to use Delphi REDIS client on Linux.
Redis is a very powerful key-value store server used by the biggest companies in the world. While it is very popular in web applications with thousands of concurrent users, also traditional desktop applications can benefits by REDIS.
If you need to speedup you application or if you want to optimize your data access layer, I suggest you to partecipate to one of our Delphi and REDIS training.
In this video I’ll use a sample project included with the Delphi REDIS client project to show how is possibile to use REDIS to integrate Delphi Windows application and Delphi Linux servers.

The Linux compatible version of Delphi REDIS Client will be available through GetIt ASAP.

Enjoy.

Delphi REDIS Client

https://github.com/danieleteti/delphiredisclient

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!

 

 

 

 

 

Delphi Cookbook – 2nd Edition

Delphi Cookbook 2nd Edition

Starting from today my Delphi Cookbook 2nd edition is available to buy. The first edition got a lot of interest and appreciation comments. Delphi Cookbook is a best sellers for PacktPub (my editor) in its category, the editor decided to ask me a 2nd edition. So here it is!

What’s new

The problem with each “2nd” edition is: “What I can expect if I already bought the 1st one?”. This edition contains all the recipes from the 1st edition updated to the new Delphi 10.1 Berlin, plus a lot (ca 150 pages) of brand new contents. There is also a brand new chapter about less-known RTL classes. Also some “old” recipes has been completely rewritten because some techniques has been superseded by the newer Delphi versions. So, if you liked the 1st edition, you should find something interesting also in the 2nd one. The 2nd edition contains 470 pages compared to the 328 of the 1st edition.

Topics of the book

  • Understand the basics of professionals Delphi programming
  • Become a Delphi language Ninja
  • Knowing the new RTL classes to work with HTTP/S, Net encodings, event bus, compression etc.
  • Develop visually stunning applications using FireMonkey
  • Deploy LiveBinding effectively with the right OOP approach
  • The thousand faces of multithreading: syncronization tecniques in the real world
  • The Parallel Programming Library: Tasks, Futures parallel For
  • Create server-side programs to serve RESTful web services and provide data to your mobile apps
  • Use well-defined GUI design patterns to build mobile applications that provide a great user experience
  • Build mobile apps that read data from a remote server efficiently
  • Using sensors and network in mobile apps
  • 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

Some considerations

Delphi Cookbook 2nd edition, just like to 1st one, 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.

Where to buy

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

PacktPub (Official book page)

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

Amazon

Delphi Cookbook 2nd Edition on Amazon

 

Table of contents

Chapter 1: DELPHI BASICS

  • Change your application look&feel with VCL styles and no code
  • Changing the style of your application at run time
  • Customizing TDBGrid
  • Using owner draw combos and listboxes
  • How to make an owner draw control aware of the VCL styles
  • Creating a stack of embedded forms
  • Manipulating JSON
  • Manipulating and transform XML documents
  • I/O in the 21th century: knowing the streams
  • Creating a Windows service
  • Associating a file extension with your application on Windows
  • Be coerent with the Windows look&feel using TTaskDialog

Chapter 2: BECOME A DELPHI LANGUAGE NINJA

  • Fun with anonimous 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

Chapter 3: KNOWING YOUR FRIENDS: THE DELPHI RTL

  • Check strings with regular expressions
  • Consuming RESTful services using native HTTP(S) client libraries
  • Cope with the encoded Internet world using System.NetEncodings
  • Save space using System.Zip
  • Decouple 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
  • Reinvent your GUI a.k.a Mastering Firemonkey controls, shapes and effects

Chapter 5: THE THOUSAND FACES OF MULTITHREADING

  • Synchronizing shared resources with TMonitor
  • Talking with main thread using a thread safe queue
  • Synchronizing multiple threads using TEvent
  • Displaying a measure on 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: PUT DELPHI ON THE SERVER

  • Developing web client JavaScript applications with WebBroker on the server
  • Converting a console service application to 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 application using UDP
  • Using AppTethering to create companion app
  • Creating DataSnap Apache modules
  • Creating WebBroker Apache modules
  • Using native HTTP(S) client libraries

Chapter 7: RIDE THE MOBILE REVOLUTION WITH FIREMONKEY

  • Taking a photo, applying effects, and sharing it
  • Using ListView 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 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 lifecycle

Chapter 8: USING SPECIFIC PLATFORM FEATURES

  • Using Android SDK Java classes
  • Using iOS SDK classes
  • Displaying PDF files in your app
  • Sending Android intents
  • Letting your phone talk: using the Android TextToSpeech engine
  • Using Java classes in Android apps with Java2OP
  • Do it in background, the right way: Android services

Events

In the next months there will be some events regarding the book.

  1. A one day workshop, held in Rome and Milan, about selected recipes of the books with additional contents and other “live” considerations.
  2. Some blog post about contents that not fitted (by time and other contraints) in the book. Most of them will be about the server side development and will involve Redis and other open source projects.
  3. Oct 6,7 2016 PacktPub will be one of the sponsor of ITDevCon 2016. During that event there will be some surprises for the attendants offered by the Delphi Cookbook “series” (yes, 2 is a series 🙂 ) editor.

 

Conclusions

As usual, writing a tech book is an hard task. 470 pages are more than I was thinking at the day 0. However, I’m quite (not completely, as usual) satisfied about the work. I really hope that you will enjoy the content at least as much I enjoy the writing.

Echoes From The Past: Message Master For Delphi a.k.a. MM4D

Some years ago, at the Delphi 6/7 timeframe I was working on a client/server program with c.a. 400 forms and 200 units. At that time I needed a simple way to localize in Italian (in primis) and in other languages, all the  standard dialogs (ShowMessage, InputBox, InputQuery etc.). Moreover, I would have liked to give a unique style to them. In addition, I needed to localize that dialogs. Moreover I needed a simple way to show a program of a background operation using a not modal dialog with a simple pattern like the following:

  ...
  ShowStatusPos(STATUS_CAPTION, Point(50, 50), True);
  try
    for i := 1 to 100 do
    begin
      SetupQuery(LMyDataset, i);
      LMyDataset.Open;
      while not LMyDataset.Eof do
      begin
        //do something
        UpdateStatus(i, Format(STATUS_CAPTION + ' %2d%%', [i]));
        LMyDataset.Next;
      end;
      LMyDataset.Close;
    end;
  finally
    CloseStatus;
  end;
  ...

So, after some tests I wrote Message Master for Delphi. MM4D is a smal library which supports all of these features, or at least these features were supported at that time. Indeed, since then I saw many (really many) 3rd-party Delphi/C++Builder written programs which actually use MM4D. However, since then I didn’t supported that library anymore. Now, more or less, 15 years after, a user wrote to my about MM4D support in Delphi 10 Seattle. So, I decided to update the code to let it compile on Delphi 10 Seattle. So, now it is currently supported (even if I dont plan to improve it in any way in the short term). However if someone use it or want to use it and update/upgrade/improve, here’s the github reporitories. I hope I have done something good for all the old time users.

Message Master For Delphi
https://github.com/danieleteti/mm4delphi

In the repositories there is a demo to show all the features of MM4D and there is also a small tool called UnitsAdded.exe which can be used to add the MM4D features to a project automatically (search for Dialogs.pas and, if exists, add MessDlgs after it).
MM4Delphi uses the good XiControls (included). So, still thank you to Eugene Genev for his XiControls.

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

Using dynamic arrays and Parallel Programming Library (Part 1)

The Parallel Programming Library introduced in XE7 is one of the  most awaited built-in library for the Delphi and C++Builder RTL, at least for me. I’ve still a nice list waiting for the next versions, but this is another story 🙂

Marco CantĂą wrote about dynamic arrays some days ago, another nice feature introduced in Delphi XE7. In the post he talk about an integration between Parallel Programinng Library and dynamic arrays which I shown to the audience in the Milan and Rome XE7 world tour.

I planned to write about Parallel Programming Library in this blog, so why don’t start with that simple example?

Here’s the code.

procedure TFormThreading.Button1Click(Sender: TObject);
var
  tasks: array of ITask;
  value: Integer;
begin
  value := 0;
  tasks := [
  TTask.Create(procedure
    begin
      sleep(1000); // 1 seconds
      TInterlocked.Add(value, 1000);
    end).Start,

  TTask.Create(procedure
    begin
      sleep(3000); // 3 seconds
      TInterlocked.Add(value, 3000);
    end).Start,

  TTask.Create(procedure
    begin
      sleep(5000); // 5 seconds
      TInterlocked.Add(value, 5000);
    end).Start
    ];

  TTask.WaitForAll(tasks);
  ShowMessage('All done: ' + value.ToString);
end;

This code configure and start 3 parallel tasks and wait for their completitions. Then show the result using a ShowMessage.
This code takes 5 second to be executed because the 1st second there are 3 tasks running, from 2nd second to the 3rd second there are 2 tasks running while the last 2 seconds only one task is running. All the internal threads are managed by a thread pool. Hey! This means parallelize!

March 2014 news about “DelphiMVCFramework”

In the last months DMVCFramework has been used in many projects. Some fixes and some new features has been added.

Tomorrow will start the 4th training from the Jan 1st 2014 on DMVCFramework… WOW!

The best selling training is “Developing Web Client applications using AngularJS and DelphiMVCFramework” (a slightly modified version of this classic training http://www.bittime.it/sviluppare_applicazioni_web_usando_angularjs_con_delphi_back_end).

Tomorrow the training will be in italian, however is very popular also the english version.

However, back to the project, there is a first attempt to add some documentations on the project.

So far there are a lot of samples and all the unit tests, however there was a lack on the “classic” documentations. So, I’m happy to say that in the SVN trunk you can find my presentation held at the last ITDevCon2013 in Verona, IT.

If you are using DMVC framework I’ll be glad to have 2 lines of description about your project (numbers not functionalities insights) to put a success case page on the project website.

Here’s the direct link to the documentations: https://delphimvcframework.googlecode.com/svn/trunk/docs/DelphiMVCFramework.pdf

This is the main DelphiMVCFramework project website: https://code.google.com/p/delphimvcframework/

Stay tuned

ITDevCon 2013 – Some Numbers

Next week, in Verona (Italy) there will be the 5th edition of the biggest European Delphi Conference.

This year has been extraordinary for the Delphi community. 2 new versions of Delphi and 2 new platforms (with 2 new big markets). There are very many things to talk about at ITDevCon 2013: Android, iOS, HTML5 and Javascript, Web, new frameworks and many other things.

So, I’d like to share with you some numbers about the upcoming conference.

  • 2 days
  • 3 contemporary tracks each day
  • 19 speaker (IT/EN)
    • 7 english only speakers
    • 5 italian only speakers
    • 7 english or italian (on request, based on the class) speakers
  • 31 speeches (60 minutes + 5 minutes for Live Q&A)
  • 5 training tracks (NEW!)
    • D: Delphi
    • M: Mobile (with or without Delphi)
    • W: Web and Delphi
    • G: General Concepts/Methodologies
    • I: Integration with Delphi
  • Speakers and attendees from all Europe
  • Very Special Speaker from Embarcadero…
Moreover we will talk about libraries, frameworks and best practices that really help the Delphi developer in the day-by-day work.
The website is http://www.itdevcon.it
If you want to attend, buy your ticket here http://www.itdevcon.it/registration#ticket

ITDevCON 2013 – Call 4 Paper

ITDevCon2013
ITDevCon2013

Dear potential ITDevCon speaker,

I’m building the agenda for next ITDevCon that will be held next november 14th, 15th in Verona (Italy), the same location of the past year.

This will be the 5th edition ( we’re getting conference experts J )

The call for papers are officially open right now, so if you want to propose some speeches, I’ll be glad to see it.

As usual, for the Call4Paper I need:

  • Title (for every talk)
  • Abstract (for every talk)
  • Difficulty level (for every talk. Difficulty level is a scale from 1 to 3 with the following mean: introduction, intermediate, advanced)
  • Speaker’s photo
  • Speaker’s profile

I’m looking forward to your proposal. The call4papers ends at Aug 31st, 2013 but if you have *VERY* interesting topic to propose, propose it… I’ll try to arrange the schedule and fit it in the agenda.

Send your proposal to call4paper(at)itdevcon.it.

Proposals will be evaluated and the speakers will be contacted ASAP.

This year topics will be the following:

TOPICS

  • What’s new in Delphi
  • FireMonkey: component development, hacking styles, best practices, success cases etc.
  • iOS development (iPhone, iPad, iPod Touch)
  • MacOSX development
  • Android clients for Delphi servers
  • Livebindings
  • Windows 8.x
  • Model View View Model (MVVM)
  • Delphi best practices
  • Design Patterns: real world use, success cases
  • DataSnap: intro, success case, tuning, deploing etc
  • “Unusual” Delphi markets
  • Delphi + Arduino
  • Delphi + Embedded Systems
  • Delphi + Raspberry Pi
  • Delphi + WebClient Framework (AngularJS, EmberJS, KnockoutJS etc)
  • Extending Delphi with scripting languages (DWS, Javascript, Lua etc): why? how?
  • TDD and Unit Tests
  • Agile methodologies
  • Dependency Injection
  • ORM
  • FireDAC
  • Software engineering
  • “Hands on” sessions for the most used Delphi frameworks (e.g. Delphi Spring Framework, DORM, TMS Aurelius, OTL etc)
  • Mobile: UI, UX, optimization
  • HTML5/SVG/WebGL and Delphi
  • OOD/OOP
  • LLVM
  • RTTI, Generics and AnonMethods: Real world cases, success cases.
  • Web development with Delphi
  • Real OOP Delphi applications developments
  • Delphi fundamentals/advanced
  • Metaprogramming
  • Games
  • SOA/ROA
  • Architectures

Target audience

  • Software architects
  • Software developers
  • Project managers
  • IT managers
  • Trainers

The conference web site is http://www.itdevcon.it (2013 version is still under construction).

Do you want to see a particular topic or have a suggestion for ITDevCon2013? Let me know

Thanks and see you at ITDevCon 2013.

P.S. This year, ITDevCon will be even more amazing! Stay tuned!