Delphi Prism Reviewers Guide

Abstract: The Delphi Prism Reviewers Guide is designed to inform reviewers about the features and capabilities of Delphi Prism.

Introduction

Thank you for taking the time to review Delphi Prism. This guide is designed to inform you about the capabilities, features, and attributes of the product so that you can be fully informed when writing your review. Delphi Prism is a brand new product, and so this guide will help you get familiar with it.

General Overview of Delphi Prism

Delphi Prism is a feature-rich, powerful development tool for the .NET 3.5 Framework. By providing a powerful Object Pascal language that enables access to the entire .NET framework and a powerful, complete Integrated Development Environment (IDE), Delphi Prism is a complete .NET development tool. Delphi Prism developers can design and deploy applications for ASP.NET, Windows Forms, and Windows Presentation Foundation (WPF). In addition, Delphi Prism is focused on running against the Common Language Runtime (CLR) any where that it may be deployed, including the Mono platform on Linux and the Mac.

2 GB of available space required on installation drive (includes space for .NET Framework and SDK)

Mouse or compatible pointing device

Supported Operating Systems

Windows XP Service Pack 2 or above

Windows Server 2003 Service Pack 1 or above

Windows Server 2003 R2 or above

Windows Vista

Windows Server 2008

Delphi Prism will run on both 32-bit and 64-bit operating systems.

Installation

The Delphi Prism installer is normally downloaded from the web. Media kits containing the entire product are also available.

The installation executable will install the entire product. If a current install of Visual Studio 2008 is already present on the machine, then Delphi Prism will integrate into that existing installation. If there is no Visual Studio 2008 present, then Delphi Prism will install the Visual Studio Shell before installing Delphi Prism into the Shell.

Editions

Delphi Prism has two different editions to cater to different market segments – Professional, and Enterprise.

Professional

The Professional edition of Delphi Prism is designed for developers who need a general purpose, .NET development tool with limited or local-only database access. The Professional edition includes the full-featured IDE, the Delphi Prism language, local access to InterBase and Blackfish SQL via dbExpress for ADO.NET. In addition, the Professional edition includes a database-neutral implementation of the ASP.NET Provider Model with support for Blackfish SQL and InterBase.

The Professional edition is attractive to Independent Software Vendors (ISVs), professional developers without a need for remote database access, and any developer wanting to develop general Windows applications and utilities.

Enterprise

The Enterprise edition of Delphi Prism is designed for developers who want remote access to dbExpress databases, specifically Blackfish SQL and InterBase. In addition, the Enterprise edition enables the development of clients to connect to multi-tier servers built with DataSnap in Delphi 2009.

Delphi Prism is also available as part of CodeGear RAD Studio 2009 Professional, Enterprise and Architect editions.

Localized Versions

Delphi Prism is shipped in four localized versions: English, French, German, and Japanese. Developers can choose any of the four localized versions to install.

Main Features of Delphi Prism

Support for the CLR on Multiple Platforms

One of the main features of Delphi Prism is its support for the CLR where ever it resides, particularly Mono for Linux and Mono for the Mac. Delphi Prism’s compiler is a managed code application and can run on Mono for both Mac OS X and Linux. In addition, the compiler produces completely standard Intermediate Language (IL)-based assemblies, meaning that those assemblies can run on the Common Language Runtime (CLR) on any operating system.

More information about running Delphi Prism applications on the Mono platform can be found in the CodeGear Developer Network Article entitled “Using Mono and Delphi Prism”.

Delphi Prism ships with the Mono for Windows 2.0.1 platform, installing it if the user desires.

Heterogeneous Database Access

Delphi Prism includes the powerful dbExpress IV framework, adapted to work with ADO.NET. This means that .NET developers are not limited to a specific backend database, but instead, can use a single framework to communicate with multiple databases. This version dbExpress includes support for InterBase and Blackfish SQL, with more databases to come in future feature updates.

Database-neutral ASP.NET Development

Delphi Prism also includes a dbExpress-based implementation of the ASP.NET Provider model. Therefore, Delphi Prism developers can not only access data in a neutral way with dbExpress, but they can also use a dbExpress-based database for their roles, profiles, and membership requirements in ASP.NET.

Multi-tier Client Development with DataSnap

Delphi Prism also includes an ADO.NET driver for DataSnap. DataSnap is Embarcadero’s powerful, dbExpress-based multi-tier development framework. With Delphi 2009, developers can build middle-tier application servers that provide “gatekeeper” access to any backend database. These servers can provide both direct connections, access to data, and general method functionality via server methods.

