Posted by admin in Delphi
Embarcadero’s RAD Studio XE2 allows the following database development pathways:
Delphi Object Pascal or C++ generated DataSnap middle tier data servers which run on a Windows server and allows the following thin clients to connect to it:
- Delphi Object Pascal or C++ VCL WinForms clients compiled for either Win32 or Win64
- Delphi Object Pascal FireMonkey compiled for native client application for any of the following platforms:
- Win64
- Win32
- Mac OS X
- iOS
- and in 2012, Linux and Java for Android
- via Mobile Connectors:
- Eclipse compiled java client for Android
- XCode compiled iOS client for iPad, iPhone
- Blackberry client
- Windows Phone 7 client
- isapi.dll web client hosted on a Windows web server
- RADPhP web application hosted on a web server (requires the DataSnap server to be a REST application)
- RADPhP mobile application packaged for mobile devices via PhoneCap
- .NET client created using Delphi Prism (REMObject’s Oxygene) Object Pascal for .NET running in MS Visual Studio
- ASP.NET web database application created using Delphi Prism (REMObject’s Oxygene) Object Pascal for .NET running in MS Visual Studio.
- Java client created using REMObject’s Cooper project – Object Pascal for java running in MS Visual Studio (in development)
Third party REMObjects is extending its Hydra technology to allow FireMonkey plugins to work on VCL Winforms, and vice versa, as well as WPF plugins to work in FireMonkey apps and vice versa – see here.
RADPhP web database application using MySQL database.
Posted by admin in Delphi
I had the honor yesterday of attending Embarcadero’s most exciting pre-release RAD Studio event yet – a summary of the new features are in the previous post.
This post I will explore the FireMonkey aspect of Delphi XE2 a bit more deeply.
Vector-based architecture features and implications:
- Firemonkey architecture is presumably a significantly enhanced non-VCL successor to Kryukov’s KSDev vector-based VCL components including VGScene, DXScene, ImageFX and his iOS compiler, for which Embarcadero acquired the IP (apparently in Jan 2011 when further development of his VCL components was ceased, and would explain why the Delphi community was taken by surprise with the recent announcement of FireMonkey).
- allows 3D modeling with all computing work performed by the device’s GPU (thus 3D features currently will not display if remote desktop or Citrix environment)
- allows assigning data points on a 3D model which can then linked via the new LiveBindings functionality to a source data, thereby enabling live 3D charting, etc
- can import various 3D models such as 3ds or Collada, with potential to add more support later.
- full zoom in and out capability without image degradation which means controls look good even on small devices when zooming is applied
- ability to apply 3D effects and filter effects to forms or components, thus one could create a page turning effect potentially.
- a critical difference to other vector based frameworks such as Abobe Flash and Microsoft’s WPF (an XAML DirectX .NET based technology with data bindings, upon which Silverlight is built), is that Apple allows FireMonkey applications to be added to their iTunes app store and thus made available for use on iPhones and iPads (ie. it is FPC-compatible).
- when compiled to a Windows platform, it utilises Direct2D and Direct3D, when compiled to Mac OS X or iOS, it utilises OpenGL.
- it is currently designed for native applications (ie. running independently of any web browser) and not for Rich Internet Applications (RIA) within web browsers (as does Silverlight or Air), and is not specifically targetting gaming development.
FireMonkey components:
- does not use Windows messaging and thus does not play well with visual VCL components in the same application, thus avoid them, BUT one still uses TDatasource, TClientDataset, etc.
- source code included – 99% is Object Pascal code with only a small section of non-pascal GPU code
- components designed to make migration from VCL as simple as possible by keeping similar naming and properties where possible but obviously events that take Windows messaging parameters had to be changed.
- new LiveBindings functionality (which also is now on VCL) means almost any property of a control can be unidireectionally or bidirectionally linked to a source – be it a form variable or TDatasource.dataset field, or other control parameter, this also means, some properties such as position x are no longer integer but Double.
- TFmxObject = class(TComponent);
- any object can contain other components to make it versatile and very easy to create customised objects
- just drop a component onto another component and it will become a child of that component – need to take care in the IDE when dropping components onto a form!
- heavily dependent upon interfaces
- IControl handles focus, mouse and keyboard events, implemented by TControl and TControl3D
- IRoot is interface to top-level containers and is implemented by TCustomForm
- IScene is the container for 2D objects and is implemented by TForm and TCustomLayer3D
- IViewPort is the container for 3D objects (and requires a GPU), and is implemented by TForm3D and TViewPort3D
- GPU-based shading filters which can be applied to bitmaps, forms and controls to give Photoshop-like effects
- new Animation functionality which allows one to modify a property value over time and thereby create changing colors, changing position, etc.
- new Styles is a CSS-like functionality which allows dynamic skinning with ability to save, load and modify at run time to dramatically alter the appearance of the application.
- new StyleBook is a container for styles and provided styles include Win7, MacOSX, etc, but of course one can create their own styles.
Live Bindings:
- available in VCL as well as FireMonkey and in effect makes ALL components and their properties data aware if you wish – very versatile and quite different to VCL’s data-aware approach which is not available in FireMonkey.
- can specifiy unidirectional or bi-directional links which have read/write capability via use of expressions
- a binding consists of 4 aspects:
- source object – this may be a TDatasource.dataset.field or a form variable or component
- source expression – a string which can be edited at runtime. For example, the name of the source property value you wish to bind to such as DisplayName if source is a TField
- control object – this is the destination object that you are binding to.
- control expression – a string which allows one to format the bound data for display, etc. and to specify the control property value which will be linked eg. label.text
- bindings are stored in TBindingsList, and also allow you to register methods available to be called from the expression strings. The expression evaluation engine also accesses the RTTI.
- one also needs to set a scope for the binding and this may be done automatically and uses TBindScope and TBindScopeDB (if linking to a TDatasource)
- instead of TDBNavigator, there is a TBindNavigator which links to a TBindScopeDB or a TBindScope.
- LiveBindings introduces wonderful new versatile opportunities (eg. you can bind to any component property and even to points on a 3D model) but does introduce a significant potential for runtime errors as the expression strings are no longer part of the compiler syntax mechanism, and particularly, if you change the name of a control or variable during refactoring and forget to change it within the expression, or just do a typing error, you will not get a compiler error but a potentially difficult to detect runtime error which may or may not create an exception.
- to create a LiveBinding on a form control, just click on the LiveBindings property of the control and you will have the option of creating one manually or choosing “Link to DB Field” which will automatically place the LiveBinding comonents on the form, and will display all TDatasources and their fields for you to select a field to bind to.
Cross-platform RTL support:
- TFormatSettings in SysUtils
- TOSVersion
- TZipFile in System.zip for crossplatform zip/unzip of files – now this will make life much easier!
- TLoginCredentials
- TPointF
Cross-platform debugging:
- this has been simplified – one copies the Embarcadero Platform Assistant to the target machine or virtual machine, specify port and optionally password then just run it.
- within Delphi IDE, define a remote profile specifying IP address, port and optionally password and remote paths.
- Run with Debug
Cross-platform development limitations:
- platform specific functionality obviously is not available for cross-platform compilation eg. Windows messaging (and thus the VCL), COM, menus (not available on iOS), OS API’s, MS XML transforms, etc
- whilst many GUI applications MAY be applicable for use as is across multiple platforms, the reality is that you would probably wish to have a GUI that is optimised for each platform, and this too is obviously not only possible with FireMonkey, but the best approach for many applications.
- presumably one could use compiler directives to access different API’s or to use COM for Windows compiles, or access iOS camera for iOS compiles.
- issues with Free Pascal for developing iOS apps – see here.
Current limitation issues which will almost certainly be addressed by XE3 release in late 2012:
- cannot compile to Linux, Android or Blackberry (but there are java based Datasnap client solutions for these platforms in the interim)
- no Windows 8 specific support as this has not yet been released by Microsoft.
- no customisable gesture support as is currently in the VCL, but usual gestures such as those on an iPad will work as they do normally without programming.
- compilation to iOS is only Object Pascal (not C++ yet) as it relies upon compilation using FreePascal (and thus certain features such as Generics, Anonymous methods are not supported), and then requires one to use Apple’s xCode IDE to do the final compile – but at least one can debug and edit the Object Pascal code within xCode and changes made within Delphi are automatically visible in xCode without having to go through the FreePascal again.
- iOS compile requirements:
- Mac Snow Leopard on an Intel Mac
- iOS SDK with developer subscription (4.2, 4.3)
- xCode 3.25 or 3.26 to do the final compile
- installed official FreePascal 2.4.4 binary required to build FPC 2.5.1
- if using virtual machine on the Mac such as VMWare Fusion, ensure you save your project to a shared folder that can be accessed by xCode
- once project saved in Delphi, use a command line utility to export to xCode files (in a subdrectory)
- then run xCode in OS X and open that project in the xCode subdirectory and compile, debug or run on a connected physical device or an emulation of the device
- your original object pascal code will be accessible, debuggable and editable within xCode!
Development machine:
- It would seem for cross-platform development, the preferred environment may be Mac OS X running Delphi within a 64bit Windows VMWare Fusion virtual machine.
- This would then allow running Apple’s xCode on the same machine and allow all debugging to be performed with the one computer.
Posted by admin in Delphi
Delphi developers are in for a big surprise as the World Tour of RAD Studio XE2 brings them some very unexpected opportunities as well as the expected Win64 compiler.
Here are a few of the new features in XE2:
64 bit Windows compiler:
- for most Win32 projects, just select compile to Win64 and you have native 64bit Windows executable or DLLs!
- if your project uses 32-bit assumptions, then these will need to be addressed, but otherwise it should just work.
- NB. NativeInt, NativeUInt, pointers, indexes to dynamic arrays, tag properties (now nativeInt) are 64bit
- Use your same source code and project files – just select an additional platform to build for in the project window
- Use the same Windows API calls in your code, although Microsoft have renamed some (eg. SetWindowsLong is now SetWindowsLongPTR)
- Use the same Runtime Library classes and functions
- Use the same VCL components and non-visual components
- new compiler directives include Win64, CPUX64
- can only access 64bit versions of dlls, ActiveX controls, bitmaps and COM objects (eg. 64bit MS Office will only work with 64 bit exe’s and vice versa)
- Win64 now ignores register, pascal, cdecl, and stdcall, so these are ignored in 64bit compilations.
- No Extended type
- issues with assembly code, SHL and SHR
New FireMonkey GPU framework for NATIVE deployment to Win32, Win64, OSX, iOS and Android:
- 1st the bad news – to convert your existing projects, you will have to migrate all your VCL-based code and components to FireMonkey components as the two are not compatible in the same project (because it does not directly use Windows messaging like the VCL does), and instead of data-aware components as in VCL, we now have Live data bindings for all components (these are also now available in VCL)
- Now, the fantastic news:
- awesome 2D and 3D rotatable, visual forms and components with enormous potential for native GUI apps
- you can apply the Gaussian Blur filter on your form at a strength you deem appropriate when a modal form is activated in front of it
- improved animations of visual controls
- compatible with TClientDataset and DBExpress components
- NATIVE deployment as Object Pascal code to target platforms including iOS and thus satisfies Apple’s iTune apps requirements
- Create a single application and target both Windows and OS X
- the framework makes extensive use of interfaces to establish contracts, not inheritance
- it is not managed code like .NET nor does it use AIR, Silverlight, HTML5 or CSS for its functionality but native code
Enhanced DataSnap DBExpress functionality:
- DBExpress ODBC driver
- new mobile and cloud connectivity in RAD Cloud – Microsoft Azure and Amazon support
- supports https
- new Datasnap server functionality includes client connection information and management of the connection from the server with ability to limit number of requests per connection, and ability to detect connects, disconnects, and to forecfully disconnect clients.
- DataSnap clients can be created for nearly every common device natively via FireMonkey although Linux, Android and Blackberry devices currently are limited to using java Datasnap mobile connectors, while Windows Phone 7 devices are limited to using C#/Delphi Prism Datasnap mobile connectors.
- one creates an Android Datasnap client in Delphi XE2 by creating a REST application and ticking the mobile connectors option which adds a DSProxyDispatcher component which will generate project java files such as DSProxy.java which can then be imported into Eclipse IDE for packaging as an Android app.
Enhanced VCL functionality:
- the VCL is NOT being made redundant as it is needed for Windows specific applications (eg. using COM, etc) and backward compatibility
- new functionality includes option of using the incredibly versatile LiveBindings functionality (see next post on FireMonkey) and new VCLStyles which allows a different mechanism of skinning to FireMonkey as it allows the use of a vsf file to be loaded at runtime, or added to the executable in Project options application appearance section, and then allows use of TStyleEngine and TStyleManager to set styles or load from file, but these styles are not applicable to menus, popupmenus or ribbons.
New RadPHP functionality:
- rich jQuery mobile components
- Create mobile-optimized web applications and standalone apps for iOS and Android devices using RadPHP – PhoneGap wizard allows packaging your application by creating java files for import into Eclipse java IDE, selecting a target platform (eg. Android v2.2) and running in the emulator before uploading to the Android store.
- Create mobile optimized web applications that work on all types of mobile devices with elements that behave similar to native mobile apps.
- Take advantage of touch optimized layouts, user interface elements, and professional looking theming using HTML5, CSS3, and JavaScript on the client and PHP on the server in an easy-to-use and visual way that only RadPHP can offer.
- Using jQuery in RADPHP and a technology called PhoneGap, you can now package up a PHP application and deploy it as a native Android application
Very exciting times indeed!!
You can register for the Australian part of the World Tour demonstrations here – the Melbourne event is next Thursday, the 11th August 2011.
Recent Comments