Flotsam and Jetsam #57

I asked this on Twitter, and I’ll ask it here as well:  Does this sound right to everyone? You put things into a list/collection, but you always get them out with an IEnumerable.  (Delphi Spring has such a beast, in case you were wondering…) Apparently Dr. Evil can’t use JSON, as the license – literally – doesn’t allow it.  I wonder if the Wikipedia Patrol will let the last entry on this page stand.  In my experience, the denizens of Wikipedia can be……rather zealous.  So far so good. Hey, I’d like to give a shout out to a staunch Delphi supporter and good guy,  Eko Indriyawan. He’s an Embarcadero Partner and provides RAD Studio training.  If you are in the Southeast Asian region, look him up. DevExpress has published their roadmap for 2012, and of course, it includes information about what they are planning for their VCL controls.  I for one appreciate DevExpress’s continued support of VCL. Make sure you get Update 4 to the RAD Studio Help. As noted above, I have a love/hate relationship with Wikipedia – mostly love – but this kind of entry makes it all worthwhile: Rubber Duck Debugging I myself have solved many a problem by merely typing up a question for StackOverflow or a forum, but the image of a guy talking to the rubber duck is just priceless. (Tip of the cap to Coding Horror) And it seems that RAD Studio’s Update 4 caused some problems with the rendering of fonts in FireMonkey, so it looks like a Hotfix to Update 4 (Update 5?) is in the works.  Here’s an interesting little tidbit that happened to me this week.  I did a “deep system cleansing” on my machine, and decided to change email clients for my nickhodges.com address.  I downloaded and installed Thunderbird, but it absolutely refused to connect to my mail server. Neither the auto-detect nor manual entry would fetch my mail.  So I downloaded Eudora Open Source Edition – which is apparently the same codebase as Thunderbird somewhere back in the history of things – and that worked like a charm.  Eudora OSE detected my settings and had me up and running in about a minute.  Huh.
Read More

FireMonkey Fonts and Native Look & Feel

Since XE2 Update 4 was released, there have been a few online complaints (1, 2) about FireMonkey's fonts on Windows.  I had most of a blog post written explaining why it actually was fine, when I read that there will be a hot fix targeting this and other issues.  I guess it is an issue after all, then! But when it comes to FireMonkey's text, there are more important things than antialiasing or
Read More

Test Driven Development in Delphi: The Basics

