You are not logged in.
Pages: 1
When passing data to remote functions, you often have a lot of data to send.
With Mormot, the design decision was made to limit you to 32 parameters per remote function. I can see that when memory is limited.
But with modern 64 bit systems, I find this artificial limit is often frustrating. Now I have to make 3 or 4 API calls per page to update
the data from one HTML web page to live within the 32 parameter limit. I dread every time someone asks for another new field.
The size of 'blocks' is hard coded at 64 entries, would it break things if I were to double or more that on 64 bit systems? The code uses High( blocks ), so I'm hoping it would be able to handle any power of 2?
Thanks,
Erick
Offline
Why not simply create one or more records to pass your data? (just askin')
I can't really see a problem here. Clean Coding usually would limit you to about 3 parameters anyway and more than six is akin to code smell...
Offline
I agree with sakura.
The maximum number of parameters has nothing to do with memory limitation, or even that the i386 CPU has 32-bit registers.
It is a matter of design. More than five/six parameters makes any interface difficult to understand and maintain.
Just check your own code.
Do any of your regular functions in your Delphi code take more than 32 parameters?
Do any of the RTL / VLC / LCL methods take more than 32 parameters?
So the idea is to regroup values into classes or records, which are names DTOs.
We have premium record support, which are great to create what those DTOs.
Even if you don't use all the records fields, your code will be much better.
And from the client point of view, having some nested JSON objects is much preferred to a huge set of properties.
I will clearly state the above in the documentation/source.
Offline
Sure, nested JSON will solve my problem. SOlutions right in front of my eyes. Thanks.
Erick
Offline
Pages: 1