Suggestion: remove drivers from ZConnection.pas and move to other unit

ssamayoa writes “A few days ago I began to test Zeos because I like the idea to make single applications which targets diferent dabatase servers, in my case Im interested on supporting Firebird, Oracle and MS SQL Server.


What I notice from the begining is the big size of EXE file. It is comprensible since all Zeos database drivers are linked because all driver units are referenced in ZConnection and each one has initialization code which instantiates the driver.

I saw some conditional compilation in the uses clause of the latest (from CVS) ZConnection.pas. Is a big step forward but still requiered compilation of part of Zeos to add or remove any driver from the EXE linking.

I think that ZConnection.pas shouldnt have in uses clauses any of the specific driver (PostgreSQL, Interbase and so), it should be moved to ZComponentReg.pas or new unit which must be added to ZComponents.dpk. With this change the compiled BPL used will have all drivers. The conditional compilation can be left on such unit allowing the developer the customization of ZComponent package.

Then, if the developer wants some drivers to be linked with his/her EXE, he/she just need add the desired driver’s unit to any of their own units.

What do you think?

Regards.

This entry was posted in Code Hacks. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *