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.