Component-based software development with Delphi

Component-based software development with Delphi

Today we are here to discuss a topic of Delphi component-based software development for building enterprise-grade, mobile, desktop and web applications. Serge Pilko, CEO of Softacom, interviewed our special guest Bruno Fierens. Bruno is CEO and Founder of TMS Software, company which develops the most famous and beautiful Delphi components. If you are a Delphi developer, I guess you have already worked with these components. We also have customers who use TMS software components from Delphi 5 version, and you see that TMS has a lot of components in different areas: for VCL, for cross-platform development, for web development. It was improved in the last couple of years, and right now it's very strong and stable product. The company was founded in 1995.

BRUNO: Thanks for organizing an interview and having me here. Yes, we started with component development back in 1995, which of course is the year that Delphi was born, so we were passionate about Delphi RAD development right from the beginning. It's now 24 years ago, and in these 24 years a lot of things happened. We started, of course, with VCL component development for Windows platform, and the first new directions in component development were for the interop framework, for web application development that we started around 2002-2003, in that timeframe, so we got from that a lot of experience in creating user interface controls for web applications at that time, and then Embarcadero, or at that time I believe it was still Borland, introduced the cross-platform concept with the FireMonkey framework and we were also enthusiasts and then started developing components for the FireMonkey framework, cross platform components, initially that was for iOS only, and then it quickly expanded to include iOS, Android, MacOS, and Windows, of course. And the next step or the next steps were things like wind 64 support. Another major transition was adding Unicode support, recently there's also the VCL styles support that we are adopting, and over the last two years then we have mainly extended the product lines with our framework for creating web client applications, which is WEB Core, and also our FNC range of components, and these FNC components are the result of a long research here that are aiming at developing user interface controls but also cloud REST API access components with one code base that can be used everywhere, which means for Delphi developers can be used in VCL applications for Windows or it can be used in FireMonkey applications for all the targets that it supports and it can also be used in web client applications created with TMS WEB Core. So with one code base, if you develop such a user interface control once, then you can use your work everywhere.

SERGE: Yeah, exactly. Okay, let's go further. Why did we choose to discuss this topic today? Well, let's consider the company during the process of the digital transformation (yes, very modern words which we will discuss further) is going to get a new software. It can be desktop, web or mobile. And the first two questions the company will have to decide: what technology to use? Sometimes this question goes hand in hand with what vendor to choose. The second question is what architecture design should be used in software. Even if the company is not going to build the software in-house, it's desirable to understand the design of the software because it affects the budget of the development, that is important, but what often is not taken into consideration with architecture is the cost of the future maintenance. And if we’re talking about a newly created software, it’s very important to understand how it will be integrated into the overall corporate system.

We divided today's interview in two parts: the first part is like a theoretical part where we'll explain and discuss some concepts of component-based architecture, and the second part is more similar to the interview format, where I will ask Bruno different questions because as software developers, as an outsourcing company, we have a lot of questions about the future, and the situation is like we have a client, we're developers, and Bruno is like a vendor of the solutions provided for the development and he can answer some questions which are very interesting for us about the future of Delphi development, concepts of this development. Let's go further. Bruno, I can hear that “digital transformation” phrase from everywhere. What do you think: is it just a modern word for the marketing or it’s something really new?

BRUNO: Well, I think the IT industry is always looking for the next thing and the next hype, and the next buzzword. So I think we all got a little bit tired of cloud, and we all got a little bit tired of IoT, and maybe already tired of AI, and so there's this new buzzword “digital transformation”. I believe, or let me say I understand, the digital transformation as the concept of building or transforming all the processes within a company to run based on software, and this software hosted by cloud servers and software is no longer installed on the hardware that exists in a company. That’s a little bit in a nutshell how I understand what digital transformation is.

SERGE: I see, thank you. Any software development begins with analysis and the design of its architecture. So let's dive into the subject of designing component-based software architecture. Let's start with some definition of the component. Of course, I know, almost everybody knows, what is it, because that’s is why you are here. But anyway, let's imagine that we have a component, and if we need to add a Facebook share button to our web app, we need a component. To do this we will need to study Facebook API specification. But instead of doing all these tasks and spend a lot of time, we can just use a component and this is what Delphi introduces – this component idea.