Server Methods are special methods provided by a class on the application server. By using the dbExpress typing system, developers can easily expose server methods to DataSnap Clients. Delphi Prism provides the ability to import a DataSnap server into ADO.NET. Server Methods that return Datasets are viewed as tables, and server methods are viewed as Stored Procedures. Thus, developers can, in effect, write stored procedures in Delphi code and consume them in Delphi Prism.

The Delphi Prism roadmap calls for the ability to build DataSnap servers in Delphi Prism.

Language Features

The Delphi Prism language is a powerful, full-featured language for use with the .NET 3.5 Framework. It supports all language idioms required by .NET, including features like LINQ, anonymous methods and delegates, generics, etc. Delphi Prism has strong roots in the world of Object Pascal, and thus the syntax will be very familiar to any Delphi developer. If required, existing Delphi code can be easily migrated from Delphi for Win32.

The Delphi Prism language has all the modern language features that .NET developers expect, and more. Some specific language features that illustrate the power of Delphi Prism are discussed below:

Generics

Generics allow the developer to write code that refers to a type without having to specify the specific type of that type. Often called Parameterized Types, generics provide developers with the ability to write general, or “generic’ classes that operate on a non-specific type. The class use case for generics is a list, where the type of the items contained within the list need not be specified when the list is written.

The members of a generic class that reference the generic type will have their actual type filled in at runtime by the Just-In-Time compiler. The Microsoft .NET Framework comes with several built-in generic classes, e.g. the List<T> type, which is a dynamic list structure containing references to any number of type T. T can be any type at all, and Tlist<T> will be a type-safe list of whatever type the developer desires.

Generics can also constrain the type passed as a parameterized type. Using constraints can ensure that the generic type passed as certain functionality, implements a specific interface, is a class or record, or has a parameter-less constructor.

Class Contracts

Class Invariants

Class invariants are restrictions placed on a class declaration that will ensure that a given variable meets a given state. For example, the following class declaration requires that the SomeInteger variable always be greater than ten. If code assigns a value less than ten to the SomeInteger variable, and Assertion will be raised.

Require/Ensure

Class definitions can add require sections before the method body, and an ensure section at the end of a method body. These sections define pre- and post-conditions that must be met for the code to execute normally. These sections are Boolean statements that will be checked to be true before and after execution.

Class Contracts are normally used to check for the validity of input parameters, results, or for the state of the object required by the method. If a Class Contract is “broken”, an assertion is raised.

The 'old' scope prefix can be used in the 'ensure' section for local variables and parameters to refer to the original values before the execution.

The compiler will add code to save these to local variables before executing the method body; 'old' is supported for strings and value types.

Both Method Contracts and Class Invariants allow developers to explicitly and clearly declare the requirements for code, ensuring that code is of higher quality and performs as expected and designed.

LINQ

LINQ – Language Integrated Query – is a new, powerful language idiom that allows developers to perform SQL-like queries on any iterated data structure directly in code. As a simple example, the following code and be used to select customers based on their age:

Note the assignments to the YoungCustomers variable that use the new LINQ syntax for selecting customers easily out of the customer Sequence.

LINQ can also be used to query against Datasets and any other data structure that supports an enumerator.

Property Notifications

Property Notifications are a language feature that provides notifications to properties when the value of the property is changed. When notify is used on properties, the class will implicitly implement the System.ComponentModel.INotifyPropertyChanged and System.ComponentModel.INotifyPropertyChanging interface and invoke the event defined in that interface when the property itself is modified.

By default, it will pass the name of the property as defined in the class, however, notify supports a string parameter to change the name of the property passed to the event.

Futures

Futures are a new language concept designed to facilitate Parallel Computing and developing applications that scale well on multi-core and multi-CPU systems. A future is a strongly typed variable that represents a value that might or might not have been calculated yet, but is guaranteed to be made available when needed.

Consider the following snippet of pseudo code that calculates the Sum of values in a binary tree:

This code first calculates the Sum of the left part of the subtree, then that of the right one. Finally, the two values are combined. Calculating the value of both "l" and "r" might take a relatively long time, yet the value of "l" is not actually needed until the very last line of the method. This is an ideal candidate for a future:

Instead of calculating the value of "l" in place as before, "l" is now defined as a future Int32, declaring that the variable does not actually hold the value of Left.Sum, but just the promise that, at some point in the future, it will. This first line of code will execute in virtually no time, and the method can move on to calculating "r", which is unchanged and will happen in line, as before.

Async Methods

Methods marked with the Async keyword are executed in a separate thread. Implementation depends on whether the PFX framework is present. If so, Async statements are run via the PFX framework as a task; otherwise, they are added to the .NET thread pool.

To define async statements, the async keyword can be added before the statement, for example:

A complete examination of the Delphi Prism language can be found on the online wiki.

