Wednesday, March 08, 2006

BDP, be carefull out there!

When you need database connection in a ASP.NET website you will use, of course, Borland DataProvider, because it gives you a database independent connection.
Use of the BDP components is very straight forwarded, and very much alike the 'standard' ADO.NET components.

However some things of BDP are a bit different, in the detail sence of the word, that it can make you pull your hair from your head sometimes. BDP also covers a lot that is not in ADO.NET so there is plenty to learn also.

Today such an event occured to me (again). A database-driven website that I'm building uses an Microsoft Access database to hold the content(Yes I know, not the best choice) . I use BDP to get the content from the database and on a local machine a Delphi Win32 app is used to maintain the content. So if the content changes the database must be uploaded to the website.
I noticed during developing that the Access .lck file (LockFile) stayed open, and that of course could be a connection which was not closed properly.
But I learned from the Delphi 8 times to close everything you use to get data from the database.
My way of doing this is somewhat like this:


MyConnection := BdpConnection.Create;
MyCommand := BdpCommand.Create(AQuery);
MyCommand.Connection := MyConnection;
try
MyConnection.Open;
MyDataReader := MyCommand.ExecuteDataReader;
while MyDataReader.Read do begin
Response.Write(MyDataReader.Item[0].ToString);
end;
finally
MyDataReader.Close;
MyCommand.Close;
MyConnection.Close;
end;

So believe me I don't leave database connections open lately. Anyway the lock file did not give trouble during the developement.
But now that the website has gone live my Win32 app is not able to upload a changed database because it is used by another process. And that of course is the ASP Worker process, which I can not kill at the ISP's webserver. (Oh Oh)

So after checking all my connections to close(as I told you before I do close them) I found out that it had to do with the Connection Pooling. Of course, that is default set to true and it keeps the connection 'open'. So I turned of the Connection Pooling and everything went fine even the .lck file disappeared immediately after the first refresh.
Now I only need to find a way to free the connection just-before uploading the database. I think that can easily be done following this tutorial at BDN.

So here is my small(and growing?) list of BDP tips:
  1. When using Memo fields don't forget that BDP returns by default 1024 characters as set in the property BlobSize of the connection. So if you have more you won't see it until you increase the blobsize.
  2. Don't get yourself fooled by the Connection Pooling! Connection pooling makes it look like you did not close your connection properly.
  3. Close all that can be closed and you will be fine.

More info on BDP can be found in this BDN article Borland Data Provider 2.5 features.

Bottom line Borland DataProvider rocks, but be carefull out there...

Monday, March 06, 2006

More on "DevCo"

Allan Bauer has some intresting blogposts in his xx Days After spinn off announcement series:

These post have a 'fly on the wall approach' giving some insites in what is going in the Borland meeting rooms. Although it keeps us from real facts it is good to see how everything is going down there.
So far, as far as a fly can tell, it still looks very good for the future of Delphi.

David I offers some additional perspectives on the spinn-off.

After reading all this stuff I (still) feel pretty confident that Delphi will come out as a stronger product than ever before.

Wednesday, March 01, 2006

BDS2006 evaluate and a four wheel drive