I intend to write a Test Driven Development (TDD) series, targeted for Delphi developers. I will use DUnit, the unit testing framework for Delphi.Note folks that the purpose of this is NOT to discuss the Pros and Cons of TDD, Unit Testing or whatsoever. The purpose is just to give a few examples. I would love if you help me when the complexity starts climbing.If needed, for a quick understanding of what TDD or Unit Testing is, refer to the links above, or check out the book at the end of the article.In TDD you don’t write the application code first, instead you write the test cases first. The TDD cycle is as follows:At the beginning you just write one test, and later on, more tests can be added.Make sure the initial test fails; this will validate the test harness. Write some code to pass the test. Important: don’t over-code. Just add the code needed to pass the test and period. The code does not have to be elegant at this point.Run the test: if it fails, then you have to go back to step 3 and fix your code in order to pass the test. When you succeed, then move on to step 5.Improve and optimize your code: make it elegant, more efficient, avoid duplications, etc, etc. This is called code refactoring.When refactoring your code, maybe, by accident, you break the functionality. How can you be sure that everything is working as it should? Just re-run your test and it will tell you if the previous refactoring introduced a failure or not.Go to step 1 and add a new test if needed.The example: let’s consider the chess game. The goal will be to implement the code to verify whether a piece is placed in a valid position within the board. We are only going to implement one test: SetPositionTest.I will number the columns (X coordinate) from 1 to 8 starting at the bottom left-hand corner. In the same way, I will number the rows (Y coordinate) from 1 to 8 starting at the bottom left-hand corner. 87654321 2 3 4 5 6 7 8 For a step by step tutorial of how to use, configure and setup DUnit you can read the English or Chinese versions of the tutorial.Initially, the testing code should look like this:unit ChessPiecesTests;interfaceuses   TestFrameWork;type  TPieceTest = class(TTestCase)  published    procedure SetPositionTest;  end;implementationuses  ChessPieces;{ TPieceTest }procedure TPieceTest.SetPositionTest;beginend;initialization  TestFramework.RegisterTest(TPieceTest.Suite);end.If you run that test, it will succeed since no checks are being performed within the SetPositionTest procedure. Each test is composed by one or more checks. I suggest adding the checks little by little. Every time you add a check, you should add business code to pass the corresponding test.Now, let’s make the test fail on purpose. For that, let’s add one check to the SetPositionTest procedure. procedure TPieceTest.SetPositionTest;begin  Check(True = False, '');end;True is never False. So, this test will fail. If it doesn’t fail, then something is wrong with you test harness. Fix it. You can remove this initial check once you run the test and it fails.Now, let’s add a real check to our test. Something like this:procedure TPieceTest.SetPositionTest;var  Piece: TPiece;begin  Piece:= TPiece.Create;  try    //Test trivial (normal) workflow    Check(Piece.SetPosition(4, 4) = True, '');  finally    Piece.Free;  end;end;If you run this test, you will get a compilation error! Yes, that’s right. You don’t have business code yet. You just have the test. This is what TDD is all about: test first, business code later. Get the point?To avoid the compilation error, we will code a separate unit (ChessPieces) and we will add it to the uses clause of our ChessPiecesTests unit. unit ChessPieces;interfacetype  TPiece = class  private  public    function SetPosition(aX, aY: Integer): Boolean;  end;implementation{ TPiece }function TPiece.SetPosition(aX, aY: Integer): Boolean;beginend;end.Run the test again and now the compilation error is gone. Nonetheless, the test fails, because the Piece.SetPosition(4, 4) evaluates to False. Let’s add the minimum business code possible to pass this test:function TPiece.SetPosition(aX, aY: Integer): Boolean;begin  Result:= True;end;This passes the test. What? Yes, this passes the test, right? OK, what now? Well, we keep adding new checks to the test and every time this happens, we need to add new business code in order to pass it. It is very important to add checks to test the boundaries of whatever we are trying to code. I think you are getting the point, so I will just add a bunch of checks at once:procedure TPieceTest.SetPositionTest;var  Piece: TPiece;begin  Piece:= TPiece.Create;  try    //Test trivial (normal) workflow    Check(Piece.SetPosition(4, 4) = True, '');    //Tests boundaries    Check(Piece.SetPosition(1, 1) = True, '');    Check(Piece.SetPosition(1, 8) = True, '');    Check(Piece.SetPosition(8, 1) = True, '');    Check(Piece.SetPosition(8, 8) = True, '');    //Test beyond the boundaries    Check(Piece.SetPosition(3, 15) = False, '');    Check(Piece.SetPosition(3, -15) = False, '');    Check(Piece.SetPosition(15, 3) = False, '');    Check(Piece.SetPosition(15, 15) = False, '');    Check(Piece.SetPosition(15, -15) = False, '');    Check(Piece.SetPosition(-15, 3) = False, '');    Check(Piece.SetPosition(-15, 15) = False, '');    Check(Piece.SetPosition(-15, -15) = False, '');  finally    Piece.Free;end;The test above is even checking for the attempts of positioning a piece outside the chess board.To pass that test let’s write some business code:function TPiece.SetPosition(aX, aY: Integer): Boolean;begin  Result:= True;  if (aY < 1) or (aY > 8) then Result:= False  else if (aX < 1) or (aX > 8) then Result:= False;end;Run the test and see how it passes. The code above could be refactored or even rewritten. The tests will remain the same, allowing us to catch any bugs introduced with the code change.For instance, we could write the procedure above as follows:function TPiece.SetPosition(aX, aY: Integer): Boolean;begin  Result:= (aX > 0) and           (aX < 9) and            (aY > 0) and           (aY < 9);end;Run the test, and it will tell you if this refactoring (or reimplementation) works ok. It’s important to note that a good test should cover all possible scenarios and workflows. Pay special attention to the boundaries. At this point, a good understanding of the requisites is indispensable. Finally, more and more tests will be needed in a real world application. Each test will have its own checks. Each test will cover one piece of the functionality: this is what unit testing is intended for.I wrote a second article about TDD, code refactoring and design patterns in Delphi (click here). I would appreciate any comments you could provide about it.For further reading I recommend you Test Driven Development: By Example by Kent Beck. Check it out just below:CodeProject
Read More

