Hi Chris,
done! I hope this class helps someone. For me it saves a LOT of code and solves the problem to write tons of properties for varying select statement results.
Wolfgang
DYNAMIC in XIDE
DYNAMIC in XIDE
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
DYNAMIC in XIDE
Wolfgang,
You don't care that DYNAMIC costs you a lot of performance? And you're missing a lot of compiletime typechecking (as you mentioned).
Otto
You don't care that DYNAMIC costs you a lot of performance? And you're missing a lot of compiletime typechecking (as you mentioned).
Otto
DYNAMIC in XIDE
Hi Otto,
yes, of course I know that. But compared with the time that is needed to read from a database that is ok.
And for compile time checks: very often the contents of a select statement are different, depending on what a user can see/modify or what a user has selected as columns in a grid - so it would be problematic to have hard coded properties that are not related to any column in the select result.
In VO, my DBServer classes most of the time are only the class declaration and a few access variables for virtual/computed fields, and saving a LOT of code, thus making my application smaller and easier to maintain (other than saving to write a lot of redundant code) is worth the missing compile time checks.
Of course, such choices have to be taken comparing the pro's and con's in depth.
For me the advantages of dynamic objects are bigger than the disadvantages.... But for others, this could be the inverse.
Wolfgang
yes, of course I know that. But compared with the time that is needed to read from a database that is ok.
And for compile time checks: very often the contents of a select statement are different, depending on what a user can see/modify or what a user has selected as columns in a grid - so it would be problematic to have hard coded properties that are not related to any column in the select result.
In VO, my DBServer classes most of the time are only the class declaration and a few access variables for virtual/computed fields, and saving a LOT of code, thus making my application smaller and easier to maintain (other than saving to write a lot of redundant code) is worth the missing compile time checks.
Of course, such choices have to be taken comparing the pro's and con's in depth.
For me the advantages of dynamic objects are bigger than the disadvantages.... But for others, this could be the inverse.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
DYNAMIC in XIDE
Otto, nothing against typechecking, we sure all agree that can and is a help. But performance? Yes, you loose - but what the heck? There are usecases, where something is complex and eats lots of data, so the question, will it need 5min or 30sec to return is relevant. But IMHO there's tons of situations where the slow call succeeds in 0.02 secs - and here i couldn't care less, that i miss some milli-secsOtto wrote:Wolfgang,
You don't care that DYNAMIC costs you a lot of performance? And you're missing a lot of compiletime typechecking (as you mentioned).
Otto
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)