I am using BDS2006 for two months now. Time to evaluate.
I use BDS2006 Enterprise, mostly for Win32 developement and ASP.NET Development. (Delphi .NET and some C#)

BDS2006 in a nutshell:

  1. BDS2006 is awesome
  2. BDS2006 has some minor bugs or quirks (no showstoppers here!)
  3. Delphi 7 and Delphi 8 made it on the 'Uninstall list'
  4. The future of BDS2006 is...or get myself a fourwheel drive.

1. BDS2006 is awesome
In fact after two months using it, I can not think of going back to Delphi 7. The new editor features are really accelarating my production.

To name a few IDE highlights:

  • Live Templates; Great productivity accelarator!
  • Refactoring; Even more productive. (Still have not used all the refactorings)
  • Together integration; The two way source/UML diagramming gives good insight of my code. Automatic generating documentation is sweet.
  • The IDE is fast (PIV 2,4 GHz 512 Mb); Start uptime is OK! Working is OK!
  • The IDE is stable. (Must confess I manage to crash it sometimes, although a lot fewer then Delphi 7).
  • ASP.NET designer is perfect (Awesome with a capital A compared with the Delphi 8 version that I used. No more HTML disappearing.)
  • ECO, although I am still exploring the thing, it seems to be the way to build .NET applications in the future. (No more plumbing around with ADO.NET, can you imagine that?) Now if I only had the time to explore it even more. There should be a book for this...
  • Having Win32 and .NET application in one project group is cool and even better extremely usefull, no more switching between applications.

2. BDS2006 has some minor bugs and quirks
Before this post is looking like an advertisement for the new DevCo, let's look at some minor bugs, quirks and strange behaviors that I encountered. But beware nothing here is a showstopper.
IMO It is quite natural that a product as complex as BDS2006 has some quirks.

Disclaimer:
If I say bug I mean that I think it is a bug, so it could be my mistake after all. Still investigating some 'bugs' to put them in QA.
If I say annoying, I mean that it is annoying to me, so not necesserally to you also

  • Annoying: The projectmanager does not open your dfm file if you don't open the pas file first.
  • Annoying: The help is minimal. The help really needs attention.
  • Bug: Sometimes I manage to crash the thing. (When I say 'sometimes' I mean once/twice a day, but not every day) mostly when debugging. (Hard to locate although)
  • Annoying: It is hard to stop coding.
  • Annoying: Can not get the ASP.NET deployment option to work. Grrrr must be me I guess.
  • Annoying/bug: After a day working in a ASP.NET application the amount of memory has grown. (After killing the ASP.NET worker process it comes down)

These are the things that annoy's me the most. OK sometimes there is another this and another that but in general BDS2006 rocks.

3. Delphi 7 and Delphi 8 made it on the 'Uninstall list'
No need to keep Delphi 7 and 8 for downgrade anymore. Put them on the 'Uninstall list' period!

4. The future of BDS2006 is...
And then there was the announcement that Borland is spinning of the IDE business.
First thoughts after the shock:

  • WTF are they doing now????
  • There we go again...
  • Men I just bought me a Enterprise Edition for the first time in my life....

Now after a couple of weeks I think spinning of the IDE business is the best thing to happen to Delphi in ~11 years.

What if the deal succeeds with Borland's intention to get a buyer in the best intrest of Delphi?
If that happens Delphi's future will be brighter than ever before!

What if the deal fails and someone kills Delphi?
I could use Delphi for many years to come, or change to another tool (although I can not think of another one right now, but someone will jump in the gap)
Or I just good start my gardening company with a big, I mean really big 4-wheel drive!

But for now go Delphi!



Wednesday, February 22, 2006

Posting data with TWebbrower

With a TWebbrowser component it is possible to post data to a webpage. Suppose you have an application with a webbrowser and your application requires a login, and the website also uses a login. The user should now login twice. And that is just to much!

You can however post data to the website with the Navigate method of the webbrowser component.
The declaration of the method is as follows:

procedure Navigate(const URL: WideString; var Flags: OleVariant;
var TargetFrameName: OleVariant;
var PostData: OleVariant); overload;

The last parameter PostData can be used to transfer the login information to the webpage, as if the user pressed the login button of the login form.

procedure LoginWithPostData(AUserName:String;
APassWord:String; LoginUrl:String; AWebBrowser:TWebBrowser);
var
varPostData, varHeader : OleVariant ;
x : variant;
postdata : string;
arPostdata : array of byte;
i,l: integer;
bch : byte;

begin
postdata := 'UserCode='+AUserName+'&PassWord='+APassWord;
SetLength(arPostdata, Length(PostData));
for i := 1 to Length(postdata) do begin
arPostdata[i-1] := Ord(postdata[i]);
end;
varPostData := arPostdata;
varHeader :=
'Content-Type: application/x-www-form-urlencoded\r\n';
AWebBrowser.Navigate(LoginUrl,EmptyParam,EmptyParam,
varPostdata, varHeader);
end;


Step 1: Create a string with the postdata
Step 2: Fill an array of byte with the string characters.
Step 3: Assign the array to an OleVariant.
Step 4: Set the appropriate encoding to a OleVariant (varHeader)
Step 5: Navigate the browser.

You should be logged in now!

You could of course also do it the other way around, log in the webbrowser and read the postdata from the BeforeNavigate event. (Just posted by your user and on its way to the webserver)
The disadvantage with this method is that you should parse the postdata string to get the username and you should somehow find out if the user was autorised by the webpage. One way to achieve it is to check the url in the NavigateComplete event of the browser to be the protected url (Page). If the protected page is loaded the user should be logged in and you can then login your application.
The first method, posting the data to the webserver from your application is however the best one.

Friday, February 17, 2006

Wednesday, February 08, 2006

Borland Announces Plan to Divest IDE Product Lines

Read the press release here.

In summary I read it like this:
Borland is seeking a buyer to create a separate company where all the IDE stuff related products will be placed. (Delphi, C#, C++ etc) This company will stay strong related to Borland who will focus on ALM and SDO.

David I has posted an open letter to the non-technical newsgroup, read it here.
There is also a blogpost here.

As far as I can see this could be a good thing for Delphi (BDS2006) although it is also quite shocking to begin with.
I only think that the name Borland should be for the IDE company, let the ALM company come up with a new name. Borland and Development Tools is said in one breath.

Tuesday, February 07, 2006

BDS2006, BDP and memo fields

Lately I encountered some strange problems using the Borland Data Provider (BDP) in a ASP.NET project. At first I thought I had solved it, but eventually (mostly because of project scope changes) it made me change from BDP to OleDB.

The project is a database-driven website for which I use BDP to connect to the database.

Why Borland DataProvider?

Borland DataProvider has some benefits compared to the standard .NET providers (SQL/OleDB):

  • BDP is database independent (Same components for SQL and local databases)
  • Connection pooling
  • Easy data remoting components

The database is used to provide the content of the website. At first I used a SQL Server database and found out that having two text fields (memo fields) in the SELECT clause causes the text fields to be truncated to 1024 chars. This is inconvient!
[update: Problem solved, see below]

Having only one text field in the SELECT works just fine! That is strange, isn't it? [No]

In SQL Server however I could of course change one of the Text fields to a varchar with a (max) length of 4000. Not the most elegant way, I know, but it is a rather small database only holding the website content. Problem solved.
Now, for other reasons, my customer wants to use an Access database instead. No problem! As said BDP components are database vendor independent!
Except, of course, that varchar fields in Access are limited to 255 chars, so I ended up with two truncated memo fields. :-(

The only solution left was to change from BDP to OleDB. This switch was easy because the BDP components are similar to the standard .NET providers.
My project now contains two database technologies, BDP and OleDB. All works fine but I can not call it elegant. (I keep the BDP, because there might be a switch back to SQL Server in the future.)

I only can imagine that this is a bug in the Borland Data Provider so I added a report to quality central. You can find it under QC number #24314

Update 8-2-2006:
Well I imagined it wrong. It seemed to be a property of the BdpConnection called BlobSize, which is default set to 1024! Well QC report withdrawn!
Wow this one was really hard to find! :-)

Wednesday, February 01, 2006

Old papers, still up-to-date

In the 'old' days I have made a few tutorials about Delphi(4/5) for The Software Developer Pages. These tutorials and papers are still available behind my company's website. They are available in english and dutch, and not updated for ages, but some papers are still up-to-date today. The most papers are at beginner-level because, guess what, I was those days a beginner.
There is even Delphi 5 code available for download which should be working easily in BDS2006.

The main page can be found here. (Note I do not update this anymore, so it looks a bit odd now)
Some still up-to-date papers are:

I keep a permanent link to this papers on this blog.

Friday, January 27, 2006

BDS2006 small features, great impact

It is always amazing how small things can have such a great impact on your daily work. The new features in the BDS2006 editor like live templates are obviouos because you can see it immediately while working in the editor. 'Small' improvements and features are discovered along the path.

Lately I noticed a tiny red bug (in dutch we call it a lieveheersbeestje) on a tab in the editor after debugging an application.

It seems that BDS2006 opens units, necessary for debugging, on the fly and implicit closes them when the debug session ends. (This is an editor option) If you stop debugging in such a unit Delphi keeps that unit open. Ain't that great?

I remember debugging a C# project in Visual Studio 2003 where I ended up with an endless list of tabs which is very annoying in my opinion. In VS you have the tabs for design and code besides each other on top of the editor. BDS2006 (and previous versions) have an extra tab at the bottom of the editor for switching between design and code. So in BDS2006 you always have the half amount of tabs in the top tab control compared with VS2003.

So these small features in BDS2006 are great! It gets even better if you popup the context menu on the tab. If you don't want BDS2006 to close the debugged units implicit(an editor option) you can close them by yourself using 'Close all pages opened while debugging' option. Hack you can even close all pages except the one that is active.

Small things, great stuff!

Tuesday, January 17, 2006

ECO Adventures: Inheritance

Inheritance is one of the five pilars of Object Oriented Programming. In ECO inheritance is, I can tell you now, a piece of cake.
Consider this 'real world' model:


Developer and SalesMan inherit the behavior from Person. Developer and SalesMan are specializations of Person. Implementing this model in a VCL Win32 application using TDataSet would consider a lot of work. For instance the, in fact one-on-one relation must be maintained in the database. A person is either a Developer or a SalesMan, a person can not be both. (if you don't agree you should read this blogpost :-) )
Anyway implementing this becomes, even in Delphi with TDataSet, more complex. In ECO it is a very straight forward process.

Create the windows (ECO) application
Drop three datagrids(dgPerson, dgDeveloper, dgSalesMan) on the form and three ExpressionHandles (ehPerson, ehDeveloper, ehSalesMan) And oh, don't forget to compile first!

Setting the ExpressionHandles
ehPerson:
Name->'ehPerson'
Roothandle->rhRoot (Don't forget to set the Roothandles EcoSpaceType property!)
Expression->Person.AllInstances (Use the OCL Editor here)

ehDeveloper:
Name->'ehDeveloper'
Roothandle->rhRoot
Expression->Developer.AllInstances

ehSalesMan:
Name->'ehSalesMan'
Roothandle->rhRoot
Expression->SalesMan.AllInstances

Setting the datagrids
dgPerson:
DataSource->ehPerson

dgDeveloper:
DataSource->ehDeveloper

dgSalesMan:
DataSource->ehSalesMan

To make things complete drop two buttons for the Developer and SalesMan grid. Connect the roothandle property to ehDeveloper and ehSalesMan and set the for both buttons the property ECOListAction to Add.

Well this is pretty much it! You can see that the grids have all the appropiate attributes for their classes. By running the application we can test it:

Notice that adding a developer or salesman automatic means adding a person. So again the model does all the hard work in the background.
While still scratching the surface of ECO it becomes clear that ECO is very powerfull framework, taking a lot of the work load. Making this little application with TDataSets would be harder (although it can be done). For instance after inserting the Developer you would have to code to get a person in the person table.

Guess what: We did not code at all!

Monday, January 16, 2006

Refactor all the way

After using BDS 2006 for three weeks now I must say it is a real piece of art. I can not think of one reason to go back to Delphi 7. For me the most valuable new features are the improved and extended refactorings. It takes some time to get used, using them, old habbits just don't disappear that easy :-) I guess.

What I always found a bit annoying in Delphi coding was the fact that changing the parameters of an existing method, meant a lot code cruising. OK, you can't have it all but figure this:

In Delphi 7, to change a parameter of a method you should do something similar like this:

1. Change the parameter in the implementation section (iow the method)
2. Surf (Ctrl-Click) to the interface section to change the decleration
3. Ctrl + Arrow Down to go back to the implementation

Delphi 2006, and in specific Together, dramatically improved things. With refactoring you can now change the parameterlist of a method, and Together will take care of changing the declaration (or vica versa)!

The 'Change Parameters' refactor dialog:


With this dialog you can add or alter parameters in a very easy way. Other 'My favourite' refactorings are:

  • Extract method (Existed already in D2005)
  • Find unit (Helps you finding the unit for the uses clause)
  • Declare variable

The new and improved refactorings in BDS 2006 boost productivity, no doubt about that. This and the other editor improvements, like Live templates, made upgrading to BDS2006 worthwhile.

Monday, January 09, 2006

Fooling around with TWebbrowser

For a project I needed to edit a HTML page within a Delphi Win32 application. Delphi has a TWebbrowser component which appeared to be suitable for this situation.
TWebbrowser in fact is a wrapper over Microsoft's Shell Doc Object and Control library (SHDOCVW.DLL) and it brings webbrowser functionality to your application. With a TWebbrowser it is easy to navigate the web and files. There are a lot resources to find on the internet, here I share some of my experiences.

Using TWebbrowser for editing
As said before I needed to edit a HTML webpage. You can get the Document (from the loaded webpage) with MSHTML, a library providing WYSIWYG editing for Internet Explorer and thus TWebbrowser. This HTMLDocument provides access to all the elements of a webpage, and allows you to edit the page visually.
After adding MSHTML to your uses clause you can get the document as follows:

Getting the document:
HTMLDocument2Ifc := (MyWebbrowser.Document as IHTMLDocument2);

Note that the webpage must be completed loaded otherwise the object will be nil.

With a IHTMLDocument2 interface object we can edit the webpage. Now for this project I needed to place links absolute on the page aligned with some body background. But the first thing we need to do is setting the document in edit mode.

Setting the document in edit mode:
HTMLDocument2Ifc.DesignMode := 'On'; //Use 'Off' to switch desingmode off

Setting the body background:
(HTMLDocument2Ifc.body as IHTMLBodyElement).background := AFileName;
HTMLDocument2Ifc.body.style.backgroundRepeat :='no-repeat';

Setting the document for absolute positioning (2-D positioning):
HTMLDocument2Ifc.execCommand('2D-Position', false,true);


Now we can drag the links (wrapped by a span) around on the webpage.

With the execCommand method you can easily do a lot of editing on selected text in the document. To name a few:


HTMLDocument2Ifc.execCommand('Bold', false,0);
HTMLDocument2Ifc.execCommand('Italic', false,0);

HTMLDocument2Ifc.execCommand('FontSize', false, 4); //Set the font size of selected text
HTMLDocument2Ifc.execCommand('InsertImage', true,0); //Use default insert image dialog


There is a lot more, check microsoft MSHTML site for everything.

Another feature of the HTMLDocument2 is that you can get collections of images, links and styles of the webpage. For example you could get all the picture sources as follows:

for i := 0 to HTMLDocument2Ifc.images.length -1 do
begin

Item := HTMLDocument2Ifc.images.item(i, null) as Ihtmlelement;
lbItems.AddItem(Item.getAttribute('src',0) + ' [A Picture]', nil);
end;


Well there is a lot more to explore, but it is easier then you might think at forehand. Here are some links with more resources, to fool around with, on TWebbrowser:

Microsoft MSHTML site
Webbrowser to the max (about.delphi.com)
Brian Cryer TWebbrowser page
MSHTML Editier modus German site with examples.
WebSVN Code examples.


Tuesday, January 03, 2006

ECO Adventures: Master-Detail

I finally have the time to play with ECO and learn about what it is.
In this episode of 'The ECO adventures' I create a Master-Detail model.

In VCL it is very easy to create a master-detail relationship between two datasets (TDataSets) using the mastersource property. In ADO.NET you can make such relations within the .net dataset, but implementing them is a bit different compared with the TDataSet.
In ECO, it is again relative easy to implement.

Making the model
Take this model, where we have Customers and Projects. This two objects has a relation, where a customer has zero or more projects, and a project belongs, of course, to one customer.
In ECO we can model it like this:



Take an extra look at the /Project attribuut. This is a derived attribuut, in this case showing the projectnumber (an integer) and the description in one field.
This can be done by OCL. The expression for this one is:

self.Number.asString + '-' + self.description

You can easily create this with the OCL expression editor.

I have created this model in a ECO Package, so that it can be used in multiple client applications. (Winform and ASP.NET)

Making the Winform Application
Just add a ECO Winform Application to your projectgroup with the ECO package and make a project reference to the ECO dll. In this case it is the MasterDetail.dll.
After setting the reference, you must select the package in the ECO space of the Winform application, to let the application know that it can use the package.

After that you must first recompile for further designtime support.

Now we can create the GUI. The form has standard a few ECO components, with among others the rhRoot, wich connects the form to the ECO space. (The reference to the model)
Select the ECO space in the ECOSpaceType property of the rhRoot.

Connecting to the object instances of our classes (Customers and Projects) we use ExpressionHandles, which are connected to the model through the roothandle (rhRoot).

To get the project details, we have to use a CurrencyManagerHandle, which has the grid (in general a GUI control) with Customers as the BindingContext. Through this handle we connect to projects of a specific Customer. (This is like the CurrencyManager in ADO.NET)

So let's make this GUI:





Create a new expressionhandler and call this ehCustomers.
Set properties as below:
  • Roothandle -> rhRoot
  • Expression -> Customer.AllInstances (Use the OCL editor for this by invoking it with the ... button)

Set the property DataSource of the customer grid to ehCustomers. Notice that the grid shows the column name already!
ECO has some strong listactions build in to invoke operations directly on your objects. Set the property ECOListAction of the button right from the grid to 'Add'. And the Roothandle to ehCustomers.

Run the application.

OK this works. So far pretty easy, isn't it? Well now we want to see the projects of a specific customer in the other grid.
Here we need the CurrencyManagerHandle. Drop a CurrencyManagerhandle on the form and set the properties as follows:

  • Name -> cmCustomer
  • RootHandle -> ehCustomers
  • BindingContext -> CustomerDataGrid

The currencymanagerhandle will select a single instance of a customer (iow the selected customer in the grid).

To get the projects we need to drop another Expressionhandle, with the following properties set:

  • Name -> ehProjects
  • RootHandle -> cmCustomer (yes the CurrencyManagerHandler...)
  • Expression -> self.Projects (To select in the OCL editor through the Roles node)

Connect the projectgrid to ehProjects and assign the button for the Add list action.

Run the application.

Well this was pretty much it. Set the property Autoform on the grids to true and you already have a complete working application.

Conclusion:
ECO is a new way of programming (to me it is) .The way to use it is a little different compared to the database-driven approach although the main concept is the same. Keeping the business rules (like the relation) in the model is a strong benefit for the ECO approach. This was 'my first ECO application', and it was not all that hard. One thing to remember is to Compile your application often, this is needed for the designtime support I guess, otherwise you will sometime s look for property values you need which will not be there.

This ECO adventure will be continued...

Saturday, December 24, 2005

BDS 2006 in the works...

Well I installed BDS2006 lately and found some time to work with it. Here are my 'first' impressions.

  • Installation went smooth, taking about 25 minutes.
  • Converting D7 win32 applications went easy, only thing I had to change was the fact that the SQL property of a TADOQuery is now of type TWideStrings instead of TStrings. So I had to change on three location code like this : MyAdoQuery.SQL := AStringList to MyAdoQuery.SQL.Text := AStringList.Text. No problem what so ever.
  • Converting an Delphi 8 ASP.NET application was a bit confusing at first, because Delphi didn't see it as a ASP.NET application. Well it was my own fault, I had not all the files in my version control system included, copying it all from another PC worked well. As posted in an early entry I did have a few problems connecting to a SQL Server database with BDP in my ASP.NET application. The problem was that connecting to the database timed out. After struggling around with it for a while I found out that the problem was in the connection string. Where it says hostname I had ' localhost' changing this to '(local) or ' .' solved the problem. I still can not understand what the problem is with localhost. It could be a IIS problem, a SQL Server problem or a Delphi 2006 problem. Anyone...?
  • BDS2006 start up speed is fine. Especially starting up one personality is very fast, however don't try to load a project type from another one. :-)
  • Coding is fine. Live templates are cool, I had to get used to it though. Together integration is marvelous, ECO is even better!

Well time to pack up my old Delphi 7 and Delphi 8 and move all my projects over to BDS 2006.

Monday, December 19, 2005

I have it :-)

A few days ago BDS 2006 arrived! :-)
Because I'm rebuilding my house at this moment I had to find my PC between the building stuff (and dust) to install it. (My laptop has 256 Mb, I don't think it is a good idea to install it on that, perhaps I will try this later.)

Installation on my PIV 2,4 GHz with 512 Mb went smooth and took about 25 minutes.
Played a little and this beast is really fast and stable.
I got an error running an Delphi 8 ASP.NET application on my connections, somehow the 'old' connection components generated some error in the BdpConnectionStrings.xml file.
I remember such a problem during a Delphi 8 update, but I really don't have the time to investigate it now. Anyone reading this familiair with this problem? Any suggestion is much appreciated. By the way new connections are no problem at all.
(Maybe it is better to uninstall Delphi 8 first....)

The livetemplates are very cool and easy to use.
Well back to building, painting and other stuff, one thing is sure rebuilding your house during a Delphi release is no good idea. :-s

Thursday, December 15, 2005

Delphi 2006, editor shortcuts

Adam Markowitz has listed all the 'common used' short cuts in Delphi 2006.

I sure don't know (or use) them all, yet.

View the list here.

Wednesday, December 14, 2005

Live templates video

While waiting for my Delphi to arrive (back ordered next week :( ) Daniel R Wolf has a really great video on templates. (and more)

In the #3 video he shows how easy it is to make your own templates. These templates are really 'super man' food!

Watch them all here.

Tuesday, December 06, 2005

BDS2006 video's

While I'm still waiting for BDS2006 to arrive on my doorstep, there is a lot of information about BDS2006 from lucky ones who already got it!

A great introduction video (and more to come according the page) has been made by Daniel R. Wolf from Delphi-Praxis. The first video shows the VCL designer improvements and the live templates in the editor. Even if you don't speak German it is a great video. Super!

A lot information can be gained from all the blogs out there. My primary source is
http://www.delphifeeds.com and of course the Borland blogs.

It seems that BDS2006 really is a blast! :-)

And the waiting continues....... :(

Updated:
Looks like BDS2006 hits The Netherlands now. My supplier changed the tag 'Expected' to 'New!' yesterday 5-12-2006. (Santa Claus day to be specific :-) )

Tuesday, November 29, 2005

Delphi 2006 launch in Amsterdam

Today was the Delphi 2006 launch in Amsterdam, the Netherlands. The event was attended by about 200- 300 developers. (This is a wild guess...I did not count them.)

First David Intersimone gave an introduction to the new Delphi, the history and the future. He showed and discussed the Delphi roadmap.
Cary Jensen gave an overview of the improved IDE, showing the new productivity features. To name a few:
  • New refactorings
  • Live templates
  • Block completion
  • And more, much more...
  • ....

Especially the possibility to build and share your own templates is very nice.

After that Jason Vokes gave a small introduction of the ALM stuff (Starteam and CaliberRM) and an introduction to the C++ personality. A nice, C++ feature only, is Codeguard, which works in (debug mode) runtime to track bugs which are not spotted by the compiler. Looks like a great feature to me for Delphi. (in the future, that is)

After the break Jeroen Pluimers showed all the Together stuff. Really Live Source. The most of this seems to exist in the Enterprise and Architect SKU. This is very cool stuff, and I'm beginning to hang over to the Enterprise SKU already :-). But this was only the beginning....

Then it was time for Delphi's Golden Egg: ECO III.
Bob Swart (alias Dr Bob) gave an impressive ECO demo. He made an application in 3/4 of a hour without a single line of code. That means without a single line of Delphi or C# code.
He designed an UML Package, added classes with attributes, derived attributes and operations which he then used in a Delphi for .NET winforms application. All necessary coding was done in the Object Constrained Language (OCL) with small expression and statements. He also added a 'state machine' diagram to his model, using guards and..., well forgive me there was so much, but it looked relative easy to implement. He showed what the real power of ECO is: Give you the chance to focus on the business needs of the application. ECO takes care of all the underlying stuff. (like persistence mapping etc.)
Another great feature of ECO is the possibility to reverse engineer an existing database. Well Bob showed it in about, euh... 5 minuts. Sweet!
Jason Vokes had to drag Bob from the stage, because otherwise we still would be there. :-)

