TMS RADical WEB, open to other Javascript frameworks

Bookmarks: 

Monday, February 19, 2018

By design, the Pascal to Javascript compiler that is integrated in the Delphi IDE via TMS WEB Core provides a thin, direct and thus high-performance layer to Javascript. This also means that it is fairly easy to interface directly to all kinds of functionality offered by Javascript libraries including Javascript UI controls libraries.

The proof of the pudding is in the eating and to begin with, TMS WEB Core will offer out of the box a complete set of Pascal components that wrap the jQuery jQWidgets UI control set.



This is a very complete & consistent jQuery UI control set including masked editors, ribbon, calendars & datepicker, powerful paging grid, ... and many more.

We are busy creating this set of easy to use wrappers in agreement and cooperation with the jQWidgets company. A first set is already available in the TMS WEB Core technology preview available today. This is the list of controls on the Delphi tool palette we have so far covered and the team is at this very moment busy tackling the jQWidgets grid:



Via Delphi components you can drop these jQuery controls on the form, set properties, implement event handlers etc...



To interact with these jQuery controls, you will as such fully use the Pascal language. For deployment, all you need to do is put the jQWidgets Javascript & CSS files into the subfolder jQWidgets of your web project. Over time & steered by your feedback and requests, we will consider adding many more thin Pascal wrapper classes for other interesting Javascript libraries, frameworks, UI controls.

Get started today: Technical previews of TMS WEB Core, TMS FNC UI web-enabled controls, web-enabled TMS XData, the first parts under the TMS RADical WEB umbrella are exclusively available now for all active TMS-ALL-ACCESS customers. The jQWidgets UI controls library files can be obtained from https://www.jqwidgets.com. jQWidgets offer a free for non-commercial use license as well as licenses for commercial use.

Bruno Fierens


Bookmarks: 

This blog post has received 7 comments. Add a comment.



TMS RADical WEB, connecting to data

Bookmarks: 

Saturday, February 17, 2018

As Delphi developers we are used to frameworks and components to take the chore out of using databases. Ever since Delphi 1, database handling was abstracted by the TDataSet & TDataSource. Wouldn't it be nice (and mainly productive as this is what is important after all) if this exact abstraction model allowed us to create web applications consuming data? Exactly that goal is what we wanted to achieve with TMS WEB Core, only technically under the hood things are RADically different from the implementation of Delphi 1 like datasets and datasources. So, with TMS WEB Core, you have your DB-aware edit, label, combobox, datepicker etc... and these can be hooked up to a datasource and a datafield can be specified. The dataset though is in this case a wrapper component that will under the hood do its work getting data or updating data via the use of REST HTTP calls to microservices exposed on a data server. As our TMS XData product already provided exactly that: exposing your databases via REST HTTP calls, we extended it to have a web XData client component so you can from Delphi, create a web application against an XData client and hook up your DB-aware components to an XData dataset, pretty much the same way as you can for VCL or FMX native client applications.

For the sake of demo purposes, we have created a first sample app with a web client dataset. This web client dataset gets its data in JSON format from a server via a HTTP REST call. This allows to view and edit the data in the web client dataset but won't do updates server side so that it isn't possible to 'fiddle' with the data and break the sample this way.

Here you can see a form editing contact info with several DB-aware controls, including a DB-navigator.



When the dataset is connected to the server, the DB-aware controls display and can edit the data.



Connecting to an XData based server is one possible way to hook up to databases. You can implement your own interfaces to a database server via REST HTTP calls and over-time we plan to create and offer connectors to such server as Embarcadero RAD server, Google Cloud datastore and several others...

Get started today: Technical previews of TMS WEB Core, TMS FNC UI web-enabled controls, web-enabled TMS XData, the first parts under the TMS RADical WEB umbrella are exclusively available now for all active TMS-ALL-ACCESS customers.

Bruno Fierens


Bookmarks: 

This blog post has received 4 comments. Add a comment.



TMS RADical WEB, proud to announce a revolutionary & innovative UI control set that is TMS FNC for web

Bookmarks: 

Friday, February 16, 2018

Over two years ago, we did deep research at TMS to create a UI control abstraction layer that would allow to create UI controls that can be used to create VCL Windows applications, FMX cross platform applications for Windows, iOS, Android, macOS and also LCL applications with the free Lazarus IDE for Windows, macOS and Linux. The result of our deep research was our FNC component framework.


