There is a well known syndrome around, against ORM.
Do you remember The Vietnam of Computer Science article?
It is worth reading... and commenting.
Sounds a bit outdated by now. Tempus fugit!
2011-07-02
2011-07-02. Open Source › mORMot Framework
There is a well known syndrome around, against ORM.
Do you remember The Vietnam of Computer Science article?
It is worth reading... and commenting.
Sounds a bit outdated by now. Tempus fugit!
2011-07-02. Open Source › mORMot Framework
For both our SynOleDB and SynBigTable units, we allow late-binding of data row values, using a variant and direct named access of properties. Thanks to this unique feature (as far as I know in the Delphi database world),
This allows clear and valid code as such:
var Customer: Variant;
begin
with Props.Execute(
'select * from Sales.Customer where AccountNumber like ?',
['AW000001%'],@Customer) do
while Step do
assert(Copy(Customer.AccountNumber,1,8)='AW000001');
end;
In practice, this code is slower than using a standard property based access, like this:
while Step do
assert(Copy(Column['AccountNumber'],1,8)='AW000001');
But the first version, using late-binding of column name, just sounds more natural.
Of course, since it's late-binding, we are not able to let the compiler check at compile time for the column name. If the column name in the source code is wrong, an error will be triggered at runtime only. But it would not be an issue, since it would be the same for the SQL code inserted: it's only executed at runtime (this is one of the benefits of using an ORM, by the way: the ORM will generate correct SQL code for you...).
The default VCL implementation of this late-binding was a bit slow
for our purpose.
Since it has to deal with Ole Automation, and because it's fun, we
hacked the VCL to provide a lighter and faster version for our custom variant
types.
2011-07-01
2011-07-01. Open Source › mORMot Framework
That's it, our SynOleDB unit seems alive and running well.
OLE DB (Object Linking and Embedding, Database, sometimes written as OLEDB or OLE-DB) is an API designed by Microsoft for accessing data from a variety of sources in a uniform manner. It was designed as a higher-level replacement for, and successor to, ODBC, extending its feature set to support a wider variety of non-relational databases, such as object databases and spreadsheets that do not necessarily implement SQL.
SynOleDB unit implementation has been made with several points in
mind:
TOleDBConnection per thread); TDynArrayHashed);TQuery-like wrapper.2011-06-29
2011-06-29. Open Source › mORMot Framework
Our ORM framework has been released as version 1.14.
It's mainly a bug-fix release:
2011-06-16
2011-06-16. Pascal Programming
After a question on StackOverflow, I wanted to comment about the speed of generated code by diverse Delphi compiler versions.
Since performance matters when we write general purpose libraries like ours, we have some feedback to propose:
2011-06-07
2011-06-07. Pascal Programming
In order to let our TSynLog logging class intercept all
exceptions, we use the low-level global RtlUnwindProc pointer,
defined in System.pas.
Alas, under Delphi 5, this global RtlUnwindProc variable is not
existing. The code calls directly the RtlUnWind Windows API
function, with no hope of custom interception.
Two solutions could be envisaged:
Sytem.pas source code, adding the new
RtlUnwindProc variable, just like Delphi 7; The first solution is simple. Even if compiling System.pas is a
bit more difficult than compiling other units, we already made that for our
Enhanced
RTL units. But you'll have to change the whole build chain in order to
use your custom System.dcu instead of the default one. And some
third-party units (only available in .dcu form) may not like the
fast that the System.pas interface changed...
So we used the second solution: change the assembler code in the running
process memory, to let call our RtlUnwindProc variable instead of
the Windows API.
2011-06-07. Pascal Programming
For our ORM, we needed a class variable to be available for each
TSQLRecord class type.
This variable is used to store the properties of this class type, i.e. the
database Table properties (e.g. table and column names and types) associated
with a particular TSQLRecord class, from which all our ORM objects
inherit.
The class var statement was not enough for us:
- It's not available on earlier Delphi versions, and we try to have our
framework work with Delphi 6-7 up to XE;
- This class var instance will be shared by all classes inheriting
from the class where it is defined - and we need ONE instance PER class type,
not ONE instance for ALL
We needed to find another way to implement this class variable.
An unused VMT slot in the class type description was identified, then each class definition was patched in the process memory to contain our class variable.
2011-06-06
2011-06-06. Open Source › Synopse PDF engine
Our SynPdf unit has been refreshed to the 1.13 version.
« previous entries - page 40 of 52 - next entries »