So what did we learn?

  • Delphi 2006 has lots of new productivity features for Win32, .NET (Delphi/C++/C#)
  • Delphi 2006 integrates Starteam and Caliber RM (Enterprise and Architect SKU)
  • Delphi 2006 Together integration is mature now
  • Delphi 2006 ECO III is the future of Software Development

For a few weeks I have been dubbing between the Pro and Enterprise edition. But now I now I want to use Together and ECO III so I will definitly go for the Enterprise edition.

It was a great afternoon......


Wednesday, November 23, 2005

Var injection and code completion

One of the great new things of Delphi 2006 is Var injection. It allows you to declare a variable in the middle of your code while the IDE takes care of placing it in the var section of your procedure. (At Nick's delphi blog post you can see how it actually works.)

No doubt, this kind of tricks boost your productivity!

Thinking it over, one of the things that, sometimes annoys me in Delphi coding is the fact that the procedure head in the initialization section of the unit must be the same as the procedure decleration itself. In fact this is no problem, but is has to be maintained during changes in, for example the parameters of the procedure.
For new procedures Code completion takes care of this when you create either the initialize or the procedure itself.

For example typing this in the initialization section of your unit:

procedure MyProcedure;

Clicking Control+SHIFT+C makes the procedure itself:

procedure TMyForm.MyProcedure;
begin

end;

This is great!, however adding an additional parameter in code (after rethinking the procedure) forces you to change the other manually. And that is in big units a lot of code cruising.

Would it be a good idea to use code completion also on existing procedures, so that for example editing the above procedure like this:

procedure MyProcedure(IForgotAParameter : Boolean);
begin
//Do some stuff
end;

....clicking Control+SHIFT+C updates the initialization section and vica versa.

Maybe the together support in Delphi2006 makes this easier?
Don't know, have to wait a little longer.........by the way 29 november 2005, Dutch Delphi 2006 launch in Hoofdorp. For more information click here.

Thursday, November 17, 2005

AJAX

Ajax is a new technology (in fact a combination of 'old' technology's) to drive your website. (I always thought it was our famous dutch football team from Amsterdam)
Ajax is hot(or hype). But what is it?

Ajax stands for Asynchronous Javascript And XML, it combines XML, HTML, DOM, Javascript and XMLHTTP. Bottom line is that it can solve the problem of many postbacks to your server by allowing you to load only parts of the webpage in the browser via XML.

For a good introduction and (.NET) example you better check out this dotnetbips article.
More on the technology can be found in this article.
Marco Cantu gave a BOF session on Ajax and Delphi at the BorCon, the slides can be found here.

Certainly will give this a try one day.

Thursday, November 10, 2005

DevCon papers, code and slides

The papers/code and slides from the DevCon sessions are available for download at :

http://bdn.borland.com/devcon05/delphi

Note that not all papers are submitted for download yet, probably because of the fact that DevCon has not ended yet.

Update:
Watch DevCon (or is it BorCon!?) keynote on BDN here.
Containing:

  • Opening video
  • Conference opening by David I
  • SDO by Rick Jackson
  • Tod Nielsen, the new CEO

Great stuff, must attend next year..... :-)

Wednesday, November 02, 2005

Incremental search.....supprise

Yesterday I was reading on the coding horror blog a rant about searching document files with Ctrl+F.
It said that Visual Studio has incremental search(Ctrl+I), which after I tested it is very usefull. I thought it is (was) a pity that Delphi does not (didn't) have incremental searching.

Today I read a comment on Nick Hodges blog entry Firefox my Delphi that Delphi has incremental searching from at least version 5!
Just click CTRL+E and it works.......

I must have missed something all this years, or this is one of the most secret shortcuts outthere. :-)

Tuesday, November 01, 2005

A must see ECO III video...

On BDN Henrik Jondell presents a BDNTV episode covering the new features of ECO III in Borland Developer Studio 2006.
In the 21 minutes during video Henrik show very cool (new and existing) ECO III features like:

  • Winform Autoforms
  • ASP.NET autoforms
  • Reverse engineering an existing database
  • Actions
  • State machines (finally have an idea what those are)
  • And much more...

A must see video indeed!

Wednesday, October 19, 2005

Going for ECO

Delphi's ECO is a great benefit in the .net world compared to Visual Studio. As far as I know there is no such thing in Visual Studio (yet) that matches the brilliance of ECO.

Until now ECO was only available in the Architect SKU of Delphi. According to the feature matrix of Borland Developer Studio 2006 ECO will be in all SKU's available.
The only difference (according the feature matrix) between the Professional and higher SKU's are that the higher SKU's have autoform support for ASP.NET and State Machines.

As a professional SKU user that is great news. Besides the above mentioned differences it seems that the professional SKU only supports basic object-relational mapping and transparent local XML persistence.
That said you can conclude that for ECO with database persistence support a higher SKU is needed.

Anyway I will definitly upgrade my Delphi version to either professional or enterprise SKU!
Still some time to decide....

Thursday, October 13, 2005

Another 24 hours...

This sounds like a new movie, but according to Ander's blogpost it is another 24 hours BDNRadio event about BDS 2006 (Delphi, C#, C++ Builder, ECO, VCL etc.) This will happen on the 24 th october 2005.

This will be fun! (again...)

Monday, October 10, 2005

Borland announces Delphi 2006

In a press release Borland has announced Delphi 2006.

Delphi 2006 the Ultimate Force-Multiplier

Wow, that must have something to do with super man!

According the press release Delphi 2006 will be available for pre-ordering between oct. 17 and 1 december.

Saturday, October 01, 2005

Delphi, what is it for me?

There is a sort of discussion going on, about what Delphi really is. Nick Hodges blogpost Dignity is deadly, trickered Allen Bauer in his blogpost Passionate Producers = Passionate Customers. One opinion is that Borland drifted away from the barbarian attitude of the early days, and that it needs more guerilla marketing like the 24 hours of Delphi event.
Well Delphi certainly is not only an IDE, it is community a great technology and it is Passion!
Marco Cantu, also added two intresting blogpost, Delphi Passion and Delphi in Trenches (this post really hits the nail on the head, a great post)

Read the blogposts for the full story.

What is Delphi for me, and why do I love it?

For me Delphi is passion, it always helped me to deliver my software projects in good quality and in time.

With the new roadmap it is very clear that Borland is committed to Delphi. Listening to the roadmap BDNRadio show, you can only conclude that all the people involved in the developing of Delphi are passionated and extremely dedicated.
That and the growing list of bugfixes makes me feel very confident that the next versions of Delphi(DeXter, Highlander, Vista,...) will be competing for the title "best Delphi version ever". Go figure it out: VCL Win32, VCL Win64, VCL for .NET, VCL for CF, VCL for Avalon! ECO, .NET1.0, .NET2.0! Man this will be a beast.

Conclusion: Go Delphi!

Wednesday, September 28, 2005

Delphi roadmap information overflow...

Since yesterday (27/9) when the Delphi roadmap saw the daylight on the EKON 9 conference in Germany, Delphi future information is really exploding on the internet, so let's summarize here where to find all the information:

Eyewitness reports:
There is a lot of 'live' blogging from EKON 9 going on, to name a few:

Borland employees:
You will find lot's of information on the Borland blogging community, to name a few:

There are probably more, please let me know.

Well one thing is clear:

Delphi is still alive and kicking....

Update 29-09-2005:
There is a list of 'closed' (read fixed) bugs in Quality Central here, for DeXter.
I don't know if this is the complete list.

Tuesday, September 27, 2005

Delphi roadmap

Marco Cantu blogs about the, long wanted, roadmap for Delphi!

Highlights are:

  • DeXter (End 2005) providing ECO III, with Basic ECO for all version of Delphi.
  • Highlander (2006) VCL for Compact Framework and support for .NET 2.0
  • Delphi for Vista (2007) VCL for Avalon and Indigo support
  • Delphi/C++ for Win64 (2007) Native 64 bits compiler

Check out Marco's complete blog entry here. (there will be a photo soon, to proove this :-) )

Personally I really love the ECO basic support for all Delphi versions. Can't wait to jump on it!

All this was exposed on the EKON 9 conference, which is going on as I write. You can also read other 'hot' stuff from this conference on Bob Swart's weblog.

Updated:
First pictures of David I's keynotes sheets can be found on Daniel Wischnewski's weblog.

Wednesday, September 21, 2005

Delphi CLR multicast events explored

In a recent blogpost, I compared the C# and Delphi languages regarding to events. This time I will dig a little deeper in the Delphi .NET multicast events.

In the original Delphi VCL (since 1995), multicast events are not supported. Events, in VCL, are properties which can be assigned using the read/write methodoligy. They are limited to one handler for one event.
In Delphi .NET multicast events are, just like in C#, supported. In C# multiple listners(handlers) can be added and removed with the += and -= operators.
In Delphi for .NET you can achieve the same behaviour with the Include and Exclude methods.

The following example adds an extra handler to a button click:

Include(MyButton.Click, MyExtraEventHandler);

to remove it use:

Exclude(MyButton.Click, MyExtraEventHandler);

MyExtraEventHandler is a procedure declared as follows:

procedure TfrmMain.MyExtraEventHandler(sender : System.Object; e : System.Eventargs);
(Any procedure is OK as long as the parameters compare)

Note that adding a handler multiple times causes this handler to fire multiple times. Removing a non existing handler, however, does not generate a runtime error.

Adding multicast events to an object:

To use multicast events you must declare them using the add and remove keywords. Read and writing for those events are not allowed. The compiler will generate an error "Read/Write not allowed for CLR events".
You can, if you like, use single cast events using the read and write style, just as in the VCL. In fact you could use a TNotifyEvent, but that is another story)

An add/remove example:

TMyObject = class
private
FBeforeSomething : System.EventHandler;
public
property BeforeSomething : System.EventHandler add FBeforeSomething remove FBeforeSomething;
procedure FireTheEvent;
end;

You can add eventhandlers, just like the above example, using the include and exclude methods:
MyObject := TMyObject.Create;
Include(MyObject.BeforeSomething, AnEventHandler);
Include(MyObject.BeforeSomething, AnOtherEventHandler);

So compared to VCL read/write events CLR events are not that difficult to understand. The main differents is that they are hooked up using the Include and Exclude methods.

Tuesday, September 20, 2005

ECO, the movies

ECO, Borland's Enterprise Core Object technology, is the one technology I really would like to learn and to work with. This .NET technology keeps you focused on the bussines objects. ECO seperates your code from the way you persist your data.
ECO provides you with one technology, and several persistance possibilitys. (Database, XML)

Unfortunately this technology is only available for the Architect SKU and, even more unfortunately, I don't own this SKU. (yet)

The only thing left are the great video's that were posted today on BDN TV, which give you a nice introduction into the ECO 'space'.

MDA Tour 1 Eco modeling and UI
MDA Tour 2 Persisting your ECO space

Thursday, September 15, 2005

Wow I'm on BDN!

This morning I checked my blog stats, which should be between, 1 and 6 hits, for a normal day. (One for myself ;-) )