Integrated Development Environment

Delphi Prism integrates with Visual Studio Shell as an IDE. As a result, Delphi Prism developers have all the power and features of that platform. If Delphi Prism is integrated into a Visual Studio installation, then Delphi Prism project groups can include code from C#, VB.NET or other languages, and projects from those languages can include Delphi Prism code as well. Delphi Prism developers can utilize all the power of the Visual Studio IDE including Intellisense, Error Info, Code Snippets, Parameter Info, debugging and more. Delphi Prism is a fully integrated language plug-in and a full-fledged member of the .NET language eco-system.

Designers

Delphi Prism developers can utilize all the design-time support for Winforms, ASP.NET, and WPF development. When integrated with Visual Studio itself, Silverlight design-time support can be installed.

Third-Party Components

Delphi Prism developers can install and use the vast array of third-party components for WinForms, ASP.NET, WPF, and Silverlight. Components from vendors like Developer Express, Infragistics, TMS Software, and other commercial vendors are all useable in Delphi Prism. Open source and freeware components written in other .NET development languages can be used. The full array of .NET components is available to Delphi Prism developers.

Visual Studio Eco-system

Delphi Prism developers can install and use most of the wide variety of Visual Studio plugins and add-ins. For example, all MSBuild actions are usable by Delphi Prism. In addition, Visual Studio plugins that don’t require specific language functionality are all available to Delphi Prism developers. Delphi Prism includes a full implementation of the .NET CodeDOM. Libraries like NUnit, NHibernate, and other popular .NET projects are all usable by Delphi Prism developers

Documentation

Documentation for Delphi Prism is wiki-based. In addition, a snapshot of the wiki is shipped with Delphi Prism, so developers can have a copy of the wiki on their own systems. In addition, developers can at any time grab their own snapshot of the current state of the wiki for themselves.

Because the documentation is wiki-based, the documentation can be frequently updated and continually enhanced, both by Embarcadero employees and community members. Articles can be added and enhanced, and examples can be included. Overall, this makes for a dynamic documentation experience, with the help being continuously improved and frequently updated.

Included and Recommended Third-party Tools

Included Tools

Delphi Prism ships with a number of third-party tools and products.

InterBase Developer Edition

Delphi Prism ships with a Developer Edition of InterBase, Embarcadero’s native, cross platform Relational Database Management System (RDBMS). InterBase Developer Edition allows developers five connections to the server hosted on their local machine for the purpose of developing applications that use InterBase. Once the application is developed, developers can purchase deployment licensing from Embarcadero.

Blackfish™ SQL

Blackfish SQL is a high-performance, small-footprint, SQL-92 compliant transactional database. Blackfish SQL is a fully-managed RDBMS that runs on both .NET and Java. Running either in-process or out-of-process, and with a small footprint of just over one megabyte, Blackfish SQL is easily deployed and embedded, yet retains the full power needed by all types of database applications, from enterprise applications to embedded ISV applications.

Delphi Prism includes a special edition of Blackfish SQL – Blackfish SQL RAD Studio Edition. The RAD Studio edition is freely deployable with any application. Professional edition users can deploy applications built with Blackfish™ SQL with the limitation of local only connection to 1 user/5 connections and databases up to 512 megabytes in size. Enterprise and Architect developers can deploy applications with as many as 4 users/20 connections and 2 gigabyte databases. If developers require deployment beyond those limitations, additional unrestricted deployment licenses can be purchased from Embarcadero.

Mono for Windows

Delphi Prism by default will install the Mono for Windows 2.0.1 framework. Developers can create new projects to run against this framework. More information about the Mono framework can be found at the Mono Project.

InstallAware Express

Developers frequently need to create full-featured and powerful installations for their products. Delphi Prism includes the Express edition of InstallAware, enabling developers to build professional, MSI-based installations. More information about InstallAware and its capabilities can be found at the InstallAware website

Recommended Tools

DPack IDE Expert

DPack Collection of tools for Visual Studio is a free download that includes a number of experts, Wizards, and plugins for Visual Studio that enhances the Delphi Prism experience and that makes it easier for Delphi developers used to the Galileo IDE (i.e., the IDE from Delphi 2009) to adapt to using Visual Studio. Features include numbered bookmarks, automatic solution backup, a Code Browser, and a keyboard binding that matches the standard keyboard layout for Delphi’s Galileo IDE.

The Oxidizer Code Converter

Oxidizer is a free tool that, when used in combination with ShineOn, helps to port Delphi (Win32 and .NET) projects to the Delphi Prism language. Oxidizer is a command line tool that will process *.pas source files from Delphi and make many necessary changes to adapt the code to the Delphi Prism language.