CodeGear

You are currently browsing articles tagged CodeGear.

Front, Middle or Back?

I attended the annual autumn seminar organised by the Delphi user group in Gothenburg, Sweden. We where twenty four enthusiastic Delphi hackers networking and sharing ideas about development. I was invited to talk about the Roadmap of DevCo’s products and listen to feedback.

BalderWe ended the day by visiting the amusement park Liseberg. They have a cool rollercoaster built in wood called Balder and I tried to empirical find out where it is best to sit. “Different forces operate on the front and the back of the train and the ride in the front is distinctly different from the back. … The train is slowing down as the train begins to climb over the top of the hill, and speeding up again as it starts to descend again. Thus, if there is any airtime to be had before the top of the hill, it will be best in the front, as that is the part of the train moving fastest there, but airtime after the top of a hill will be best in the back. Thus, depending on the configuration of hills on a coaster, it may a better front seat ride or back seat ride.” For this rollercoaster I think the front seat is best. :-)

Hallvard Vassbotn, one of the Delphi Gurus in Norway, is bloging about community meetings in Oslo. He is also writing a lot of intresting things about what’s new in the language since Delphi 7.

One of the messages I bring back from the users at the Gothenburg meeting to DevCo is not to loose focus on native development. Win32 development is still very important.
– Make it future proof with Win64 compiler, Unicode support and Avalon (WPF) for VCL and bring back Delphi.NET language improvements to the native compiler.

Next community meeting in the Nordic region is in Stockholm in 10 days: http://delphi.meetup.com/172/events/5040855/

Tags: ,

disketterhi.jpgI had a little delayed spring cleaning of my apartment. And look what I found deep down in a drawer!

It is easy to feel nostalgic but what I learned back then back in school using Turbo Pascal has formed my whole carrier. I have always liked the Pascal language; I do not know why but I think it is because I feel productive and it is easy to get a grip of the code compared to other languages. (A very subjective, personal opinion – please do not flame me with a language war.)

It is easy when you speak one programming language fluently to look down on other languages and see what is missing in them and what makes your language more high level and effective. But what about the other way around? If you look up at a language that has something that make it more effective and help you develop on a higher level of abstraction. Will you recognise it? Probably not. I guess that most people would have a look at it and disregard it as something strange that you do not need.

I loved when the Pascal language was extended with objects in back in Turbo Pascal 5.5 but it took a while of study and thinking before I got it. We have made a lot of improvements over the years (and I like all of them except nested types which I think looks ugly, it does not feel right).

So what is the next major improvement of Object Pascal going to be? If I could decide I would have a look at one of the cool features of Lisp – closures.

How could that look like in Pascal? Procedural types can already be used to pass along a pointer to a function but passing a pointer to a local procedure to a procedure variable will not be accepted by the compiler today.

procedure doThreetimes( P: TProcedure );
begin
  P;
  P;
  P;
end;procedure Count;
var
  n: integer;
procedure add1;
  begin
    n := n + 1;
  end;
begin
  n := 0;
  doThreeTimes( add1 );
  WriteLn( n ) // here n is 3
end;

Another way could be to pass anonymous functions.

procedure doThreetimes( P: TProcedure );
begin
  P;
  P;
  P;
end;procedure Count;
var
  I: integer;
begin
  I := 0;
  doThreeTimes(
    procedure();
    begin
      I := I + 1;
    end; );
  WriteLn( I ) // here I is 3
end;

Or maybe like this:

procedure TForm1.FormCreate(Sender: TObject);
begin
  Button1.OnClick := procedure(); begin
    Self.Caption := 'New Form Title';
  end;
end;

So what would you choose to improve in Object Pascal if you could decide for yourself?

Tags: ,

Swedish Info…

Användargrupp i Göteborg
Vi vill lyfta fram användargruppen för Delphi i Göteborg som organiseras av Magnus Flysjö. Vill du träffa andra utvecklare och byta erfarenheter? Gruppen träffas regelbundet och det kostar inget att vara medlem.

Läs mer och bli medlem»


Höstseminarium i GöteborgFredagen den 1 september anordnar användargruppen för Delphi i Göteborg sitt höstseminarium och det finns fortfarande några platser kvar.

Seminariet hålls på hotell Gothia Towers i centrala Göteborg mellan klockan 08:30 och 15:30. Efteråt blir det femkamp på Liseberg för dem som vill och vinnaren kan gå hem med en iPod Nano eller digitalkamera.

Läs mer om programmet och anmäl dig här»


Användarmöte i StockholmTorsdag den 14 september blir det användarmöte efter jobbet i Stockholm. Mötet är på Nordic Sea hotell (vid Arlanda Express) klockan 17:00.

Det kommer att finnas möjlighet att presentera sig och vad man jobbar med. Vi bjuder på en matig smörgås under kvällen och det finns tid för lite nätverkande och småprat. Kort information om delningen av Borland. Vi har bjudit hit Holger Flick från Tyskland för att prata om webbprogrammering med ASP.NET och ECO.

Varför den nya minneshanteraren i BDS 2006 kan fördubbla hastigheten på din Win32 applikation och andra tips.