Guess what: It said 147 hits! Wow, spilled some coffee over my desk.
Where is that coming from? bdn.borland.com (Huh?)

Well, I am listed on BDN with a blogpost about events in C# and Delphi.

That is very cool. :-)

Oops, didn't quit expect that to happen, so I hope the english is not to bad ;)










'....and still counting...'


Wednesday, September 14, 2005

Delphi 2005 Fix Roll up

Allen Bauer has made a Fix roll up, including all the latest (unofficial or are they now official?)Delphi 2005 fixes and included a new fix concerning a bug while multiselecting non-visual components.

The complete story is here.

C# 3.0 LINQ video

LINQ stand for Language INtegrated Query. With LINQ you can integrate your database query's into the C# language.

Anders Hejlsberg himself shows LINQ in this video.

It looks great.

The LINQ MSDN project can be found here.

Tuesday, September 13, 2005

Delphi update on BDN

On BDN there is a (monthly?) Delphi update from Borland on the future of Delphi. Borland is still committed to Delphi, and Delphi is part of the ALM vision.

It is encouriging to see the commitment to quality:

"The renewed focus on quality extends to IDE performance, responsiveness, stability and usability."

Conclusion: Borland is commited to Delphi!

Now only hope Dexter will rock again!

Saturday, September 10, 2005

