Delphi Everywhere…
Last week there was lots of Delphi across Europe with David I. Here are some photos from events.
At this very moment David I is posting about what we were doing in Amsterdam on Wednesday.
On Tuesday we have been to Twyford, UK. Here discussing AJAX support in Delphi VCL for the Web framework with Delphi developers.
There is lot of good spirit in our company just few days before joining Embarcadero Technologies. Future just looks bright:-)
Now I’m watching European Cup quaterfinals and looking forward to SDN Event conference in Ede on Monday.
Share This | Email this page to a friend
Posted by Pawel Glowacki on June 21st, 2008 under Uncategorized | 1 Comment »Register and join me for two live Delphi webinars tomorrow
If you are interested in Delphi web services and web programming, feel free to join me tomorrow for two live Delphi webinars: "Delphi for .NET 3.5 RESTful web services" and "Introduction to Delphi VCL for the Web Programming".
More details below:
Date: 10 JUNE 2008
Time: 11:00 (CEST), 10:00 (GMT)
Length: 60 min
URL: http://borland.interwise.com/borland/iClass/VR6182/
Title: "Delphi for .NET 3.5 RESTful web services"
Presenter: Pawel Glowacki
Language: English
Description: This webinar covers Delphi for .NET 3.5 RESTful web services programming. It starts from understanding RESTful web services, and then continues to building simple RESTful web services in Delphi 2007 with .NET.
The support for REST web services was added in the recent .NET 3.5 to Windows Communication Foundation programming model introduced in .NET 3.0. RESTful web services direcly relies on HTTP protocol and do not use SOAP stack. The HTTP protocol is text-based, so the use of XML as a data interchange format is optional and not mandatory as with SOAP-bases web services. The JSON is gaining lots of interest among RESTful web services developers as a "fat free" alternative to XML. The .NET 3.5 adds a possibility to declaratively choose between XML and JSON as serialization format that goes over the wire.
The WCF is a natural evolution of the first generation ASMX web services that evolved from WSE. In the WCF’s ellegant object model not only messaging (XML or JSON) is decoupled from the underlying transport (HTTP or binary), but also it is possible to host WCF services in arbitrary Windows processes. The webinar continues to demonstrating hosting WCF services in ASP.NET Delphi .NET web applications and Delphi .NET Console applications.
Date: 10 JUNE 2008
Time: 15:00 (CEST), 14:00 (GMT)
Length: 60 min
URL: http://borland.interwise.com/borland/iClass/OR7035/
Title: "Introduction to Delphi VCL for the Web Programming"
Presenter: Pawel Glowacki
Language: English
Description: This webinar covers basics of building native Delphi AJAX web applications with the VCL for the Web framework. One of the most interesting new features in CodeGear RAD Studio 2007 is AJAX support in the VCL for the Web framework. The VCL for the Web is a framework and component set for building web applications in a true RAD manner. Using VCL for the Web you can create, debug and maintain web-based applications as quickly and easily as your normal Delphi applications. You do not need to be HTML or JavaScript expert to build responsive AJAX-powered web applications with the VCL for the Web. Building web applications with the VCL for the Web is very similar to creating traditional Delphi VCL Forms applications. Just drop a bunch of components from the Tool Palette onto the form designer, modify their properties at design-time with Object Inspector, add some code in event handlers and you are up-and running.
In this webinar we are going to discuss different VCL for the Web application types, using "Sessions", form navigation and controlling page layout with styles and templates.
Share This | Email this page to a friend
Posted by Pawel Glowacki on June 9th, 2008 under Uncategorized | 1 Comment »David I in Europe this month! Book your agenda now!
Great news to all european developers! David I - CodeGear Chief Evangelist - is going to present in coming week on events in Italy, Germany, UK and the Netherlands.
Marco Cantu’s Delphi Day in Piacenza Conference, June 12
Delphi Tage, Gunzburg Germany, June 13 and 14
David I. Delphi meet up in Twyford, UK, June 17
David I. Delphi meet up in Amsterdam, Netherlands, June 18
I’m really looking forward to see David I and I’m sure it is going to be great fun:-)
Share This | Email this page to a friend
Posted by Pawel Glowacki on June 4th, 2008 under Uncategorized | Comment now »Greetings to all Czech Delphi Developers:-)
More then 130 developers attended "CodeGear RAD Studio 2007" presentation during recent "Belohrad 2008" conference in Lazne Belohrad in Czech. This is one of the biggest and most important independent developer conferences in Czech and traditionally attracts lots of Delphi developers. It was great fun demonstrating native Delphi VCL for the Web development with AJAX support, extending Blackfish SQL for Windows with Delphi for .NET stored procedures and building RESTful .NET 3.5 web services with Delphi for .NET.
The conference was held in Lazne Belohrad, which is a very beautiful, small spa in Czech mountains. In the past it was called "Delphi conference" and this was the 10th anniversary of this great event. I’m looking forward to the next year:-)
Share This | Email this page to a friend
Posted by Pawel Glowacki on April 10th, 2008 under Uncategorized | Comment now »Building .NET 3.5 WCF RESTful web services with Delphi 2007
What is "REST" anyway?
"REST" does not have anything to do with relaxing. It is rather a hot term used in the context of Service Oriented Architecture (SOA). The term "Representational State Transfer" was coined by Thomas Fielding in 2000, in his PhD dissertation "Architectural Styles and the Design of Network-based Software Architecture". In essence it is all about making services available through HTTP protocol easier. With traditional web services HTTP is used as transport for exchanging SOAP messages. REST supporters make a point that HTTP protocol is rich enough on its own, and it is possible to use it directly for exchanging arbitrary messages, not necessarily SOAP, and not necessarily XML.
In the early days of web services the HTTP protocol was the only mean for exchanging XML-encoded SOAP messages. Windows Communication Foundation (WCF) architecture introduced in .NET 3.0 decouples SOAP messaging from the underlying transport and introduces other then HTTP transports for exchanging SOAP messages. For example there is "NetTcpBinding" that uses TCP as transport protocol. With RESTful web services the underlying protocol is HTTP, however messages are not encoded as SOAP envelopes, and does not even need to be encoded in XML. It is more and more common to encode them in simpler JSON format instead, or even plain text. RESTful web services can be used to retrieve arbitrary MIME-types, not necessarily text, for example images.
Aaron Lerch in his "Creating RESTful Web Services with WCF 3.5" article points out that "Representational State Transfer" is a phrase that describes the generic principles that make up much of what we know to be the HTTP protocol. As it applies to web services, the primary concepts of interest are resources, and the actions that can be taken on a given resource. Resources are identified by Uniform Resource Identifiers (URIs), something that nearly everybody is familiar with. SOAP-based web services typically use a single URI to represent the service endpoint plus an operation. A RESTful web service uses a unique URI to reference every resource, and HTTP verbs to define actions on those resources. REST-based services are making heavy use of different HTTP verbs (GET, POST, PUT, DELETE), HTTP result status codes, and encoding request details inside the URI.
The .NET 3.5 Framework introduces support for this low-level "web programming" through new types defined in the "System.ServiceModel.Web" namespace. Specifically there is a new WCF binding for web programming called "WebHttpBinding", corresponding "WebHttpBehavior", new attributes for specifying HTTP GET or POST methods - "WebGet" and "WebInvoke", and also new "UriTemplate" custom attribute for mapping URIs to methods and their parameters.
Building basic Delphi 2007 WCF REST service
Let’s build a simple Delphi 2007 WCF REST service application. The structure of Delphi 2007 WCF 3.5 web application is very similar to the Delphi 2007 WCF 3.0 applications described in the "Introduction to WCF Programming in Delphi" CodeGear Developer Network article. To successfully build the service application make sure to have .NET 3.5 installed and CodeGear RAD Studio 2007 "December Update" installed.
The first step is to create a new "Console Application - Delphi for .NET" and save it for example as "DelphiRESTBasicSample_Service" project.
The second thing to do is to add appropriate project references. Right click on the "References" node in the "Project Manager" and select "Add Reference…". Click the browse button and add the following reference assemblies to the project:
- C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.ServiceModel.dll
- C:\WINDOWS\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\System.Runtime.Serialization.dll
- C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.ServiceModel.Web.dll
The side effect of adding these references to the project is adding directories where these assemblies reside to the project’s search paths.
Now it is time to add two empty units to the project. One for the service interface and one for the implementation. I’m going to start from implementing a simple "calculator" service. This time using new WCF attributes introduced in the .NET 3.5.
unit uServiceIntf;
interface
uses
System.ServiceModel,
System.ServiceModel.Web;
type
[ServiceContract]
IService = interface
[OperationContract]
[WebGet(UriTemplate='Add?a={x}&b={y}')]
function Add(x, y: integer): integer;
[OperationContract]
[WebGet(UriTemplate='Sub?a={x}&b={y}', ResponseFormat=WebMessageFormat.Json)]
function Subtract(x, y: integer): integer;
end;
implementation
end.
Note the usage of the new "WebGet" attribute. To invoke both methods declared in the "IService" interface HTTP GET method must be used. The "UriTemplate" is used to specify how the web method is going to be invoked. The "UriTemplate" class supports the matching or binding of a string template with name-value pairs. When defining an OperationContract, a UriTemplate is specified and it accomplishes two purposes. First, it provides the mapping between a request URI and an OperationContract, and second, it identifies the named values that are subsequently bound to matching OperationContract method parameters. By default responses are encoded in XML. The second "WebGet" attribute contains "ResponseFormat=WebMessageFormat.Json" to instructs the WCF runtime to encode response as JSON, instead of XML.
The implementation of the service is trivial:
unit uServiceImpl;
interface
uses
uServiceIntf;
type
TService = class(TObject, IService)
public
function Add(x, y: integer): integer;
function Subtract(x, y: integer): integer;
end;
implementation
{ TService }
function TService.Add(x, y: integer): integer;
begin
Result := x + y;
end;
function TService.Subtract(x, y: integer): integer;
begin
Result := x - y;
end;
end.
The last step is to add code to the project’s source code. To display project source in the editor select "View Source" option from "Project" menu. Here is the full source code of the project.
program DelphiRESTBasicSample_Service;
{$APPTYPE CONSOLE}
uses
SysUtils,
System.ServiceModel.Web,
System.ServiceModel,
uServiceIntf in 'uServiceIntf.pas',
uServiceImpl in 'uServiceImpl.pas';
var
aBaseAddress: string;
URIs: array of Uri;
host: WebServiceHost;
begin
try
aBaseAddress := 'http://localhost:8000/';
SetLength(URIs, 1);
URIs[0] := Uri.Create(aBaseAddress);
host := WebServiceHost.Create(typeof(TService), URIs);
host.Open;
writeln('Service is running and listening at ' + aBaseAddress);
writeln('Press any key to quit...');
readln;
host.Close;
except
on e: Exception do
begin
host.Abort;
writeln(e.Classname, ': ', e.Message);
readln;
end;
end;
end.
Note the new "WebServiceHost" class for hosting our RESTful service web service. The service is complete. After running it from inside the IDE you should see the following window. Press any key to stop the service application. Here we are hosting the WCF service in the console application, but it is also possible to host it inside the IIS.
To test the service application we can just start a web browser and type in the following URL:
http://localhost:8000/Add?a=2&b=3
Right-clicking on the browser window and selecting "View Page Source" reveals that the following string was returned from the "Add" method.
In order to consume RESTful web service an arbitrary HTTP client is required. Luckily Delphi 2007 comes with a number of Indy 10 components for low-level network programming. The "TIdHTTP" component implements an HTTP client and can be used to interact with our RESTful web application. In the CodeGear RAD Studio 2007 installation there is a demo Delphi for Win32 project that uses "TIdHTTP" component that can be used directly as a test client for our service application. In the default installation it can be found in the following location:
C:\Documents and Settings\All Users\Documents\RAD Studio\5.0\Demos\Indy10\HTTPVCLForm\IdHttpDemoVCL.dproj
Now we can test both methods: "Add" and "Sub". I have compiled the "IdHttpDemoVCL" project and started it from outside the IDE. Because I keep changing the service application, it is more easy to run the service from within the IDE.
Summary
The .NET 3.5 introduced support for building RESTful web services that do not use SOAP for encoding messages. This simplifies building SOA applications and clients. In this article I have demonstrated building basic .NET 3.5 RESTful web services with Delphi 2007 for .NET and consuming them with TIdHTTP component from Delphi 2007 for Win32 VCL Forms application.
References
- CodeGear RAD Studio 2007
- "Introduction to WCF Programming in Delphi" by Pawel Glowacki, CodeGear Developer Network article
- Wikipedia: Windows Communication Foundation
- "WCF Syndication: HTTP Programming with WCF and the .NET Framework 3.5" by Justin Smith, MSDN Magazine, January 2008
- "Creating RESTful Web Services with WCF 3.5" by Aaron Lerch, www.developer.com
- "Architectural Styles and the Design of Network-based Software Architecture" by Roy Thomas Fielding, Doctor of Philosophy Dissertation, University of California, Irvine, 2000
- JSON Homepage
- The Indy Project
Share This | Email this page to a friend
Posted by Pawel Glowacki on April 4th, 2008 under Uncategorized | 4 Comments »Register Now for Free Delphi SOA and Web Services Webinars, April 2008
Check out the new layout of the EMEA CodeGear Event Calendar at www.codegear-events.eu. It is now easier to find things. There are two new main columns. One for future events and one for watching playbacks. Looks great to me.
I’m going to present the following 60 minutes Delphi webinars around Service Oriented Architecture and Web Services theme in April and I do invite you to register. It is going to be fun:-) See you online on Tuesdays at 11am and 3pm in April (CET, GMT +1).
Title: Understanding XML
Date: Tuesday, April 1st, 2008
Time: 11:00 CET
Length: 60 minutes
URL: http://borland.interwise.com/borland/iClass/KD5785/default.asp
In this webinar attendees will be introduced to basics of eXtensible Markup Language (XML). The following topics will be discussed:
- XML as a better HTML
- XML document structure
- Rules of well-formedness
- XML Namespaces
- Validating XML with DTD and XML Schema
- XSLT and XPath
- XML Parser Types
The "Understanding XML" session is designed as a programming language neutral introduction to XML and starting point for using XML in a programming language of your choice.
Title: Delphi XML Programming
Date: Tuesday, April 1st, 2008
Time: 15:00 CET
Length: 60 minutes
URL: http://borland.interwise.com/borland/iClass/CA9054/default.asp
This webinar builds on “Understanding XML” session and covers Delphi XML programming using:
- TXMLDocument component
- Data Binding Wizard
- XML Mapper
Title: Understanding Web Services and SOA
Date: Tuesday, April 15th, 2008
Time: 11:00 CET
Length: 60 minutes
URL: http://borland.interwise.com/borland/iClass/VN3690/default.asp
Service Oriented Architecture (SOA) gains a lot of attention as a modern approach for building scalable and maintainable software systems. This session covers the following topics:
- Benefits of Service Oriented Architecture (SOA)
- Understanding Web Services Description Language (WSDL)
This session is designed as a programming language-neutral introduction to SOA and Web Services and starting point for building service-oriented application in programming language of your choice.
Title: Delphi for Win32 Web Services Programming
Date: Tuesday, April 15th, 2008
Time: 15:00 CET
Length: 60 minutes
URL: http://borland.interwise.com/borland/iClass/GR4596/default.asp
This webinar builds on the contents “Understanding Web Services and SOA” session and discusses Web Service development with Delphi for Win32. The following topics will be presented:
- Consuming Web Services in Delphi for Win32 with "Web Service Importer"
- Building Delphi for Win32 Web Services with "SOAP Server Wizard"
Title: Delphi for .NET Web Services Programming
Date: Tuesday, April 22nd, 2008
Time: 11:00 CET
Length: 60 minutes
URL: http://borland.interwise.com/borland/iClass/AO6376/default.asp
This webinar builds on the contents “Understanding Web Services and SOA” session and discusses Web Service development with Delphi for .NET. The following topics will be presented:
- Consuming Web Services in Delphi for .NET with "Add Web Reference" wizard
- Building Delphi ASP.NET Web Service Applications
Title: Delphi Interoperable WCF Programming
Date: Tuesday, April 22nd, 2008
Time: 15:00 CET
Length: 60 minutes
URL: http://borland.interwise.com/borland/iClass/TT3731/default.asp
This webinar builds on the contents “Understanding Web Services and SOA” session and discusses SOA development with Delphi using Windows Communication Foundation. The following topics will be presented:
- WCF Basics: understanding service descriptions, bindings, endpoints and channels
- Building interoperable WCF Service applications with Delphi for .NET 3.5
- Consuming WCF services in Delphi for .NET and Delphi for Win32
Share This | Email this page to a friend
Posted by Pawel Glowacki on March 12th, 2008 under Uncategorized | 3 Comments »codegearbuntu in distro heaven
"Distro heaven" is the main theme of the March 2008 Linux Format issue. Ubuntu is currently probably the most popular Linux distribution and also basis of myriads of derivatives, like Kubuntu, Edubuntu, Linux Mint, Ubuntu Studio, Mythbuntu, Fluxbuntu and thousands of others.
This made me thinking if it would make sense to create "CodeGearBuntu"? What should go into Linux CodeGear distro? Maybe there should be more "codegearbuntus" like "CodeGearBuntu3rdRailDesktop" with Rails 2.0, "CodeGearBuntuJBuilderTeamInsight" with subversion, xplanner, bugzilla and continuum, and "CodeGearBuntuHardcoreDeveloper" with a trendy CodeGear wallpaper preinstalled?
Share This | Email this page to a friend
Posted by Pawel Glowacki on March 7th, 2008 under Uncategorized | 21 Comments »What about watching a Delphi webinar today?
Depending on your timezone it may or may not be "today" for you, but in coming hours I’m doing a couple of live Delphi webinars, and please feel invited to join:-) You only need to install free InterWise client and just few minutes before the event click on one of the URLs below to watch and ask questions. The first webinar is on 10am in Lisbon and Dublin, 11am in Amsterdam, Warsaw and Zagreb, and on 12am in Ankara and Kyiv.
Morning…
Tuesday, March 4th, 11.00 CET (GMT +1), "What’s New in RAD Studio 2007 for Delphi Developers?"
Native Delphi AJAX web application with new VCL for the Web framework, parameterized types (generics) in Delphi compiler, new DBX4 database driver architecture, Visual Query Builder, ASP.NET 2.0, live templates for HTML tags inside integrated HTML Editor, adding projecs to "New Items" dialog through Template Libraries - new Delphi Repository mechanism.
Afternoon…
Tuesday, March 4th, 15.00 CET, "DBX4 for BDE Developers"
New Delphi DBX4 Database Driver Architecture, Data Explorer VCL Form Designer integration, unidirectional datasets and provider architecture, moving from BDE to DBX data-access components, programmatically reading BDE and DBX metadata, creating tables with DBX metadata classes and migrating data from BDE to DBX in code.
Any time…
http://www.codegear-events.eu/
Share This | Email this page to a friend
Posted by Pawel Glowacki on March 3rd, 2008 under Uncategorized | Comment now »Creating database tables programmatically with Delphi DBX4 metadata classes
Inspired by Steve Shaughnessy’s post on "The New dbExpress 4.0 MetaData" I’ve decided to give this approach a try and created a sample Delphi 2007 for .NET VCL Forms application that I’m using during current serie of CodeGear seminars to demonstrate the incredible amount of innovation in DBX4 architecture. Many Delphi programmers asked me to blog about it, so here we are:-)
With the new DBX4 metadata classes it is possible to programmatically create database tables and indices in code against any database connection configured in the CodeGear RAD Studio 2007 Data Explorer.
One possible approach, as demonstrated by Dr. Bob during 2007 December SDE conference on "Migratie: van BDE naar BlackfishSQL via dbExpress" session, is to programmatically construct a SQL statement with appropriate "CREATE TABLE …" SQL code and pass it to "TSQLConnection.ExecuteDirect" method for immediate execution. One problem with this approach is the fact that there are subtle differences in SQL syntax accross different database products, so it is very difficult to create one SQL "create table" string good for all databases.
With Delphi DBX4 Metadata classes it is possible to create database tables and indices on the higher level of abstraction. You can now do it in Pascal code instead of low-level SQL statements.
Steps:
1. Start CodeGear RAD Studio 2007
2. In Data Explorer add a connection to a database where you want to programmatically create a new database table. I’m using sample CodeGear InterBase 2007 "Employee.gdb" database located in default installation under: "C:\Program Files\Common Files\CodeGear Shared\Data". Make sure that the name of the database in Data Explorer is "EMPLOYEE".
3. In the "New Items" dialog select "VCL Forms Application - Delphi for .NET". Save All.
4. Select "Add Reference" from "Project" menu. In the "Add Reference" dialog select "Borland.Data.DbxCommonDriver.dll", "Borland.Data.DbxReadOnlyMetaData.dll" and "Borland.Data.AdoDbxClient" assemblies. Click "Add Reference" button, and then OK.
5. Add an empty Delphi unit to project and save it as "dbxutils".
6. Replace new unit’s empty body with the following code and save.
unit dbxutils;
interface
uses
System.Data.Common,
Borland.Data.DBXMetaDataProvider,
Borland.Data.AdoMetaDataProvider,
// database specific metadata writers
Borland.Data.DBXInterbaseMetaData,
Borland.Data.DBXDataStoreMetaData;
type
TDBXUtils = class
public
class function GetAdoConnection(aConnectionName: string): DBConnection;
class function GetAdoMetaDataProvider(aConnection: DBConnection): TAdoMetaDataProvider;
class function GetMetaDataProvider(aConnectionName: string): TDBXMetaDataProvider;
end;
implementation
{ TDBXUtils }
class function TDBXUtils.GetAdoConnection(
aConnectionName: string): DBConnection;
var
Factory: System.Data.Common.DbProviderFactory;
Connection: System.Data.Common.DbConnection;
begin
Factory := System.Data.Common.DbProviderFactories.GetFactory(
'Borland.Data.AdoDbxClient');
Connection := Factory.CreateConnection();
Connection.ConnectionString := 'ConnectionName=' + aConnectionName;
Connection.Open;
Result := Connection;
end;
class function TDBXUtils.GetAdoMetaDataProvider(
aConnection: DBConnection): TAdoMetaDataProvider;
begin
if aConnection = nil then
raise Exception.Create('Connection is nil');
Result := TAdoMetadataProvider.Create;
Result.Connection := aConnection;
Result.Open;
end;
class function TDBXUtils.GetMetaDataProvider(
aConnectionName: string): TDBXMetaDataProvider;
begin
Result := GetAdoMetaDataProvider(GetAdoConnection(aConnectionName));
end;
end.
7. Add two "TEdit" and one "TButton" components to the main form of your application. In the Object Inspector change "Name" property of TEdit components to respectively "EditConnectionName" and "EditNewTableName".
8. Add "dbxutils" and "Borland.Data.DBXMetaDataProvider" to the form’s unit "uses" clause.
9. Add the following code in the button’s "OnClick" event:
procedure TFormMain.Button1Click(Sender: TObject);
var
AMetaDataTable: TDBXMetaDataTable;
AMetaDataProvider: TDBXMetaDataProvider;
begin
AMetaDataTable := TDBXMetaDataTable.Create;
AMetaDataTable.TableName := EditNewTableName.Text;
AMetaDataTable.AddColumn(TDBXInt32Column.Create('C1'));
AMetaDataTable.AddColumn(TDBXDecimalColumn.Create('C2', 10, 2));
AMetaDataTable.AddColumn(TDBXUnicodeCharColumn.Create('C3', 32));
AMetaDataProvider := TDBXUtils.GetMetaDataProvider(EditConnectionName.Text);
AMetaDataProvider.CreateTable(AMetaDataTable);
end;
10. Run the application, and click on the button to execute database table creation code. Close the application.
11. In the Data Explorer right-click on "EMPLOYEE" database node and select "Refresh". When you expand "Tables" node you should see newly created database table. If you right-click on the new table and select "Alter Table" you should see the metadata information about the new table.
CONGRATULATIONS! You have just created the first database table in code with the new RAD Studio 2007 DBX4 Metadata classes. The complete project source code is available for download from CodeGear Developer Network CodeCentral.
One of the nicest things about Delphi since its first release is availability of Delphi VCL source code. DBX4 is not different and it comes with the source code. DBX4 is written in very elegant pure Delphi code, with very useful embedded XMLDocumentation Comments, and most interestingly it is single sourced, which means that the same Delphi source was compiled with either the native dcc32 or managed dccil compilers.In order to be able to step into the VCL DBX4 source code from within our project we need to add "C:\Program Files\CodeGear\RAD Studio\5.0\source\database\src\pas\dbx\metadata" directory to search path of the project in "Project Options".
If you now press "Ctrl" button and move mouse over "DBXMetaDataProvider" in "uses" clause
you will be able to step into the VCL DBX source code where types used in "dbxutils" unit are defined.
The "DBXMetaDataProvider" unit defines a number of interesting classes
- TDBXMetaDataProvider
- TDBXMetaDataTable
- TDBXMetaDataColumn
- TDBXMetaDataIndex
- TDBXMetaDataForeignKey
that can be used to programmatically created tables with indices and foreign keys in code. There is also a number of different convenience classes derived from "TDBXMetaDataColumn" that makes it easy to define columns of certain type. They contain a constructor only, so in reality you will be probably using properties of the base class to define different aspects of the database table column, like for example "AutoIncrement" or "Nullable".
- TDBXInt8Column
- TDBXInt64Column
- TDBXInt32Column
- TDBXInt16Column
- TDBXDoubleColumn
- TDBXDecimalColumn
- TDBXDateColumn
- TDBXBooleanColumn
- TDBXBinaryLongColumn
- TDBXBinaryColumn
- TDBXAnsiVarCharColumn
- TDBXAnsiLongColumn
- TDBXAnsiCharColumn
- TDBXObjectColumn
- TDBXSingleColumn
- TDBXTimeColumn
- TDBXTimestampColumn
- TDBXUInt16Column
- TDBXUInt32Column
- TDBXUInt64Column
- TDBXUInt8Column
- TDBXUnicodeCharColumn
- TDBXUnicodeLongColumn
- TDBXVarBinaryColumn
- TDBXWideVarCharColumn
Summary
In this example I’ve been using Delphi 2007 for .NET, but since RAD Studio 2007 December Update it is also possibly to write a similar application in Delphi 2007 for Win32.
The complete project source code is available for download from CodeGear Developer Network CodeCentral.
Share This | Email this page to a friend
Posted by Pawel Glowacki on February 28th, 2008 under Uncategorized | 3 Comments »Delphi Webinars Today and Next Tuesday
As promised during the two webinars that I gave today here are the links to download presentations. I’m really happy to attract so many Delphi developers online:-) There were 69 programmers in the morning, and 92 in the afternoon!
"What’s New in CodeGear RAD Studio 2007 for Delphi Programmers?"
- CodeGear RAD Studio 2007 Overview
- New Language Features
- DBX4 Architecture
- Blackfish SQL Database Engine
- ASP.NET 2.0
"Agile Techniques for Building Quality into Delphi Applications"
- Introduction to Agile Programming
- Unit Testing and Refactoring
- Modelling and Design Patterns
- Audits and Metrics
The list of all CodeGear webinars planned for coming weeks is avaiable on the CodeGear European Event Calendar page. See You on "Effective DBX4 Database Programming" and "Advanced DBX4 Database Architecture" webinars next Tuesday same time (11am and 3pm CET).
Share This | Email this page to a friend
Posted by Pawel Glowacki on February 5th, 2008 under Uncategorized | 5 Comments »Server Response from: dnrh1.codegear.com


RSS Feed