Components are like pieces of code which are injected to our main project and they just perform their tasks and perform their routines. If we are talking about building blocks of a component-based software architecture that are integrated with software via API (e.g. REST API), it's totally different, they are not apply to the term components. We have two types of components, of course you know these visual components for building our UI, and non-visual: components that performing and processing some work with the database, subroutines and procedures, like calculations, cryptography, and so on. And, of course, components which allowing easy and fast integration with third-party services, I'm talking about different connectors.

Sometimes I'm trying to explain to our customers what's the difference between component-based architecture and a classical one and is there a difference in steps of development component and non-component based software. I just prepared such schema which shows component-based architecture. We just create a project skeleton and write a glue code which just performs interaction between already existing components which I selected. If I want to have some marketing software which is working with my database and perform some operations with Twitter, Facebook, perform some REST API, all that I need just take some components and implement this logic like a glue code, get some data from for example REST API to class and to model and put this model to ORM and put it to database. Or perform some unique business logic.

On the right side you see that of course if we are developers using Delphi we can write from the scratch almost everything. We can write our custom grids, REST API providers, REST API connectors to Twitter, to Facebook, but it will take a lot of time and right now it just does not have a sense. This is why we are talking about component-based software. For today it's almost impossible to do that because it's even not about the development from the scratch. Of course, we can add Google support for our software but Google is changing their SDKs and APIs, or even Facebook, and, instead of working on our custom business logic, we will think about supporting all these SDKs, it will drive us crazy and it's impossible, we will lose the focus. This is why we have to use third-party components with support. Of course, we can find a lot of free components which were developed, maybe some of them are supported right now in the GitHub by some communities. But if we want to have a stable support of components, we have to choose paid components. Here I showed the process how we divide all the tasks to subtasks when we are developing new software.

We create specification, client specifications, specifications from business owner, product owner, and we design architecture. Then we perform decomposition of all the architecture subsystems, and we are trying to choose which components to use, because sometimes that's very important to select a correct set of components in the beginning. Then it can take a lot of time to change it. After modeling components and their requirements, we perform components research. Then we're testing them, of course, and creating prototype with some little glue code and we have a Delphi UI working solution which performs different pieces like almost all UI, some operations with database. Then it is tested and accepted. We are developing, testing and releasing the product.

Now let's talk about how can we develop enterprise-grade software rapidly and don't spend months and years on this new development.

We develop different software in different areas and I can say that using TMS we can cover a lot of functionality. Sometimes we are using TMS, sometimes other components. It also depends on requirements of our customers, if they have some internal requirements or rules. Bruno, you heard my position of this component-based development what can you say: how can we save development time and increase development speed using your products?

BRUNO: Well, I think that components are abstractions of sometimes complex code algorithms, interfaces, technology and I think it's definitely a benefit not to reinvent the wheel and I think for developing applications you can get much faster, and you can also focus more on the business logic of your application instead of the underlying technology that some of these components cover. By that, I'm convinced that you can save huge amounts of time I’ll give one example and I think that this example should make it very clear. We have our FlexCel component which is a component that wraps, generating, creating, reading, modifying Excel files in the XLSX format and XLS format, but all the details that these file formats support, and what Excel supports in formula calculation, and all kinds of features of how you can format cells in an excel file, well, I'm pretty sure that no one will be able to do something similar natively with Excel files, and even let's say 1,000 of the time that we internally spend to create this component, so by just using this component 15 minutes later you can be productive and add Excel specific features to your application where you would literally spent thousands of hours trying to do it yourself and studying these file formats etc. So that's just one small example that I think should make it very clear about the amount of time you can win by applying components in the architecture of your application.

SERGE: Yeah, I agree. Now let's talk about the areas and types of development. I divided it in categories: desktop, mobile and web development. Right now let’s start from desktop software development. We are also feeling some trends for the next 3-5 years but you also, but I think that you feel the trends better because it's like your core business. What do you think, what changes can affect the approaches to develop Windows desktop applications in 3-5 years? What will be with win32 and win64 applications in the future? Or maybe everything will go to this managed code and developers even won't know about these architectures, about these and so on, what do you think?