Tuesday, September 06, 2005

C# events compared to Delphi events

Events in C# are, like in Delphi (or should I say Object Pascal) just properties of a class. Events are method pointers that delegate a call to the calling class. Just as in Delphi for .NET you can add multiple event handlers to an event.

An event has three main parts:

1. A method pointer property
2. The raising of the event
3. An event handler

1. A method pointer property.
Delphi and C# have a lot standard method pointer types. The most common Delphi method pointer type is the TNotifyEvent. In C# (or in .NET framework) this is the System.EventHandler.
You can use this methods, but you can also make your own.

Defining a method pointer type:
In C#:
public delegate void OnSomething(object Sender, int Value);

In .NET you could, of course, store the parameters in a (derived) System.EventArgs object.

In Delphi:
TOnSomething = procedure(Sender : TObject; Value : Integer) of Object;

They are just types that must be available for the object that uses them.

The class that wants to raise the event must have a public property for it:
In C#:
public event OnSomething BeforeSomething;

In Delphi:
property BeforeSomething : TOnSomething read FBeforeSomething write BeforeSomething;
(Where FBeforeSomething is a private field of the same type)

2. Raising the event
In this example the BeforeSomething event is raised. If the calling class has assigned the property to the (event) class this one can raise it.

In C#:
public virtual void LetItHappen()
{
// The class should add a valid integer value for the event, here 10
if (OnSomething!= null) OnSomething(this, 10);
}
}


