Page 2 of 2
DYNAMIC in XIDE
Posted: Wed Oct 05, 2016 3:38 am
by wriedmann
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
Posted: Wed Oct 05, 2016 6:24 am
by Otto
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
DYNAMIC in XIDE
Posted: Wed Oct 05, 2016 6:34 am
by wriedmann
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
DYNAMIC in XIDE
Posted: Wed Oct 05, 2016 7:03 am
by FFF
Otto 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
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-secs