Delphi/ C++Builder XE2 Update #4 issues

On Wednesday, February 29th 2012, Update #4 for Delphi XE2 and C++Builder was released, see also http://cc.embarcadero.com/item/28758 for the new ISO (which unfortunately is only available for those who already registered XE2, and not for "new" users who need a first install). It is great that Embarcadero is still using a frequent update schema, especially for FireMonkey issues, so I always welcome these updates.
Read More

LiveBinding Expression Can Produce Side Effects

I’ve been looking for a simple LiveBinding example that would forever change the way we perceive LiveBindings, and I think I found it. But let me start with a little background.

I’ve been interested in LiveBindings since RAD Studio XE2 shipped. One obvious reason is that LiveBindings is important if you want to easily bind your FireMonkey controls to traditional Delphi DataSets. But there was something else, something that I had a hard time putting my finger on.

I had a conviction, one that I shared publicly, that LiveBindings represented a fundamentally different way of doing things, and that we, as developers, just needed to see some examples of this new usage. Once we did, I thought, we would collectively come to a new way of looking at LiveBindings. These examples, however, have been elusive.

I remember David Intersimone (David I) asking me, prior to my 24 Hours of Delphi broadcast, to show LiveBindings used in a new and different way. I would have loved to, but I had yet to see such an example. I even blogged about this last month (http://caryjensen.blogspot.com/2012/01/whats-your-favorite-livebindings.html), asking readers to submit their favorite LiveBinding example that would open our eyes to the new way of doing things.

The response to that blog was interested. First of all, not one reader submitted a LiveBinding example. What I did get were some thoughtful comments about the limitations of LiveBindings, and these were similar to comments that I heard following my 24 Hours of Delphi presentation, as well as after a talk I gave at the Software Development Event in the Netherlands this past December.

Of these comments, the most common was that LiveBindings simply provide us with another way of doing something we already do, but in a more complicated way. Once again, I really felt like this opinion simply reflected the fact that we had not yet seen LiveBindings used in that way that would redefine, in our minds, what LiveBindings can do and how they can be used.

I recently wrote a white paper for Embarcadero on LiveBindings for their RAD in Action series. While doing so I had the time to reflect extensively on LiveBindings, including their limitations as they currently stand in this first release.

It was after I submitted the first draft for review that the example I am going to show came to me. In his technical edit, Jim Tierney pointed out that I failed to recognize that LiveBinding expressions could invoke methods of objects accessible in the input or output expression scope. I don’t know why I overlooked this. He had mentioned this fact in one of his CodeRage 6 talks. I had simply forgotten. (And there is a trick. The method must uses parentheses, even if it has no parameters.)

As I re-wrote that particular section of the paper I had an inspiration. To be honest, this inspiration came at 2:00am in the morning, as inspirations often do. That pretty much ruined my night’s sleep, as I could not wait to try what I now imagined a LiveBinding doing.

Here is the basic concept, and then I will show you a simple application. LiveBindings can produce side effects. That’s it.

Sure, even this notion is not unique. I’ve seen several LiveBindings that assign a value to the ControlComponent’s target property (the output expression), and that property has caused side effects (side effects being one of a property’s magical features). But my idea, one that I had not seen before, was that you could invoke in your SourceComponent’s SourceExpression (the input expression) a method that could, as part of its execution, produce a side effect.

Here is my simple example for your consideration. Take a look at this form, which is available in the code sample that accompanies my LiveBinding white paper.

Notice the Button on this form, the one whose Caption reads Close. This button, and another on another TabSheet of the PageControl, are associated with an ActionItem. This ActionItem has associated with it a BindExpression LiveBinding, which is a managed LiveBinding. Since it is a managed LiveBinding, there must be some code that triggers the expression engine to evaluate the LiveBinding expressions, and here is that code, associated with the ActionItem’s OnExecute event handler.
procedure TForm1.Value1EditChange(Sender: TObject);
begin
BindingsList1.Notify(Sender, '');
end;

Let’s now look at the Object Inspector, which shows the properties of the BindExpression LiveBinding.

The ControlComponent and the SourceComponent properties are both set to the ActionItem. The ControlExpression (the output expression) is Caption, a property of the ActionItem. The magic occurs in the input expression (SourceExpression). In this expression is a method invocation, which I’ve associated with the form (the ActionItem’s owner). This method, OpenCDS, produces a side effect, the opening and closing of a ClientDataSet, as you can see in the following implementation.

function TForm1.OpenCDS(Open: Boolean): string;
begin
if Open then
begin
ClientDataSet1.Open;
ClientDataSet1.LogChanges := False;
exit('Close');
end
else
begin

ClientDataSet1.SaveToFile;
ClientDataSet1.Close;
exit('Open');
end;
end
;

As you can see, when the user clicks the button, the expression engine is notified to evaluate the LiveBindings associated with Sender, which is the ActionItem in this case. The SourceExpression calls the OpenCDS method, which returns a new value for the Caption property of the ActionItem. This, in turn, causes the two buttons that are using this action to likewise adopt the caption. It also performs the rather simple side effect of closing or opening the ClientDataSet. However, there are really very few limits to the side effects that could have been implemented.

I am sure that more than a few people will be thinking to themselves that this is just another example of a LiveBinding that does something we can already do (open and close a ClientDataSet). For example, couldn’t we have simply used the following OnExecute event handler?

procedure TForm1.Value1EditChange(Sender: TObject);
begin
if
TActionItem(Sender).Caption = 'Open' then
begin
ClientDataSet1.Open;
ClientDataSet1.LogChanges := False;
TActionItem(Sender).Caption := 'Close';
end
else
begin

ClientDataSet1.SaveToFile;
ClientDataSet1.Close;
TActionItem(Sender).Caption := 'Open';
end;
end
;

My response to has three parts. First, the second event handler, the one that explicitly opens and closes the ClientDataSet, needs to have intimate knowledge of what operation has to be performed. By comparison, the first event handler simply notifies the expression engine that something about the Sender has changed. The first event handler has no details about the change, nor does it specify what should happen in response. The expression engine does the actual assignment based on the LiveBinding, and the LiveBinding, not code, defines what happens.

Second, not all LiveBindings require that you notify the expression engine. Many of RAD Studio’s LiveBindings, including Lists and Links, require no event handlers at all.
Third, for those LiveBindings that do require an event handler, all of them could potentially refer to this one, simple event handler, the one that calls the Notify method of the BindingsList. As a result, a form that uses LiveBindings to perform its various tasks may have zero or just one event handler. By comparison, if you performed those tasks using code, there would have to be many different event handlers, each one invoking its specific task and requiring specific knowledge about the operation they were designed to produce.

Basically what I am getting at is that this usage of a LiveBinding is profoundly different than normal event handler usage. The OnAction event handler is completely agnostic, as far as the operation that will result from its invocation. All of the behavior is defined declaratively in the LiveBinding, along with the actions defined in any methods that are invoked during the evaluation of the SourceExpression. What’s even more exciting is that in the future this type of effect might be achieved without any event handlers at all.

But please do not get me wrong. I am not advocating that we should start replacing traditional event handlers with LiveBindings. That would be completely missing the point. LiveBindings have their place, and event handlers have their place as well.

Successful use of LiveBindings requires us to look at our goals from a different perspective. LiveBindings can do things that really don’t fit into the event-driven model of traditional event handlers. Sure, in this version of RAD Studio they are somewhat limited, but that will change over time.

I have one final comment. Earlier in this posting I noted that invoking a method that produces side effects from a LiveBinding expression is similar to the power of side effects produced by property accessor methods. Actually, these two techniques are more closely related than you might think. When designing a new class, you might actually implement a side effect in a property accessor method, and a LiveBinding could then produce that side effect as a result of its assignment of data to the associated property.

On the other hand, side effects produced by property accessor methods are often associated with keeping the internals of that component consistent. By comparison, the types of side effects that you can introduce in methods invoked through LiveBindings can have a much more global impact, keeping many elements of a form, or an entire application, synchronized.

The white paper is available from Embarcadero’s Web site at http://edn.embarcadero.com/article/42076.

I am also giving a Webinar on LiveBindings in the RAD in Action series on March 14th. You can learn more about this Webinar at http://www.embarcadero.com/rad-in-action/livebindings.

I am also doing a session on LiveBindings during my Delphi Developer Days 2012 tour with Marco Cantù. Learn more at http://DelphiDeveloperDays.com.

Read More

Read More

Delphi turns 17 and my Delphi XE2 iOS Development PDF is released

First of all, congratulations to Delphi for her 17th birthday - I still remember the release back in 1995 - and my love for Delphi also came back in the names of my kids: Erik Mark Pascal (also 17, almost 18), and Natasha Louise Delphine (15). And now for the news from me: yesterday I held my Delphi XE2 iOS Development seminar in The Netherlands (for about 75 developers), and today I've released the first edition of my Delphi XE2 iOS Development courseware manual in PDF format.
Read More

Flotsam and Jetsam #55

Marco notes that Embarcadero has put out a press release announcing a 54% increase in revenue in 2011 over 2010.  This is unequivocal, clear, unassailable good news.  No amount of Chicken Little whining will take away from the fact that this is very, very good news.  (It didn’t take long for Marco’s commenters and the Nattering Nabobs of Negativity in the non-tech newsgroups to try to find a way to make this something other than great news.)  The most important thing that the EMBT Executives care about is the bottom line – and that is how it should be.  And the bottom line for Delphi apparently looks pretty darn good – good enough for them to brag about it.  When the bottom line of Delphi looks good, that is good for Delphi developers.  Hey, I noticed that I’ve gone over 1000 comments here on my blog (actually it’s more like 3000  if you count spam that I’ve deleted.….).  Thanks to everyone who posts comments.  I appreciate you reading this stuff I write, especially when you go to the trouble of writing something up and adding to the conversation.  Lately some of the discussions on my technical posts have been really good – I’m grateful. I am not myself able to go this year, but I’m quite happy that three of my team here at Gateway Ticketing will be attending Delphi Developer Days this April in Baltimore/Washington, DC.  I was there last year, and I can tell you that it was a really valuable experience, and I recommend that you attend this year if you can. Jason Southwell’s ApeSuite for FireMonkey has a new beta out with a bunch of new features. More FireMonkey components are now coming from TMS Software as well – they have a cool set of instrumentation components as well as a TableView control that will be popular for folks writing mobile apps in particular. And Even More FireMonkey: As previously noted, I haven’t played with FireMonkey  much, but I have to confess, it is cool to think that this demo app – as described by Anders Ohlsson in his EDN article – is written in Delphi and will run on the Mac (and even iOS I guess…?) as well as on Windows.  Pretty slick.  And while you are at it, check this one out as well.
Read More

…Wherein I Rant Vigorously About Mobile Twitter Clients

I am now going to go on a rant about Twitter clients – mobile Twitter clients in particular (though some desktop clients are rant-worthy as well).  I am going to do this because I can’t understand why they are such a pain in the ass and work so badly, when they could so easily work so well. Okay, first, don’t get me wrong.  I really like Twitter.  (If you want, you can follow me, I’m @nickhodges --  no surprise in that handle, eh?)  I like it because it’s a great place to keep up on news, find interesting articles, read funny stuff, and to post your thoughts in short, pithy statements of 140 characters or less.  It’s also a great time killer.  If you are waiting at the doctors office, it’s a much better way to pass the wait than looking at a two and a half year old copy of People Magazine.  It’s interesting, fun, never the same thing twice, and frankly, I’m a little addicted.  I do almost all of my twitter reading on my phone or on my wonderful Amazon Kindle .  But yet reading Twitter on my mobile devices drives. me. crazy.  When it comes to mobile Twitter clients, I’m not addicted -- I’m inflamed with a rage that burns like the heat of a thousand suns. I’ve tried just about every one out there. They all drive me insane.  And so here is  my rant: A twitter client should never, ever, ever, under any circumstances, for any reason, at any time, ever, ever, EVER move my “cursor”.  EVER. And by “cursor” I mean my location in my Twitter stream.  I determine where my cursor goes, not you, you blasted twitter client that thinks you can just show me whatever you want when you want to.  If I am reading Twitter on my phone, leave off on a funny Pauly Peligroso post, go away to another app, and then I come back, you darn well better have my twitter client looking right at that same stinking Pauly Peligroso post when I come back.  I don’t care if I’ve been gone for five minutes, five hours or five years, you flipping better have your cursor right there where I Ieft it. Not anywhere else.  Where. I. left. it.  Leave a gap if you have to. I don’t care, just leave it. Don’t try to do me a favor and “catch me up”.  If I need catching up, I’ll get myself caught up. Give me an option to get caught up, fine.  But for the love of Adam Sandler, DON’T MOVE MY POSITION IN MY TWITTER STREAM.   Ever,  ever, ever, never, ever, ever.  Second, if you tell me that there are “143 new tweets”, and I say “Great, some new tweets”, put me at the freaking START of the 143 new tweets, not at the current time!!!!   Why in the name of sweet baby Dick Van Dyke would I ever, ever, ever what to start at the most recent tweet out of those 143 new tweets? Why would you tell me that there are 143 new tweets and then start me out at the point where there are zero new tweets? Why do I open up the fracking client and see some tweet from three seconds ago, when I want to read the 143 new tweets?  Why do I have to manually scroll down and try to figure out where the new tweets start?  What is that, some kind of sick, twisted joke?  Really?  I have to scroll?  Seriously?   I mean this is basically a variation of the “Never move my cursor spot”, but come on, this is ridiculous. Third – stop trying to shorten my shortened URL’s.  I’m smart – I can shorten my URL’s myself.  It’s nice you want to do that for me, but at least let me opt out of it.  Nothing says “wasted time and resources” as a link that is a Twitter shortened version of a bit.ly link that started out as a tinyurl.com link.  I mean, come on, I can keep my twitter posts under 140 characters myself.  I don’t want your help.  I don’t need your help.  Stop it. Bottom line: Mobile twitter clients stink and they make me want to bash public monuments with a sledgehammer. (I’d never do that, really, but I want to when I go back from checking my mail and the stupid TweetCaster moves me to  a tweet that was posted 23 seconds ago.) Phew, okay, I feel better now.
Read More

Flotsam and Jetsam #54

I like FireMonkey.  Actually, I confess that I don’t know much at all about FireMonkey, but I like that it exists.  I don’t use it, but I like that it is there, broadening the appeal of Delphi and generally advancing the cause of the tool we all love so well.  So I was pleased to see that the nascent market for third-party FireMonkey controls continues to grow.  The latest offering is from Jason Southwell’s Arcana with the cleverly named “ApeSuite”.  ApeSuite is in beta, but you can get in early at a special price.  Jason has been updating the library pretty regularly. I’m glad to see people getting a good start on what will hopefully be a thriving marketplace, and I tip my cap to Jason for jumping in. Alex Ciobanu – formerly of the Delphi RTL/VCL team – has made a few changes to his outstanding open source offerings.  First, his DeHL project has been discontinued.  I’m sorry to hear that – there are some really interesting things in there.   But second, he has done a brilliant job with a new project that is, to a certain degree,  a replacement, Delphi Collections.    He says it is “on hold” but it appears that he is actively working on moving it forward.  Alex is a really, really good programmer, so I keep a close eye on what he is up to.  His contributions to the Delphi community are very large, and I’m very appreciative of what he does.  Lots to learn there. How to Get Your Comments Deleted:  This is my blog, and what ends up on on it is up to me.  I’ve noticed that some of you have been trying really hard, though, to get your comments deleted with a modicum of success – and I’ve been helping to make sure that you succeed in this endeavor when appropriate.  I thought that you all might want to know for sure how to get your comments deleted.  The best way is to be a jerk and write a content free but insulting comment that adds no value whatsoever.  Do that, and you’ll get your comment deleted.  Hope that helps. Eric Grange pointed out that there has been a marked uptick in activity on open source projects involving Pascal.  It’s nice to see numbers attached to something that I’ve kind of felt to be the case.  The addition of generics and anonymous methods to Delphi really opened the language up to some really cool and really powerful frameworks, and things like Alex’s code above, the Spring Framework, Delphi Mocks, and all kinds of other frameworks.  It’s a really good time to be a Delphi developer.  (And Ohloh is a pretty interesting site – worth poking around.) What and how things are named in our code is a really important part of being a good developer. That’s why I thought this post was interesting – “Interface naming: prefix 'Can-' vs suffix '-Able'”    We tend to create interface names with –able (ISerializable, IDisposable, IEatable, whatever….) and maybe that isn’t always the best convention?
Read More

EurekaLog and FireMonkey / Win64 / OSX

Clarification about EurekaLog and latest Delphi versions... Delphi XE2 has introduced a new visual framework - FireMonkey, as well as support for more platforms, including Win64 and OSX. There are constant income of questions about EurekaLog's future and possible support for these new technlogies. So I've decided to publish general explanation for everyone. EurekaLog and FireMonkey The answer is simple - EurekaLog will... never support FireMonkey, because there is nothing to support! FireMonkey is visual framework. But EurekaLog just don't use any visual frameworks - it don't use VCL and it certainly don't need to use FireMonkey. EurekaLog uses API for all visual UI. That's why you already can use EurekaLog with both VCL and FireMonkey applications. Of course, if you want to create your own custom error dialogs for EurekaLog or something like that - fine, use API, VCL, FireMonkey or whatever technology else. There is no limitations. However, EurekaLog is not related to VCL or FireMonkey. It's just exception tracer. EurekaLog and Win64 Sorry, but EurekaLog 6 will never support Win64. It was written without considering other platforms in mind. However, there are good news: EurekaLog 7 will support Win64. Right now we're working on it, even though it dind't appear in any public releases. Support for Win64 is our current top priority! It's expected that Win64 support will be released (as beta) after we ship stable release of EurekaLog 7. You can help this to happen sooner by testing EurekaLog. Preleminary estimate is that Win64 support will be basic for first few releases and then we'll add advanced features (like disassembler view). Another good news is that we want to make migration process as painless as possible. Ideally you should be able to install EurekaLog 7, open your old project, recompile it - and it should work. EurekaLog and OSX The case with OSX support is very similar to Win64. EurekaLog 6 is out of question, but support for OSX is planned for EurekaLog 7. This is our second top-priority. We want to finish Win64 first and then start going for OSX. Currently, there was no work done for OSX, but all current work is done with future OSX target in mind. EurekaLog and... Lazarus/MSVS C++ Yes, there is slight possibility for appearing EurekaLog for other IDEs like Lazarus or Microsoft Visual Studio (C++). However, currently this is considered as low-priority in far-far away future. Note: this information is highly preliminary and is suject to change. Also, there is no estimates available.
Read More

What’s Your Favorite LiveBindings Example?

LiveBindings, which were introduced in Delphi XE2, provide developers with new options for associating objects. And they are only one of a wealth of new features introduced in this groundbreaking version of Delphi. They are also a source of some confusion. One of the problems is that most of the demonstrations of LiveBindings are simple, in part because LiveBindings are so new. Another way to put this is that it's hard to think differently about object binding when we are so familiar with Delphi's existing mechanisms. As a result, most examples that I've seen so far duplicate much of what we already achieve in Delphi.But this is bound to change. I believe that once we start to see creative applications of LiveBindings, we, the collective Delphi community, will begin to think about them differently. I hope to jump start this process by collecting examples of LiveBindings that represent the way that we'll be using them in the future, and I'll publish these here. Of course, I'll give credit if you contribute so that you can bask in the gratitude of your fellow Delphi developers.So, here is my question. Do you have examples of LiveBindings that go beyond the obvious? Alternatively, have you seen an example that breaks the mold? Is so, please share. And, in case you haven't given much thought to LiveBindings, here is a short introduction.LiveBindingsLiveBindings is a general term for Delphi's new object/property binding mechanism first introduced in RAD Studio XE2. It is the only binding mechanism available to the new FireMonkey cross-platform component library (FMX), and is also available for traditional visual component library (VCL) components.At its core, LiveBindings is a mechanism for creating associations between objects and expressions. Expressions are strings that are evaluated by Delphi's new expression engine, and in the case of LiveBindings, they define what effect the expression will have on an object.While expressions are strings, they are evaluated by the expression engine at runtime, which is quite a bit different than your Delphi code, which is compiled by Delphi's compiler at compile time. As a result, expressions are different from other string types you normally encounter in Delphi code. For one thing, expression strings can define literal values using either single quotes or double quotes. In addition, the expression engine recognizes special methods that have been registered with it through Delphi's Open Tools API (OTA), and can employ custom output converters to transform data from one type to another. Another concept critical to LiveBindings is scope. In LiveBindings terminology, scope defines what is visible to the expression engine. Most LiveBindings require a control component (the object to which the expression will be applied), and in most cases a source component as well. In the case of these LiveBindings components, the control and source components are both in scope, making their properties available to the expression engine. Similarly, those custom methods that have been registered with Delphi from a design time package are also in scope, making those methods callable from your expressions.It's worth noting that while LiveBindings use expressions, expressions can be used without LiveBindings. Specifically, you can create a scope programmatically, adding to it the objects and methods you want the expression engine to evaluate, and then ask the expression engine to perform the evaluation, returning a value based on the expression string. It's an important point, as far as the expression engine is concerned, but not something that you necessarily need to think about when you are using the LiveBindings components.Do We Need LiveBindings?I recently spoke about LiveBindings during the "24 Hours of Delphi" broadcast with David Intersimone. One of the listeners asked a question about LiveBindings that I hear pretty often, though he gave a somewhat new twist. "Why do we need LiveBindings?" he asked. "After all, it appears that LiveBindings is just another way of doing what we already do using event handlers. It kind of seems like fishing poles. In older days we had cane fishing poles, and they worked just fine. The new fiberglass and graphite rods are nice, but they don't really do more than the old rods."I like the analogy a lot, because it actually highlights why LiveBindings are a positive thing. Let's take the fishing pole example. A recent television show on The History Channel called "101 Gadgets that Have Changed the World," the publishers of the magazine Popular Mechanics list the top 101 devices that have had a dramatic impact on our daily lives. And, guess what, fiberglass fishing poles made the list (at 100), beating out duct tape and being edged out by the stapler.In any case, the point is that while cane poles and fiberglass fishing rods perform the same task, they work differently, and fiberglass rods are functionally better on every level.I think we are going to be saying the same thing about LiveBindings, once we get our heads around them. Yes, you can do many things with LiveBindings that can be achieved without them, but as we get more familiar with their capabilities, I believe we will discover a whole range of features that are enabled only through LiveBindings.So, let me hear from you. Post a link to your example, or an example that you find on the Web, as a comment to this posting.
Read More

Free Delphi XE2 “Game of Memory” for iPhone available in AppStore

My first iPhone app (the "Game of Memory" written with Delphi XE2 and FireMonkey) is now available in the AppStore (for free), see http://itunes.apple.com/us/app/game-of-memory/id489076335?ls=1&mt=8 It was quite a journey from "start" to actual AppStore deployment, but fortunately, I now know all the steps, so from now on it will hopefully be easier (although probably not faster).
Read More