In Delphi:
procedure
TSomeClass.LetItHappen;
begin
if Assigned(FOnSomething) then FOnSomething(Self, 10);
end;

You must check if the property is assigned else you will get an access violation.

The code for C# and Delphi is amazingly similar. You can make it more similar if you like:

private bool Assigned(object AObject)
{
if (AObject != null)
return true;
else
return false;
}

the C# code then could be:
if Assigned(OnSomething) OnSomething(this, 10);
;-)

3. The eventhandler
In the calling object you should first make an event handler method:
(Suppose the calling is SomeObject : TSomeClass)

In C#:
private void MyBeforeSomething(object Sender, int Value)
{
MessageBox.Show(Value.ToString());
}

In Delphi:
procedure
TSomeClass.MyBeforeSomething(Sender : TObject; Value :
Integer);
begin
ShowMessage(IntToStr(Value);
end;

The last thing you should do now is assigning the property:

In C#:
SomeObject.BeforeSomething += new OnSomething(MyBeforeSomething);

A new handler is added to list of handlers (or listners). You can remove them by using '-='

In Delphi:
SomeObject.BeforeSomething := MyBeforeSometing;

In Delphi for .NET you can also add multiple handlers (listners) for an
event, using the Include en Exclude methods.

Events in C# are basically the same as in Delphi. C# must be Delphi's little brother, no doubt about that.
More information on events in C# can be found on MSDN here.

Thursday, August 11, 2005

Received my copy of Mastering Delphi 2005

Although the book is not yet in the stores (here in the Netherlands) I received today my copy of Marco Cantu's Mastering Delphi 2005. (Woohoo)

I won this copy on the Delphi 2005 24 hour marathon.

Thank you Borland!

Tuesday, August 09, 2005

ASP.NET Tech-Ed 2005 presentations

Intrested in ASP.NET? Specific ASP.NET 2.0?

Check out the online presentations and demo's from the Tech-Ed 2005.

Want a free 17 hours Microsoft ASP.NET training? (worth $349,-)
Check it out here.

Wednesday, August 03, 2005

Hybride .NET Applications

Recently I have been working on a .NET project in Delphi 7. I hear you think, yeah right this guy needs a vacation. Well the last part is certainly true, I need a vacation.
Well the story is as follows.

This project needs to show flow diagrams based on related data in a database. ASP.NET is a very good way for generating dynamic flow diagrams. It can be used to read the data from the database and create the (mostly image)controls dynamically on a webpage. So the webbrowser can be used to view the diagram.
The maintenance application however is a win32 Delphi application hosting a webbrowser component. The choice for Win32 Delphi 7 was based on skills and existing library's.
More specific "Why not a win32 application?" or "Why not a .NET application?"
Well the answer is skills, existing code base and last but not least speed. I just can not build my apps faster then using Delphi 7.
But again with a browser in the application I can fully use the .NET features from the webapplication. It is just a matter of good interfering the browser in the beforenavigate2 and ondocumentcomplete event, so that user thinks it is one application.
In this way I can pick up a browser navigate, cancel it and take it over with a win32 form.

The webapplication is written in Delphi 8, which was not always that easy because of the rough site of Delphi 8.
However I feel that I can fully profit of the .NET framework and Win32 in a single application.

I call it a Hybride .NET Application.

Friday, July 29, 2005

Clever overloading

In C# you can not set default values for method parameters like in Delphi. So you can not make a method like this:

private int DoSomething(int Start, int End = -1);

The only way to 'simulate' this is using an overloaded method.

What is overloading?
Overloading gives you the possibility to name two methods the same, but they must have different parameters. So in a way you can simulate the default parameters.
In Delphi you must mark this methods as overloaded in C# you can write your methods without any keyword.

When using overloading for 'default' purposes it should be considered that if you don't do this clever you will be put up with two methods with almost te same code, so it is wise to follow the rule that the method with the fewest parameters calls the other one.

So in the DoSomething method:
(A very stupid function indeed :) )

private int DoSomething(int Start, int End);
{
if (End !=- 1)
return Start + End;
else
return Start + 1000;
}

private int DoSomething(int Start);
{
return DoSomething(Start, -1);
//So do not do this, you will end up with two same code paths:
// return Start + 1000;
}

Friday, July 22, 2005

Making up for .NET 2.0

Visual Studio 2005 and .NET Framework 2.0 will be released in november 2005. Although I am still exploring (and sometimes struggling) with .NET 1.1. it is time to make up for .NET 2.0.

