Introducing the new TMS Aurelius Dictionary
TMS Aurelius 5.6 has been released, and the major feature is a brand new, full-feature dictionary.
Aurelius dictionary is intended to be used in Aurelius queries. The idea is that instead of using strings to reference entity properties, you use the dictionary properties directly. For example, a usual Aurelius query is like this:
Results := Manager.Find.Where(Linq['Name'].Like('M%')) .List;
But the above approach is error prone, the ‘Name’ string can be wrong, it can be wrongly typed, or the name might be modified. You will only find the errors at runtime. With the dictionary, you can write the query like this:
Results := Manager.Find.Where(Dic.Customer.Name.Like('M%')) .List;
Manager.Find.Select(Dic.Invoice.Total.Sum) .Where(Dic.Invoice.Customer.Country.Name = 'Brazil')
It’s a simple thing that makes a huge difference when you are using it daily. You have code completion, you have compile-time check, you minimize the errors at runtime. In summary, it increases your productivity a lot.
TDictionaryGenerator.GenerateFile('C:SomeFolderMyDictionary.pas');
AureliusDictionaryGenerator.exe -i:Default -p:"C:MyProjectBplEntities" "C:MyProjectMyDictionary.pas"
TDictionaryValidator.Check(Dic);
It’s as simple as that. This way you make sure you don’t have surprises at runtime and your dictionary is correct!
This is an awesome new feature that brings a night-and-day difference when writing Aurelius queries. If you want to have more detailed information, of course please refer to the documentation where all the above features are explained in details.
Wagner R. Landgraf