Meanwhile, we are proud that we have already a wide range of sophisticated UI controls based on the FNC framework available like a grid, treeview, planner, chart, ribbon, tableview and many more plus also several new controls in development. We have noticed that for many developers there is still a bit of confusion about what FNC really means. Except there is a lot of technical magic behind FNC, for developers the result is really simple. You have one UI control set available that you can use simultaneously to create VCL, FMX or LCL applications. Yes, with one UI control set, you choose what framework you want to use, be it VCL, FMX or LCL. Irrespective of the framework you use, you can use the exact same controls, you can share or reuse application code dealing with these UI controls between the different frameworks and you have only one learning curve to get the most out of these powerful controls.




While VCL, FMX, LCL have been able from the first stage of FNC controls, from now on, the web is a major new target for using your FNC UI controls. That we even managed to web-enable our FNC abstraction layer is certainly a proof how solid that framework was designed from the beginning, but it remains nothing short of unbelievable, revolutionary and innovation that the exact same source code produces UI controls usable simply everywhere: native desktop, native mobile and web. And this on almost any modern electronic device on the planet: as installed native application or as web application you use via your browser on your Windows laptop, your iPad or iPhone mobile device, your Android smartphone, your macOS, your Linux machine and even on your Raspberry Pi SBC.

See it to believe it and be amazed!

This is our FNC Planner that worked before in Windows, iOS, Android, macOS and yes also on Linux and even Raspberry PI, now it makes the giant leap to the web and runs in every HTML5 supporting web browser on every device on the planet:


Now, back to web development with TMS WEB Core and TMS FNC UI Controls installed, you have an FNC tab of UI controls available on the tool palette.



As you expect it, you drop the TMS FNC UI control on the web form, you set its properties, add event handlers, add code and you see the FNC UI control in the web application after pressing F9 to run the application. The FNC UI Control appears WYSIWYG in the web form designer as it appears in the browser and in the browser, it also nicely takes advantage of zoom in/out or retina/high DPI handling. Go ahead and play with the FNC controls demos in your browser of choice:

Get started today: Technical previews of TMS WEB Core, TMS FNC UI web-enabled controls, web-enabled TMS XData, the first parts under the TMS RADical WEB umbrella are exclusively available now for all active TMS-ALL-ACCESS customers.

Bruno Fierens


Bookmarks: 

This blog post has received 2 comments. Add a comment.



TMS RADical WEB, RAD web development from the Delphi IDE

Bookmarks: 

Thursday, February 15, 2018

It cannot be denied that RAD component-based application development is the very foundation of Delphi software development. It is the foundation that got us all so excited since Delphi 1 in 1995. It got us not only excited but most of all very productive.

Encapsulation of UI controls and other functionality in components with easy access to properties, method and events is what lets developers focus on business logic and their problem domain rather than underlying technical tricks used to render the UI or access operating system functionality.
It is in this respect that our team went to great lengths to offer this RAD experience in the Delphi IDE that does not really have a web target.
With TMS WEB Core, all that is offered. Via File, New, Other, select a new TMS Web application and a new project is created with a first form ready to start building your application.



While the developer cannot really see this, technically, this is a VCL form but our IDE integration ensures that for this web form, only TMS web controls can be picked from the tool palette. This is the tool palette with the set of UI controls & components that is currently already available.



You can build your UI together this way like you did the past 23 years for VCL applications or the past 7 years for FMX applications. When you compile the application, a HTML file and Javascript file is produced. By default, the TMS WEB Core IDE integration launches a small TMS Web server for debugging purposes allowing the developer to see the application running in the browser. As such, the so familiar development cycle of designing forms, setting properties, adding event handlers, writing code and press F9 and see within a fraction of time the result running and working or have the capability to debug the application, is achieved.



Compared to VCL or FMX application form designing, there is an optional but very fundamental difference between VCL/FMX application forms and web forms. While it is perfectly possible to have the WYSIWYG model, i.e. what you see in the Delphi IDE form designer is what you get when running the web application, TMS WEB Core facilitates alternative ways. The web page design and layout can be fully created with HTML/CSS. It can be easily created by people with different talents than us software developers, i.e. graphic designers. TMS WEB Core allows for easily hooking up our forms with UI controls to pages designed with HTML & CSS. More about this technique will be covered in a separate blog.



My colleague dr. Holger Flick, Embarcadero MVP, brings it all together here:



Get started today: Technical previews of TMS WEB Core, TMS FNC UI web-enabled controls, web-enabled TMS XData, the first parts under the TMS RADical WEB umbrella are exclusively available now for all active TMS-ALL-ACCESS customers.

Bruno Fierens


Bookmarks: 

This blog post has received 8 comments. Add a comment.



Announcing TMS RADical WEB

Bookmarks: 

Wednesday, February 14, 2018

The world of web development has evolved at a fascinating pace over the past 15 years. I still remember having developed around 2001 a CGI-bin based WAP pages server application, a solution that is these days not only completely irrelevant (anyone still knows what WAP and CGI-bin is?) but technically fully outdated.



While the strength of Delphi (and thus the Pascal language) was originally in Windows desktop applications and from 2011 in cross platform native desktop and mobile applications, developing web applications was always a kind of side-affair for Delphi developers. Many Delphi developers as such also looked over the fence at other solutions to create web applications.

Over the past couple of years several welcome trends have developed: the HTML5 standard became widely accepted and available in modern browsers, the Javascript Ecma 5 standard made it a stronger language with object-oriented capabilities, CSS3 offers a styling & layout features so rich that most developers know not even half of its power.


Wouldn't it be a dream come true that Delphi/Pascal developers could also reach out to this platform? At TMS software we always felt this lacking over the past years.

A little less than a year ago, we were approached by the bright minds who were for a longer time already working on a Pascal to Javascript compiler and asked if we didn't think it would be interesting to bring the power of this new compiler in the hands of Delphi developers with a framework & IDE integration to take advantage of it. This was the kind of moment where my enthusiasm must have been at about the same level when I dropped the first components on the Delphi 1 form designer in 1995 or when I got my first FireMonkey application started on my iPhone 4 thanks to the cross-platform capabilities in Delphi XE2. Now, in 2018, we're pleased to announce a kind of similar wow experience will become available that allows you to build an application in a component based RAD way in the Delphi IDE, press F9 and see the app working in your browser.


TMS RADical WEB is the umbrella name under which several web enabled products will be created and offered by TMS software and it is built upon a couple of fundamental pillars:

  • Backed by a solid & proven Delphi/Pascal to Javascript compiler that was years in development
  • Modern SPA web application model. The application consists of HTML & Javascript files that can be easily deployed on any existing light or heavyweight webservers or cloud services like AWS, Azure
  • Component based RAD development integrated in the Delphi IDE
  • Standard component framework for common UI controls and access to browser features
  • A truly revolutionary & innovative TMS FNC component framework that is now also web enabled, allowing to create UI controls that can be used on VCL, FMX, LCL and WEB!
  • Open to consume other existing Javascript frameworks & libraries, open to use HTML/CSS for design
  • Binding to server data via microservices with seamless interfacing to server data via TMS XData
  • Binding to cloud services


The first building block under the TMS RADical WEB umbrella is TMS WEB Core. TMS WEB Core offers the full RAD integration in the Delphi IDE of standard components, compiler & form designer. The next block is TMS FNC UI controls that are web-enabled. Third is TMS XData extended with a web XData client. As a first step to bring TMS RADical WEB to you, will be the delivery of a technical preview of TMS WEB Core, TMS FNC UI Controls for web and TMS XData with web client to our TMS ALL-ACCESS customers. Our TMS ALL-ACCESS customers sit as such in a first-class seat to experience this exciting new route to web development and influence the further fine-tuning with feedback, requests, comments. After this initial period, TMS WEB Core will then also become widely available to all customers.

Over the coming days, I'll give a deeper insight in each of these pillars of TMS RADical web. Watch this blog space! Every day we will have a new blog about our new web development products.
Coming blog articles are:
  • RAD web development from the Delphi IDE
  • Proud to announce a revolutionary & innovative UI control set that is TMS FNC
  • Connecting to data
  • Open to other Javascript frameworks
  • Using HTML & CSS for design & layout of your application pages
  • Using common web functionality & consuming cloud services
  • Debugging your code
  • History, team behind TMS RADical WEB and future



My colleague dr. Holger Flick, Embarcadero MVP brings it all together here:



Get started today: Technical previews of TMS WEB Core, TMS FNC UI web-enabled controls, web-enabled TMS XData, the first parts under the TMS RADical WEB umbrella are exclusively available now for all active TMS-ALL-ACCESS customers.

Bruno Fierens


Bookmarks: 

This blog post has received 19 comments. Add a comment.



The Exit Procedure

Bookmarks: 

