You are not logged in.
Pages: 1
Hi,
Wich TObjectList can I use with Interface Based Services, from the unit WebAdapt or System.Generics.Collections???
Offline
We expect and tested the Contnrs.TObjectList class.
mORMot does not use nor support WebAdapt, but I think it is the same as Contnrs.TObjectList, so it should work.
But System.Generics.Collections.TObjectList won't work, since it is a diverse type than Contnrs.TObjectList, and is generic-based.
I suspect writing a patch to handle it in addition to TObjectList won't easily be possible - generics are indeed creating one instantiation class type at compile time for each type argument.
So there is no parent class able to identify all TObjectList<T> at once, ad we do for Contnrs.TObjectList...
Perhaps we may be able to define some class helpers to handle those, but I can't find any easy solution... Perhaps each TObjectList<T> type should be registered as such.
Do you have any idea?
We can always convert any TObjectList<T> into a plain TObjecTList.
Then if you register each class type T, you will be able to serialize it.
Offline
Ok, thanks.
I'm having some troubles with this approach. Error : "Class TBankVO" not found".
TBankVO = class(TSQLRecord)
private
FCODIGO: String;
FNOME: String;
published
[TFormatter(100, taCenter, True, True)] // this is a custom attribute
property Codigo: String read FCODIGO write FCODIGO;
property Nome: String read FNOME write FNOME;
I have a procedure in a interface:
IBancoController = interface(IInvokable)
['{078EF22D-E687-44AE-8E9F-47C841095108}']
procedure Get(var Result: TObjectList);
end;
When I'm calling from the client a found this error every time.
Offline
AB, what you think about writing this methos as a function Get: TObjectList?
Other question: when is better to use collections and when is better to use TObjectList with mORMot?
Offline
Hi,
AB, How many objects do you recomend to send using one TObjectList??
Offline
It should stay in memory, it should not contain a lot of BLOBs, it should not use too much bandwidth...
But serialization/unserialization should be fast.
If you find any performance issue, don't hesitate to report here.
So no special recommendation.
Offline
Pages: 1