Some things will break, moving from 1.1 to 2.0. Microsoft released a 'List of Breaking Changed' here.

More compatibility issues can be found here.

Updated 29-07-2005
For specific ASP.NET upgrade issues you can look at the upgrade center here.
And for conversion issues here.

Tuesday, July 19, 2005

The 24 hours of Delphi audio recordings

The audio recordings of the great '24 hours of Delphi' are now online.
Click here to listen to each session and get to know the faces behind the voices.

What is ECO anyway?

Peter Morris has written a BDN article on ECO, called 'What is ECO anyway?'. The article provides a great overview of ECO for the ECO-rookies (like myself).

You really should check this out!

Delphi CF Preview available now

According to Danny Thorpe's blogpost today, the Delphi for .NET Compact Framework Technology preview compiler (Wow that sounds just great) is now available for download. (D2005 registred users only).

If you don't have a PDA you can download the Microsoft WinCE emulator here.

Thursday, July 14, 2005

The day after: I won a price!

The 24 hour Delphi marathon was really cool!
And it becomes even cooler because I won a price!!!. I am now the proud owner of Mastering Delphi 2005 from Marco Cantu.

Thank you Borland !

:-)

Wednesday, July 13, 2005

Tuesday, July 05, 2005

Winforms, One point!

Today I encountered an easy problem in a Winforms application. I had to set the default button for a form. I know this can hardly be called a problem. :-)

Let me see, in Delphi the TButton has a Default and Cancel property, set them and go. In winforms however buttons do not have that properties $-), well ahumm, after a bit of looking around I finally(yes I admit) found it!
In Winforms the form it self has an property AcceptButton and CancelButton, so you don't have to set a button property. Thinking it over the winforms solution is more logical compared to the VCL solution, where you can set multiple Default buttons for one form, which of course is looking for trouble.

Well I guess (finally) one point for Winforms.

Wednesday, June 29, 2005

War of the OOPs?

Nick Hodges talks in this post about some quirks, regarding to OOP and the .NET Framework. Of course his statement "Microsoft doesn't quite get OOP" does generate a lot of dust and discussions out there.
Julian Bucknall replies in his own CodeFez entry stating "Nick doesn't quite get OOP", and Steve Teixeira's responses in his blog here.

I must say I agree a lot with the statements that Nick makes regarding the .net framework, although I can not oversee all the technical details (yet), I think:

- The .NET framework is far by mature, it takes a lot of code to make things happen.
- ADO.NET is not mature yet (I can not say that it is not designed properly, but it still misses some important pieces in my opinion). See my blogentry When has the data changed .
- OOP code is supposed to reduce the amount of code.
- Sealed classes should not exist.

I must say that I probably only feel this way as a Delphi VCL developer since 1995.Anyway very intresting reads though, all that different opinions out there.

Thursday, June 23, 2005

Wednesday, June 15, 2005

A look in the kitchen called Delphi

Steve Trefethen has an intresting post about The Delphi R&D development Process. Really intresting to read how Delphi is made (...in Borland).

Monday, June 13, 2005

Hello DeXter

See the new Delphi IDE -> Delphi 2006 codename DeXter.

The video shows a C++ application build in DeXter.

DeXter:
  • Nice tabs
  • Nice little blue balls at the edge of controls
  • Looks fast

Some old Delphi papers

I moved some of my papers, formely hosted by The Software Developer Pages, to this weblog. The papers cover the Delphi basics on OOP programming and Database programming. They are now about five years old and based on Delphi 5, but I guess they are still pretty actual.

If you are intrested, here are the links:
Papers in English
Papers in het nederlands

Delphi and SDO

Borland is pushing hard the Software Delivery Optimization technology. It has until now always been difficult to exact point out what it is and how it fits in the Delphi IDE and our daily work as a software developer.

On BDNTv you can watch a serie of episodes, which explains SDO and show previews of how different part are integrated in de Delphi IDE.

To point out a few:

It is pretty sure that Delphi will fully integrate the SDO stuff in the future. I personally don't use it right now, but the integration will surely help 'playing' with it and later on using it.

Friday, June 03, 2005

The future of Delphi

On Bitwise Magazine, you can watch a video interview with David I. David talks about Delphi and about the future of Delphi. So if you wanna know where Delphi (Borland) is heading go over and watch it.

Some history

A post in the Borland non-technical newsgroup about the history of Delphi triggered me to dive in the history of computer languages.
You can find a complete overview of the history of computer languages here. There are 50 languages in this timeline chart.
It all starts in 1954 with Fortran. I am not sure if this is the first computer language ever because only 50 out of 2500! are shown.
Pascal 'starts' in 1970 and evolves to Turbo Pascal in 1983 and later on of course into Delphi(1995).
The charts shows relations between the languages. One particular is the one between Delphi and C# in the year 2000, so I guess C# really is Delphi's brother. :-)
The site has great resources to all kind of languages.

For the complete history 'From Pascal to Delphi' (including codenames and release dates) the guys at Dragonsoft made an overview here.
On Delphi Basics you will find a brief history on Delphi.

My history with Pascal/Delphi:
For myself the history with Pascal starts in 1989 with Turbo Pascal 3. (Can't remember the exact version)
A couple of years later I made a slight turn to Clipper, but I did not like the 'not existing' IDE, I guess Turbo Pascal already had an excellent integrated enviroment (Editor and Compiler in one IDE).
Clipper, of course, was great with databases, but I turned to Turbo Pascal 6 in combination with the TOPAZ toolbox, which was incredible with DBASE databases. (I can remember a book coverage with plumbers, plumbing the data into your application :) )
After that I used all Delphi versions except version 3.

For those who don't know yet you can download several old TP versions from the Borland Museum.

Wednesday, June 01, 2005

New online magazine: Bitwise Magazine

The BitWise Magazine has gone live, covering Delphi, Chrome and other languages, and also other computer related stuff.
It comes once a month and is worth checking out!

Friday, May 20, 2005

Delphi 2005 update 3 available

Delphi 2005 update #3 is available for download here.

Update 21-05-2005:
97 errors has been solved in this update. You can view them here in Quality Central.

Thursday, May 19, 2005

An unofficial comparison between VS and D7/D8/D2005