BRUNO: Well, I think that ever since Microsoft came up with the .NET framework and later the Windows app store with the requirements, the initial requirements at least, for the Windows app store, we as Delphi developers were always very afraid that this could affect the possibility to deploy win32 or win64 applications for the majority of the customers using Delphi software. I personally think that these things like the .NET framework and the Windows app store are already long enough in place and are absolutely till this point not anywhere near a position that they will replace or endanger win64 and 32 native applications. And also given that the Windows 10 operating system is quite stable, I mean there is not that much groundbreaking changes anymore in the operating system, it's more like an evolutionary model of releases of small new features to the operating system, that I personally do not believe that Microsoft will take any action that will endanger win32 or win64 applications for Windows in the next couple of years. Of course, there is never a guarantee in software landscape but that is my personal belief that all the actions of Microsoft in the past trying to push things like .NET and things like the Windows app store with initial restrictions to manage code only have not really worked and I personally do not see them change strategy any time soon.

SERGE: Okay, you think that if somebody want for example to develop new software from the scratch or migrate from legacy application to up-to-date, they don't need to have any worries and they need just to develop and use? Or what do you think? If honestly, is it risky or I can do that developing with 32 and 64?

BRUNO:I personally do not see it as really risky. I think it's a majorly the point of deciding will you only target the Windows platform or you are looking for a solution that should be cross-platform, where you have customers who are also running Mac's or Linux machines, and so I think that is primarily a deciding factor if you will only target Windows or if there is a desire to target multiple desktop operating systems. And another consideration is it worth to develop a totally new application today that is for example not web-based. Because if you develop it for the web platform, then you can, of course, target any operating system with just one code base. Everywhere where you have a browser running you can normally use and run your web application.

SERGE: I see, okay next question is: which main VCL products for Windows do you have and what are the plans for the future development? Because we have these Delphi VCL components from 1995 and sometimes people think what else we can invent, everything already had been invented. This is VCL desktop software and how you are keeping up to date these products? Because right now VCL and desktop development it's not like on the first place even for Embarcadero. What can you say?

BRUNO: well, I think a large part of the VCL development going forward is to adapt the look and feel of these components to modern operating system look and feel. So, we have done in the last year a huge amount of work to adapt our components for example to a high DPI and multi-monitor high DPI situations, that is quite complex work, it's a lot of work. There are a lot of scenarios, so that's one significant part – to make sure that VCL user interface controls look as perfect as possible in all kinds of monitor situations. Another thing is VCL styles support. So we've also done a significant amount of work to make our components compatible with the VCL styles, and another part is that other than the Microsoft look and feel or the look and feel that is determined by VCL style, there are things like Google material design that define a certain look and feel of components that are visually current, modern, attractive, and people want their applications to look like these user interfaces. And so, that's a very important part to keep our components really current with what people expect these days in look and feel. That's one part. Another part of course is that we receive on a daily basis feature requests. Sometimes small features, sometimes big features, sometimes requests for new VCL components. We carefully listen to these requests and, where possible, where appropriate, where we estimate that there is a good demand for these features or new components, we also work on these things.

SERGE: Okay, and like a final question about this desktop software development: what do you think, why people have to start to develop new desktop software from the scratch today? If we can use cross-platform or even web. What are the areas? Is it more for the enterprise products like for the financial industry or for insurance, I don't know. 10 years ago I didn't think about what to use, 5 years ago I thought what's the reason to develop desktop if I can develop web and it will work everywhere. What do you think?

