Migration from Delphi BDE - IBO or FIBPlus? - delphi

I would like to know the better alternatives to the Delphi BDE. We have this huge application using Firebird 1.5 and BDE, and would like to consider the following alternatives:
IBObjects
FIBPlus
The migration will involve conversion to Firebird 2.5 dialect 3.
Can I get your ideas on which one is better? Your input is highly appreciated.
Thank you.

I have never used IBObjects because I was quite happy with FibPlus. FibPlus datasets support interesting "separate transactions" feature that makes possible to write applications which are very similar to BDE applications but at the same time use Firebird transactions more effectively and support other Firebird specific features. I have written some beginner's notes about using FibPlus that may be helpful as a starting point.

Both components are very good. Migrating from BDE will be easier with IBO, because it has components with the same property and methods names used in the "BDE" ones, and you can use the GReplace utility to change all the declarations from "BDE" to "IBO", ie: TQuery to TIBOQuery, etc. Check more info at http://www.ibobjects.com/ibo_help/convertbdetoibo.htm
Anyway, you should understand how IBO works to fine tune your application after the conversion.
It would be easier to migrate to FIBPlus if your app was using IBX instead of BDE.

Related

Migrating old Delphi 7 code to Delphi XE - unicode really needed?

I have an old application running BDE under Delphi 7, and have now bought Delphi XE. I see a lot of people say the main problem migrating the code is changing to unicode. And possibly a database supporting unicode.
But, do I really have to do this? Can I not just stick to BDE and some "good old string format"?
I am hoping to get away with a quick swap to Delphi Xe here, not necesarily using all new features etc etc....
Rgds PM
The data fields that connect your data to the database didn't change. A TStringField still has a Value property of type AnsiString, which matches the old behaviour.
When you inspect all the warnings the compiler will spit out, you might come away with little effort and keep the BDE alive.
Besides that I suggest replacing the BDE with a more recent solution in the foreseeable future - not only because of Unicode.
It's pretty hard to avoid using the new UnicodeString which is what string is now aliased to. You can write all your code with AnsiString if you wish, but why bother? As soon as you use any non-trivial library (e.g. RTL, VCL, third-party) you are swimming against the tide. If you do attempt to continue with AnsiString you'll actually make life more difficult for yourself in my view.
If you give it a go you should find that it's not that big a job to move to the new Unicode string type. The vast majority of existing code will work unchanged.
I made the same move from D7 to XE and the change was a killer. My app, like yours includes a database - in my case its Interbase and the Interbase Express components that are part of Delphi. I made the choice to move to Unicode, but it wasn't pretty.
I read the papers, but compared to my experience they seemed incomplete or maybe even incorrect on some points. I think the papers are written from the point of view of a Delphi application with no database. I believe there were critical errors in Interbase Express (Delphi) and in Interbase. I think at least one bug has been fixed in IB and a couple in Delphi - if you move to the XE version. (I don't want to consider going through that again right now).
I wound up adding fixer-uppers in my code to help Delphi out. On the newsgroups and in QC people told me I didn't understand. Well finally, there are changes coming that fix those problems so there must really be issues there someplace.
The conflicting views expressed in this thread indicate the confusion with Unicode. On some of those issues I don't know how it would work, even having gone through it. But, I have doubts about getting through it at all and holding onto the BDE. That could well have built-in issues that will not be fixed, and which you can't deal with. There are some entries in QC you can check to see some of the outstanding issues.
When my application was in D7 my IB database was ansi. When first converted to Delpi XE, it seemed to run ok - although that was only a brief check. IB supports Unicode and I converted my data there. Would you / could you do that with your data? Only after that did I find the problems. I think any meaningful conversion to Unicode means you first convert your data storage to Unicode, then your Delphi app.
So after all that, why are you moving to XE if you don't want unicode? Is it just to upgrade or is there something you are trying to accomplish? I hope this long post helps.
We also have many applications running BDE with Delphi-7 and are considering the jump to DelphiXE. The jump is not nice...if you want your program to run in Windows7 64 bit, you will need to convert the BDE or download BDE express or another tool. BDE has memory leak issues so we have converted those components, but will remain in Delphi-7 for older products and use Delphi XE for new projects.
Good Luck.

Firebird: DBExpress or native components?

I am starting with Firebird and have found components to access a database by Devart.
They offer native components (IBDAC) or DBExpress drivers. (I am using Delphi XE2 Pro which doesn't include Firebird drivers)
I guess native components are a bit faster, but that's not too important for me.
What are the advantages/disadvantages of each approach and why should I choose one over the other?
Check Anydac. It is universal data access library, but supports most of Firebird specific features including - multiple transactions, database events, services (backup/restore), etc. The performance is very good. Sorry, i cannot imagine dbExpress advantages over Anydac.
IBdac
your application is tied to firebird
you are familiar with bde or ado
performance
maximal Firebird support
DBexpress
portability (it is easy to port you application to anther database).
upgrade pro edition to enterprise so you can use one supplied by
embarcadero.
You can check Devart FAQ.
FIBPlus and UIB are also good choice
Native components can support database specific functions. I've missed event support with DBExpress when using 3rd party driver from Upscene.
DBExpress should make it easier to create database agnostic application, but I've no experience about that.
ZEOSlib might be a nice alternative, actively developed and supporting many databases including Firebird.

Is there any document for Delphi+Firebird from the very beginning (Server Side)

I want to code a server side software with Delphi+Firebird but i need a documentation (or tutorial) that explains all the steps and components from the beginning. Is there any site/tutorial/document that you can suggest? which explains step by step coding.
Even if you suggest a component to make server side connection with regard to your experiences, i will be glad.
Thanks.
The main English information source for Firebird is IBPhoenix.
The main Russian information source for Firebird is IBase.
The Firebird FAQ gives a list of Delphi connectivity options and answers on many other Firebird questions.
It will be hard to pass along IBExpert. There you will find useful tools and Firebird articles.
Actually Firebird is a fork from Interbase, yes Interbase had become an open source some time ago and then become closed source again. So, u can use Interbase as a reference. But as time goes, Firebird become better and better in quality. Also become different from Interbase itself. To get more info on Firebird, u can visit www.ibphoenix.com.
For the components to connect Firebird, u can use FIBPlus, UIB, anyDac, UNIDAC and many more. The one u must avoid is IBX itself, Jeff Overcash has state that IBX is NEVER tested against Firebird and WILL NOT TESTED agains Firebird. They see Firebird as competitor actually.
I use Firebird daily and it never fails (except if your HDD broken).
Documentation is a weak side of Firebird server. We usually use a combination of:
Interbase documentation
Firebird release notes
Information from Firebird forums
Helen Borrie's Firebird book
Delphi uses pretty unified technology to talk to any server be it Firebird or not. So, there is just enough information you could find in a help or in available books.

Quality of Sybase ASE support in Delphi

I have Delphi Professional 2007 and 2009 and was thinking of upgrading either or both to Enterprise due to a new project that requires me to interface to a Sybase ASE database.
I did some research and it appears that 2007 Sybase driver leaked memory and it doesn't appear that this problem was fixed.
Does anyone know if the Codegear Enterprise drivers for Sybase ASE are reliable and do any alternatives exist?
The BDE had some huge shortcomings and it seems that a lot of those were brought right into DBExpress. Some of these include:
No suport for multiple result sets
No way to get your hands on server messages that are not errors
No control over where the cursors are located
No support for async calls (where you use ct_poll)
My advice would be to write your own (simpler than it sounds) or to use ADO. ADO exposes a lot of ASE's functionality and the performance is very good.
Have you looked at NativeDB? The website might be a little off-putting, but I have a legacy D5 app that connects to ASA using their tools. At some point in the next month or two I'm going to have to buy an upgrade so that I have their latest D2007 driver, because I need to move that legacy app to D2007.
It works well (and it's damn fast) with ASA - I don't know about ASE but it might be worth a quick email asking them, or downloading a trial component. It's not that expensive for what it does, either.

Delphi code generation

I need to speed up my coding, too much work, so I need be able to generate code.
Any tools, any ideas?
Delphi includes Live Templates, a completely scriptable and configurable system for generating code constructs of any size or complexity.
Live Templates are, in my view, one of the more under-appreciated features in Delphi.
Find out how to use them at: http://delphi.wikia.com/wiki/Delphi_Live_Templates
and
http://delphi.wikia.com/wiki/Live_Templates_Technical_Info
Live templates are completely scriptable, meaning you can write Delphi code to do whatever you want with them.
An extendable example can be found here:
http://cc.codegear.com/Item/26420
Not a very good idea IMHO. If you need generator, then probably you have lots of code that looks very similar, so instead of generator, better thing would be to rethink and refactor code you have.
That should result in less code that is easier to maintain and less code in future for similar tasks.
If you are doing database application, then you could use some good visual SQL query builder to help you create queries. That is part that Delphi was not very good (I don't know if it improved in D2007 and D2009)
EDIT - Regarding SQL generation
There's lots of comments about query builder.
Well, I suppose I'm spoiled. As I remember, Delphi before version 6 (or maybe even 5?), had decent visual query builder. I had 0 (zero) bugs in SQL when I selected fields in query designer, opposed to writing SQL by myself.
SQL is just string in Delphi, there is no compiler checking, so this was the best way to ensure that SQL is correctly written.
If you mean something like a modeling tool, you could try out ModelMaker.
Rather than trying to code generate, you should probably just obtain code to do the bulk of what you want to do.
There are hundreds of free products at Sourceforge for Delphi.
And there are hundreds of thousands of code samples at Google Code Search that you can use.
Plus lots thousands of free or purchaseable components at repositories such as Torry's Delphi Pages or Embarcadero's Code Central for Delphi
Using components already made is the fastest way to speed up your coding, and to add capabilities that you would never have been able to.
For me best way is by creating custom components, and then create designer for this component.
I have find that i spent most of the time writing code that read/write values from controls. So i created control that can read, write, validate values, and automatically fill form or stored procedure or directly generate SQL and execute.
Custom designer allows you to setup all properties easy. Now i don't write code for such trivial task i just put control , open designer and set properties and rules that must be satisfied.
ModelMaker Code Explorer speed up my coding in times. It has a nice hotkeys for synchronising implementation and declaration, so if you changed one, you don't have to search for it pair. Also, very nice feature is, method editing dialog. And many more.
Have you tried GExpert? It is a set of tools built to increase the productivity of Delphi and C++Builder programmers by adding several features to the IDE. GExperts is developed as Open Source software.
Other alternative is using project template by saving a framework into the IDE Repository, create your own components and frames.
I wrote a code generator calle CodeTypo. I'm used it in many production environment. You can find it here: http://dade2000.altervista.org/index.php?page=CodeTypo
It's still in beta phase but is usable and reasonably stable.
I'll migrate all content of this old site in the new one (www.danieleteti.it) in english. And I'll add some other info about CodeTypo and code generators.
The thing that sped up my Delphi coding the most was getting CodeRush for Delphi (via a DevExpress VCL subscription for Delphi 5, 6, 7) and setting up a ton of templates.

Resources