Archive for the ‘LiveBindings’ Category

Storing your Objects in a Database

I’ve just begun a series of posts and accompanying videos over at the Code Partners site on using an Object Relational Mapper in Delphi. It starts out simple but over the series I want to delve into exercising more control of how objects are loaded and stored to optimise performance and other requirements. I’m using TMS Aurelius but the concept should apply to any ORM worth its salt.

The first two posts are up, and you can start here.

MVVM and MenialTasks : Why did I use TEnumerableBindSourceAdapter instead of TListBindSourceAdapter?

In the comments over on my old MVVM Resource List post Peter Rosario asked a great question. A question I thought I’d covered in my video but I suspect I might have edited it out in an attempt to fit into the CodeRage time limits. So I thought I’d answer it here.

The question was about my MenialTasks sample app, and why I’d used TEnumerableBindSourceAdapter to bind my collection of TTasks to the UI, rather than the more common TListBindSourceAdapter.

TListBindSourceAdapter has a lot going for it. It comes “in the box”, would certainly have been easier, and would work just fine. Given that, why didn’t I use it? Read On…

LiveBindings : How to treat an Integer field as a Boolean?

I had a question recently from someone, and it seemed a common enough requirement that I thought the solution might be worth sharing.

Let’s say you’ve got a database that has an Integer column which is really used as a Boolean. Zero for False, One for True. Further, for whatever reason, you can’t change the DB structure. How do you display this column to the end user as a boolean, so that they can use a Checkbox column in a grid, a TSwitch control, or similar to edit it? Read On…

An Introduction to Model-View-ViewModel (MVVM) in Delphi

CodeRage 7 is on next week and I’ll be doing a session introducing MVVM and how to implement it in Delphi. If you’re not aware of MVVM, it’s a Presentation Pattern, a way to structure your applications so that you maximize the amount of code in your app that can be unit tested (including your form logic) while at the same time, simplifying the task of swapping out different UI’s in front of your app (eg. to have different forms for different platforms or devices). It leverages Data Binding, in my case, LiveBindings in XE3.

I have a series of deeper dive articles planned on different areas of MVVM in Delphi, and this session will serve as the starting point.

Session details are here.