BRUNO: There are still a lot of reasons to develop Windows desktop software and I think a major part of that is driven by having to interface with existing other Windows applications. I'm thinking about maybe there is ERP software, there is some database in the back that is easily accessed interfaced with a Windows application, or there is a specific hardware that is controlled by the application that you develop. In our group of customers, we have a lot of companies who are developing machines, machine software, machine control software, also it can be a solution for PoS applications where low costs, small computers, it's still easy and fast. And these small computers are often cheap, so the total cost of the solution is often also low when using Windows desktop software. I also think that many software projects will be something from the past, something that was already created. To give that a new look and feel or to reuse parts of code that already exist is also a benefit in terms of cost of developing if something can be reused. Also I think it makes a lot of economic sense to reuse existing parts of code and therefore target the Windows desktop.

SERGE: Yeah, that's clear. Let's go to the section about web apps development (using Delphi, of course). Like I already said everything is moving to web. Maybe it's a trend of even not 5-10 years, maybe even more. Why do you think people should continue to use Delphi for web development, Delphi web application development and in which areas Delphi is good for web development?

BRUNO: Well, I personally think, and that's actually the reason why we have developed something like TMS WEB Core to create web client applications from Delphi IDE and the concepts that Delphi users are used to, I think primary reasons of course are the learning curve is I think as low as possible than a complete shift to another digital framework. I also think that we are used, as Delphi developers, to RAD component-based development, so in many cases it’s a very rapid way to develop applications. So, cost-effective, creating solutions fast, and this is what Delphi IDE and how RAD still delivers and this can also be important. And, of course, the last part is the reuse of code. We have enabled by the TMS WEB Core solution to transpile or compile Pascal code to JavaScript code that runs straight out of the browser, and that means that you are unable to reuse lots of existing codes and by this of course saves a huge amount of time to create solutions for customers.

SERGE: That's clear, I agree. But it was from business architecture point of view. But if we talk about the application: which kind of software we can develop? What TMS can suggest? Can we develop single home pages or web portals? it's again more like server-side web applications with some business logic.

BRUNO: Personally I think that Delphi, and it is the strength of Delphi and the strength of a solution like TMS WEB Core but that also applies to other web frameworks for Delphi like IntraWeb, for example, is really to create applications. So, if the goal is to create from static company website or maybe even a company website with some coupling to a database to display products, I think and this is not really where Delphi shines or where the Delphi web solutions shine. I think for this there are already lots of existing templates, predefined solutions, that you can set up quickly. But if you want to create a client application that runs in the browser so it's accessible and available everywhere, on every device, every platform, where you have a quite complex user interface, then I think Delphi can really shine there because you can develop this complete client application using Delphi code, Delphi components, Delphi classes, it's with the typical Delphi trunk type language so you feel a hundred percent familiar doing that and I believe that doing so you can reach a high productivity.

SERGE: I see. As I mentioned about the server-side business logic: we can use Delphi, we can use Delphi web server, we can use Delphi custom solutions, we can use for example Microsoft Azure services, and we can use some ready solution like Dreamfactory. Dreamfactory is like open source solutions for organizing REST API server and we did not mention what TMS can suggest us for building it. Bruno, right now you have a chance to explain us what TMS can suggest us if you want to create a REST API server from the scratch using Delphi.

SERGE: One of the companies that offered a product to create REST APIs from Delphi from the very beginning even before Embarcadero offered the RAD server, EMS it was initially, so TMS X Data is the product that is suited for creating Delphi-based REST API servers and I believe it shines in terms of easy coupling to all kinds of databases. We even have direct Microsoft SQL server support. And I think it especially also shines in terms of performance, stability, in terms of Licensing. It's very easy: no nonsense license attached with that, you can create as many servers as you want and there is no time restriction or domain restriction whatever on these services. And also we have created an X data client, data set for WEB Core applications which should make the communication between a TMS WEB Core, web client application, and an X data REST API backends as seamless as possible.

SERGE: And this X data product, does it have already ready solution like a database wrapper for the operations to the tables like select, edit, delete? If I don't want to build any models and I just want to perform something like I provide database table, I provide list of fields, key field and I prepare some JSON, and I want to insert this JSON to the X data, insert the data to the database. Is it possible? Does it have all the ready functionality like RAD server for the standard operations for the database tables?

