DYNAMIC in XIDE

This forum is meant for questions and discussions about the X# language and tools
User avatar
wriedmann
Posts: 3756
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

DYNAMIC in XIDE

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Otto
Posts: 174
Joined: Wed Sep 30, 2015 6:22 pm

DYNAMIC in XIDE

Post 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
User avatar
wriedmann
Posts: 3756
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

DYNAMIC in XIDE

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
FFF
Posts: 1581
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

DYNAMIC in XIDE

Post 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 ;)
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Post Reply