Produktchefen för Interbase samt utvecklingsavdelningen för Delphi i Stockholm är på plats för att svara på dina frågor.

Läs mer och anmäl dig här»


EuroDevCon 2006I slutet av september hålls den Europeiska utvecklarkonferensen i Frankfurt, Tyskland. Här kan du se semiarier av Marco Cantù, Ray Konopka, Michael Li, Bob Swart, m.fl. Före och efter konferensen finns också endags workshops för den som vill fördjupa sig.

Läs mer»


Tveka inte att kontakta mig, mina kollegor eller våra partners med synpunkter och frågor.Vänliga hälsningar,
Fredrik Haglund

Tags: ,

If you do not live in Sweden you can stop reading now…


I min nya roll på Borland som ”Evangelist” för Developer Tools Group i Norden ingår det bland annat att hålla kontakt med alla utvecklare. Både att lyssna på er feedback och prata ur ett teknikst perspektiv om våra utvecklingsverktyg, så vad kan vara lämpligare att börja med att ha några möten där vi kan träffas?I september ser det ut att bli två Delphi Community Möten.Det första arrangeras av Göteborg Delphi Meetup Group och är den 1 september i Göteborg. Agendan håller på att ta form just nu men det blir en heldag som avslutas med fem-kamp på Liseberg för dem som vill.Det andra mötet blir i Stockholm den 14 september efter jobbet. Inga detaljer klara ännu men sätt ett märke i din kalender!

Några frågor? Skriv gärna en rad och berätta att du finns och vad du gör. Vi hörs!

Tags: ,

Delphi on Rails?

There is a lot of hype around the open source project Ruby on Rails these days so I spent some time looking into the framework because I’m always curious about new technology. First impression is always important and I really liked the home page for Ruby on Rails for its simplicity and David Heinemeier Hansson’s exciting 15 minutes introduction.

Personally I think it is the commercial open source framework part (read VCL if you like) of Delphi that has been one of the strongest success factors for the product over the years. One of the newest additions of frameworks in Delphi (or BDS if you prefer) is the ECO framework and that framework has some things in common with Rails.

- Yes, before someone rubs it in my face, I know we do not ship every line of source for the ECO framework like with most other parts of VCL. I agree that it is important to be able to recompile and study the source of the foundation you build your application on. I promise you that I nag on the ECO-team every day about this.

The ECO framework is one of the more secret weapons in Delphi. I must admit we have not been very good at educating our developer community on how to benefit from this fantastic framework in the product. A lot of you out there have glanced at it and either got scared because of the first step is a little to large or got disheartened by the modelling surface in the IDE before you even started to look at the framework. I encourage you to take another look!

I started to roll with Ruby on Rails by looking at the Cookbook example. With a few steps you have a simple application up and running with a classic Model-View-Controller architecture using a database but without tedious manual SQL-mapping.

rail2.PNG

Very nice! This is showing that more developers are getting ready to work with domain objects, attributes and methods instead of tables, columns and rows. I remember how hard it was to explain the benefits of model-view back in 1997 when I started to develop applications using domain objects instead of using the database approach with TQueries, etc.

One important part of the Rails framework is the mapping between Objects and the Database. This part of a framework is usually called an Object-Relational mapper (or short OR-mapper) and takes care of all basic CRUD-operations (Create, Retrieve, Update and Delete).

In Delphi.NET (and C#) the ECO-framework can do OR-mapping for you. ECO has been around for some time, it is actually version seven. We have made four major releases for Win32 under the name Bold (Business Object Layer for Delphi) and three DotNet releases. ECO is very model centric than Rails which is more database centric. I like the Rails concept “Don’t Repeat Yourself”. Maybe it is easier for adopters to understand and start with a database centric approach? ECO has a tool that can import a schema from a database but it could be simpler to use…

Anyone who has tried to write an OR-mapper knows that the first steps are very simple and then you will hit a wall of complex problem you have to solve. I tried to provoke the OR-mapper in Rails just to see how mature it is and what would happen.
The cookbook example has only two classes, recipe and category. I created a new category and then a new recipe. I assigned the category pointer in the new recipe instance to point to my new category. Then I deleted my newly created category. BANG! I got a nil pointer error in the view. It happens and is easy to fix, who has not got Access Violations in there applications when the code does not expect nil pointers?

rail1.PNG

But more worrying is that Rails OR-mapper has not updated the other end of the relation at all. Looking directly at the SQL table there is records with category_id pointing to a category that does not exist. And when I added referential integrity to that database Rails got problems updating the database isntead. There might be easy ways get this to work in Rails but I’m a Rails rookie and I have not found it yet. Can someone with deeper knowledge enlighten me?

Anyway, I know that we have spent several a lot of time perfecting the OR-mapper in the ECO framework to solve problems like this. Managing associations between objects is one complex area where much thought has been spent. If you modify one end of a relation, you need to update pointers in the other end and generating the correct order of SQL insert-, update- and delete-statements is crucial to not violate referential integrity in the database.

Tags: ,

« Older entries § Newer entries »