BRUNO: Yes, of course. It featured this way before RAD server. So it has the open data like query interface and so an HTTP but will insert something, HTTP delete will delete the record so all these operations are of course also JSON-based and this is all possible out-of-the-box with TMS X data.

SERGE: I see, great. There's a little question from our practice: can I host somehow this REST API service to the shared hosting or Azure web shared application or Amazon? Not like virtual machine. If I don't have a direct access to the web server, how can I share it? Can I host it somewhere?

BRUNO: From an X Data application you can create Windows based executable or service executable or you can create a Linux-based server application. It’s hosted on Azure for example.

SERGE: Azure virtual machine? Can I create an accountant and upload via FTP some files and just use it?

BRUNO: There is something that I will need to ask my colleague Wagner who’s overlooking the X Data product. I need to ask him first to be sure that I give a hundred percent correct answer.

SERGE: Okay maybe in the future your team will prepare some blog post with this question because as I know it's interesting for different clients and customers of TMS Software. Thanks you. Right now let's about the third part, let's talk about mobile application development. If I want to start today iOS and Android app development from scratch, what are the suggestions? Let's divide it into two questions: if we're talking not about Delphi and if we're talking about Delphi. What I have to use if I don't know Delphi and what I have to use if I am using only Delphi. Sometimes if I never before developed mobile apps using Delphi, it can mean that I don't have Delphi, because it's like only Object Pascal syntax and nothing else. But maybe I’m wrong.

BRUNO: Well, personally, I think the landscape or the possibilities that if you do not use Delphi, and I'm thinking here about Android studio using Xcode directly or using other frameworks like react native for example. Well, of course, as a Delphi developer, this is a way more difficult learning curve to go this way that's why I think the FireMonkey framework shines in this respect that you can really create one code base solution for targeting iOS and Android mobile devices. Other than that, of course, I think that the new upcoming progressive web applications also start to offer amazing capabilities, and also this can be created from a single codebase targeting mobile iOS and Android devices. So, my personal preference would be to use the FireMonkey framework if it needs to be native applications that you can install and definitely when you need some specific hardware resources on the mobile devices, but I would definitely also keep an eye on progressive web applications and discover the enormous potential and the easiness of deployment of such type of applications on mobile devices. Then very important also the lack of restrictions that especially iOS imposes on this kind of applications.

SERGE: I see. Of course, you’ve mentioned FireMonkey and you’ve also mentioned that the landscape is changing all the time. What do you think and what do you feel: what is the future of FMX? Will Embarcadero continue to support it? Because I know how it is hard to support it. If iOS provides new SDK, Embarcadero writes all the wrappers and supports all these SDKs, at least most popular iOS SDKs, because even now FireMonkey does not cover all SDKs and feature classes. What do you think: this type of the solution, does it have a chance for the future? Will it be improved and developed by Embarcadero for example in 5 years or in 10 years from now?

BRUNO: It’s seriously challenging also knowing that what we see now at this very moment, for example the transition of Android 32 to Android 64 which is kind of not trivial for Delphi developers, also the future removal of OpenGL that the FireMonkey framework is based on for iOS application, where Apple will replace this with metal and so this in my opinion will require a serious rewrite of the underlying layers in the FireMonkey framework to continue to support iOS. So, definitely, this is the fast-moving landscape, this is probably the fastest moving landscape of all software platforms, targets, and for sure, it is a challenge for Embarcadero to keep up with this, but in my opinion they have no other choice because I think the cross-platform feature of the Delphi IDE is really crucial to stay important and relevant in the software landscape.

SERGE: Yeah, I see. Let's go back to the TMS WEB Core. I'm talking about TMS WEB Core because for me it's like cross-platform solution, it's not like FireMonkey project where you are using TMS WEB Core components. TMS WEB Core is a totally different product, type of the project which you are creating. Bruno, can we say that this right now is your main and most popular product which you are providing in your prospects and your advertisements?