Monday, February 05, 2018

Photo by Kev Seto on Unsplash

All Pascal programmers know the Exit() procedure since the early versions of the compilers. But do they know how to use it correctly?

The Exit() procedure is used when we want to exit of running scope. That scope could be a function, procedure, method, or even the program itself.

Let's say that a console program calls a procedure named Execute:

    procedure Execute;
    begin
      Writeln('1. Passing on this line...');
      Exit;
      Writeln('2. It will not pass here');
    end;

In the example above, only the information from the first Writeln will be shown on the console.

When exiting a scope, the program immediately returns to the previous scope (another function/procedure/method or the program itself). The only exception to this rule is when there are try-finally blocks. If Exit () is called within a try-finally block, the compiler will execute the code inside the finally-end before it exits the scope.

Here is another example:

    procedure Execute;
    begin
      try
        Writeln('1. Passing on this line...');
        Exit;
      finally
        Writeln('2. I am still here!');
      end;
      Writeln('3. It will not pass here');
    end;

Texts #1 and #2 will be shown on the console. Even though Exit() was called before the text #2 was printed, the code still runs because of try-finally.

Another example of using Exit() is when we do validations. If a validation or checking does not return true, we use Exit() to stop execution of the current scope.

Suppose that we want to add two integer numbers, but we only want integers bigger than zero:

    function Sum(A, B: Integer): string;
    begin
      Result := 'Invalid result';
      if (A < 0) or (B < 0) then
        Exit;
      Result := Format('The result is %d', [A + B]);
    end;

In the above example, the return of Sum function is initialized with an invalid value and then there is a validation to know if the values are less than 0. If the test fails, the program will return to the prior scope to calling Sum function with the invalid result. But if the test does not fail, the function result will be the sum of A and B.

There are those who are adept at structured programming and prefer do not "break" the program execution with an "early exit", which means they do not use Exit() because they believe the code would be simpler.

So, let's rewrite the previous example:

    function Sum(A, B: Integer): string;
    begin
      if (A > 0) and (B > 0) then
        Result := Format('The result is %d', [A + B]);
      else
        Result := 'Invalid result';
    end;

Looks simpler? Well, in this example I would say yes. But for examples with more conditionals, I'd say no (let's see this below).

What if we wanted to tell the user that their data is not correct?

    function Sum(A, B: Integer): string;
    begin
      Result := 'Invalid result';
      if (A > 0) then
      begin
        if (B > 0) then
          Result := Format('The result is %d', [A + B]);
        else
          Writeln('B should be greater than zero');
      end
      else
        Writeln('A should be greater than zero');
    end;

In this example, we do not use Exit() and I think the code is quite confusing. The tests are "separated" from the warning return to the user (Writeln).

Kent Beck, Martin Fowler stated categorically that "one exit point is really not a useful rule. Clarity is the key principle: If the method is clearer with one exit point, use one exit point, otherwise don't".

So, let's rewrite the previous example using Exit():

    function Sum(A, B: Integer): string;
    begin
      Result := 'Invalid result';
      if (A < 0) then
      begin
        Writeln('A should be greater than zero');
        Exit;
      end;
      if (B < 0) then
      begin
        Writeln('B should be greater than zero');
        Exit;
      end;
      Result := Format('The result is %d', [A + B]);
    end;

The code got a little bigger, it's true, but the tests and warnings for the user got simpler, in my opinion. You do not have to follow all nested if-else's. For each test that fails, the warning is just below and the scope will be aborted with the use of Exit. If all tests do not fail, the function will return the sum of A and B.

In Delphi, as of 2009 version, Exit() procedure has gained an improvement: Exit() can have a parameter specifying a result. The parameter must be of the same type as the result of the function.

The FPC also has the same definition, but I do not know who implemented this new feature first.

Again, let's rewrite the previous example:

    function Sum(A, B: Integer): string;
    begin
      if (A < 0) then
        Exit('A should be greater than zero');
      if (B < 0) then
        Exit('B should be greater than zero');
      Result := Format('The result is %d', [A + B]);
    end;

Simple and clean.

Exit() can be given any type of return, even instances of Interfaces. Using this parameter, it is as if we get the same behavior as the return reserved word in Java. However, Exit() together with Result, gives us even more possibilities to return from functions.

See you.



Marcos Douglas B. Santos


Bookmarks: 

This blog post has received 3 comments. Add a comment.




Previous  |  Next  |  Index