My Visual Studio (C#) project is still in progress and I have now some experience with the Visual Studio IDE.
So let's compare it with Delphi!

What I like about Visual Studio version 2003:
  • Automatic code generation for events
    If you want to use an event(delegate) of an object you can use the tab key to generate an event handler.
  • xsd design for datasets
    I haven't found this in Delphi yet.

Well thats it! I can not think of another something that makes me say Wow!

What I miss in Visual Studio 2003?

  • Structure view
    Although there is a Document Outline view, which does this trick in VS 2005 but is empty in VS 2003.
  • Code Explorer
    This one I really miss, code folding just does not do the trick for me.
  • Live Data
    Well what can you say, we are spoiled from Delphi 1 until now.
  • Code Completion
    There is code completion (see above) but it is much more implemented in the Delphi IDE. It is so much easier to type your property IsNice:Boolean; and then to click the magic keys(CTRL-SHIFT-C) then going to a class view and add a property where you must declare the Field yourself afterwards. (This might be a C# versus Delphi issue)
  • Code / Design tab at the bottom of the main view
    In VS you have in no time an never ending range of tabs (two for every form). In Delphi the form and design tab are at the bottom of the screen, so one at the top for each form.

Well just my 2 cents.


Stored Procedures or not....

Should you use Stored Procedures or Ad-Hoc SQL?
This question came up recently in a project. During investigating the issue I found a very good discussion via this Coding Horror blog entry. There is a great link there with a very detailed explanation (and discussion) of issue. (Pro's and contra's)

One of the things you will find in the discussion is that the 'SPs are secure by nature claim' is wrong or at least over judged. Only parameterized Stored Procedures and query's are secure for SQL injection attacks.

Conclusion:
Don't use Stored Procedures for granted, look at the specific situation, considering security, maintainability and performance.

Great discussion though!

Saturday, May 14, 2005

How to write maintainable code

How to write maintainable code is the one question that comes up everytime a developer designs a new application.
On this website I found the 'other way around approach' i.o.w. How to write Unmaintainable Code.

Quote from the website:

"if you follow all these rules religiously, you will even guarantee yourself a lifetime of employment, since no one but you has a hope in hell of maintaining the code. Then again, if you followed all these rules religiously, even you wouldn't be able to maintain the code!"

"You don't want to overdo this. Your code should not look hopelessly unmaintainable, just be that way. Otherwise it stands the risk of being rewritten or refactored."

Hahaha, this is funny!
So if you don't follow that rules, your code is maintainable!
; -)

Thursday, May 12, 2005

Borland Delphi Survey

On BDN there is a great Delphi Survey.
It shows pretty much what Borland has in mind for Delphi's future.

Go Delphi!

Wednesday, May 11, 2005

ADO.NET: When has the data changed?

I am still struggling with ADO.NET and databinding in particular.(see my earlier post 'In quest for the ADO.NET AfterEdit event') .

In this episode: When has the data changed?

In a datagrid
If I have a datagrid bind to a dataset-table, and I edit a value (without navigating to another record) the DataSet.HasChanges function returns true. That is correct! After that you can call GetChanges or AcceptChanges. (This is expected behavior)

In a textbox
If I have a textbox bind to a dataset-table-field and I edit the value (without navigating to another record) the HasChanges function returns false. (!?) In other words the change is not commited to the dataset.

But......
I can Accept those changes with AcceptChanges????? This is very strange!

Again: What am i missing?
(I know VCL's TDataSet! :-) )

Tuesday, May 10, 2005

D2005 the performance update

According to this blogpost by John Kaster, Delphi 2005 update 3 will be the performance update.

The following items will be updated/improved:

  • Slow Project Load Times with Modeling Enabled
  • Slow Response when Editing Models
  • Long Pause when Switching Between the Editor and Form Designer
  • Access violation removing breakpoint

I suppose it will be out any time now.

Sunday, May 08, 2005

My first PDA application

In Delphi 2006 there is a chance that the Compact Framework is supported. You can read here more about it. I don't have plans yet for PDA programming so I can wait till Delphi 2006. However curious about the whole thing I started searching and finally found a really nice tool from GrandaSoft for PDA form programming. It consist of two tools, first XSForms, a sort of runtime to install on your PDA and second XSDesigner, the IDE for designing the applications.

This tool allows you to make a PDA program without any line of code, with mulitple tabs, in no time what so ever! Really cool, hey I can program PDA's!
The forms are stored in XML and XSForms provides navigation between the records which are stored in a Pocket Access Database. The tool itself is still in development, and by now you can not code in it, but what the hack, you can make great applications on the fly and it is free for private use. For a test I made a Grocery List Manager (in dutch), and it looks like this:





Nah I don't use it yet for real, but it was fun to make. :-)
All with all a real nice tool to watch closely in the future.
I am really excited about PDA programming and looking forward (and hoping) to the VCL implementation of it.

Saturday, May 07, 2005

ECO Accelerating Development demo

I stated it before ECO makes the difference between Delphi (.NET) and the competition. It is a great technology, if only it could become available in a 'lite' version for the professional SKU it would IMO become THE development way for .net application with Delphi.

On BDNTV there is very (in depth) detailed demo about ECO II, a must have seen!

Wednesday, May 04, 2005

Trust in Borland

On BDNRadio you can listen to the replay of the Trust in Borland session with Borland CEO Dale Fuller.
David I talks here about an other update 'with dramatic performance improvements' in the pipeline for Delphi 2005.

Wednesday, April 27, 2005

Software Delivery Optimization, the movie...

I don't know all the details of this Borland vision, but watching the movie about it, presented by Boz Elloy is both intresting and amusing.

Though it is a bit long...

Monday, April 25, 2005

Playing with pricing and packaging

Michael Slinn, the new marketing guy at Borland, has a very intresting post about Delphi packages and pricing. He is kicking around some ideas about this issue.

One of the issues he brings up is an ECO Lite version for the Professional edition. I always felt that ECO could make the difference for Delphi on the pure .NET side. IMO providing this technology in Pro could make ECO a mainstream development technology for .NET applications, which (could) mean a huge benefit for Delphi compared with the competition!

Update 26-04-2005
The original post has been removed, but the discussion goes on.

Sunday, April 24, 2005

The Quest for the ADO.NET AfterEdit event

ADO.NET is an excellent way of working with data on a client in a disconnected world, no doubt about that, but it seems to me that it is lacking a lot of 'common used' features. I am not all that familair with ADO.NET yet, so it might as well be me lacking a lot of common knowledge. :-)

I am working on a .NET project, and with a Delphi VCL background you really miss a TNavigator for a starter.
So lets build a Navigator ourself. A navigator is a bunch of buttons (First, Prior, Next, Last, Insert, Delete, Post, Cancel etcetera)
A great advance of using a navigator that it encapsulate a lot of code, so that you spare extra code on each form where you use it. It also has the ability to context sensitive act to changes (read events) in the data that it is navigating. So make a control, give him a DataSet and a Table name and go........well it is not that simple!

It is bugging me few days now that I can not find any event in ADO.NET that 'tells' me that the data is edited. I mean at the first keystroke of the user, so that the Post and Cancel buttons of the navigator can become active.

Lets explore some events of the main ADO.NET components:

The DataTable
The datatable seems to me the most logic choice for such an event. It has the following events:
  • ColumnChanging
  • ColumnChanged
  • RowChanging
  • RowChanged

If you examine(try) this events you will notice that they all fire after the actual edit, and that is to late!

The DataView
The DataView has only a listchanged event which does not help us at all.

The DataRow
The datarow has a property RowState, which changes after an edit occurs, but it has no OnRowStateChange event.

The CurrencyManager
The CurrencyManager manages a list of bindingobjects, and that are our controls. The CurrencyManger has the following events:

  • CurrentChanged
  • ItemChanged
  • MetaDataChanged
  • PositionChanged

They sound promising, but again they fire after the actual keystroke.

So as far as I know there is no event in ADO.NET like the VCL TDataSet BeforeEdit and AfterEdit event. It seems to work in other way in .NET and the only solution I can think of is tracking the OnChange events of the controls on the form.

What am I missing?

Monday, April 18, 2005

Borcon 2004 papers online

It seems that the Borcon 2004 white papers are online now!
They can be found at the Borland Borcon2004 website.

You can find some good stuff there.

Wednesday, April 13, 2005

C# and his big brother

Lately I have been doing my first (real world) C# project. (Unfortunately I had to do it in VS2003 ;( )
C# must be Delphi's little brother! The language really feels like the Delphi language. Also the syntax, was not all that difficult to get used to.
I find my self programming 'Delphi code style' in C#.

For example in Delphi you write a function like this:

function ReturnANumber(SomeCondition : Integer) : Integer;
begin
Result := 0;
If SomeCondition > 100 then
Result := 101
else
Result := 102;
end;

You can not do this in C#, because it will return immediately to the caller, so I figured the following:

private int ReturnANumber(int SomeCondition)
{
int Result;
Result = 0;
If (SomeCondition > 100)
{
Result = 101

}
else
Result = 102;

return Result;
}

How about this function:

private void bool Assigned(object AObject)
{
if (AObject = null) return false else return true;
}

If you use this function for raising an event, well it could almost be Delphi :-)

if Assigned(SomeMethodPointerType) SomeMethodPointerType(this);

Use an image as your UIBarButtonItem

Using an image as your UIBarButtonItem in your navigationcontroller bar can only be achieved by using a common UIButton as the BarButtonItem...