BRUNO: It is the latest new product that we developed, so it's kind of normal that we pay a lot of attention to it, that we devote a lot of development on it, and also because we think it's a very nice technology and something that can make the development really productive, also targeting the web platform. Saying that this is our main product today, I do not see it this way. I see it as a very important part but we know that Delphi developers still use VCL applications, VCL development on a daily basis, and so, VCL components do remain crucial and very important. We see that Delphi developers develop cross-platform applications, we position our FNC components as crucial, because these FNC components are cross-platform, and as an additional advantage you can also use FNC components in web applications with TMS WEB Core. If you have some projects where you would like to target Linux clients, I do know that by now Embarcadero offers also FMX Linux for free but you could also use the Lazarus IDE and these FNC components will create maybe from the Lazarus IDE running natively on Mac OS or on Linux and create Linux applications using these components. The third category of products, which we call the business products, covers TMS X data. To create business logic, REST APIs, backends, this is also a very crucial part. And then, of course, there is WEB Core. So, the four main categories to which we devote all our attention are VCL, FNC, the business products, and TMS WEB Core.

SERGE: Maybe for people who are not familiar with this TMS WEB Core what typical products or recommendations can you provide? For which of the products this solution will be good or maybe for which projects it won't? What do you think?

BRUNO: I think the range of applications that can be created with WEB Core is probably as wide as the range of applications that can be created with the FireMonkey framework or the VCL component framework. For example, there is a customer and you use WEB Core to offer a web application that can be run from every device for helping people with mathematical formulas and to help them solve mathematical problems. On the other side, there is a totally different company with a totally different project that wants to use or is developing an application using TMS WEB Core for dealing with the stock market, a web client application from where you can track stops and do transactions and things like that. So there are other people looking at or developing with WEB Core creating applications for example to take pictures of problems with products and sending the pictures showing the problems directly to the company for analysis. So, it's really a wide range of possibilities and probably as wide as what people are doing with FireMonkey or with VCL. I personally do not see much limitations in TMS WEB Core application when you compare. FireMonkey applications or VCL applications quite the opposite in fact. Things like integrating with an artificial intelligence library like TensorFlow become easy in a WEB Core application, way easier than you would try to do the same thing from a VCL or an FireMonkey application. There exists such a high amount of existing code libraries functionality that you can easily interface with from a TMS WEB Core application and that it is actually way easier than the component set or the functionality that is included in TMS WEB Core itself, it's also in my opinion offering the easiness to interface with other libraries and very specific functionality that can be easily integrated into this type of applications.

SERGE: Thank You Bruno and here is the final question from me. I have a unique chance to ask Bruno questions. Bruno is a very popular speaker on different and almost all Delphi conferences all over the Europe and instead of going and paying a lot of money to buy a ticket, right now I have a direct line with Bruno. What are the risks to use all these components? Of course, TMS is a stable company but you know that some companies can die, teams can fall apart. What other risks do we have, except the situation if the vendor stops the support of the components. What do you think, Bruno?

BRUNO: That's a good question. I personally do not think too much in terms of I personally see more such things like opportunities and possibilities. For us it's a responsibility that is under no discussion whatsoever to do all that is needed to guarantee the stability of the company for probably as long as possible. Hopefully, for another 24 years to come. But that is in my opinion and that is what I strive for every day: to ensure that we are here today, we are here tomorrow and we are here in another five years, ten years, to assist our customers and enthusiasts, Delphi, Object Pascal developers, to help them creating good software solutions.

SERGE: You are talking about your company. But you know that I have a lot of these old-school coders which hate any third-party solutions, they want to do everything from the scratch and keep the code.

BRUNO: I want to say that one of my major concerns and one of the things that I really want to put my shoulders under is to support whatever is needed that young people pick up Delphi. So this is actually also a kind of invitation, an open invitation, how we can support students and young developers to embrace Delphi. I very much would want to put my shoulders under it has been my own experience working with students. When we worked together with them we can make them passionate about Delphi. I always say give me two weeks and I’ll make a student passionate about Delphi. The thing is I need to be able to get these two weeks and so any ideas are always welcome and we would really want to fully put our shoulders on it to help Delphi spread among young people. That's what I think is really needed and I think Delphi has a potential. I have seen it myself with my own eyes those young people being fascinated about the wide range of possibilities that Delphi offers.