tag:blogger.com,1999:blog-6222893893652665733.post5904940019200959162..comments2024-01-08T00:30:35.594-08:00Comments on Cary Jensen "Let's Get Technical": LiveBinding Expression Can Produce Side EffectsUnknownnoreply@blogger.comBlogger9125tag:blogger.com,1999:blog-6222893893652665733.post-28120454223591659122012-04-21T02:50:02.835-07:002012-04-21T02:50:02.835-07:00"What is still bothering me with LiveBindings..."What is still bothering me with LiveBindings is that" is that Embarcadero has a perfect system of Publisher/Subscriber in the Bold source since 10 years. Probably some adaptation must be done to include it in the VCL without the Business object space.<br />Some advantages e.g. <br />== No events to add with Notify, <br />== The possibility to have a property of type TBoldApplyPolicy for each binding :<br />(bapChange - Changes in the GUI control are immediately applied.<br />bapExit - changes in the GUI control are applied when the control loses focus<br />bapDemand - changes in the GUI control is not applied until it is explicitly requested.)<br />== The use of OCL: this language is used in UML, have a lot of reasearch on it and is recognized as a standard.<br />It is obvious that the current implementation of the Embarcadero binding is not very successfull - look only to the traffic on the livebinding ng).<br />In this area, I thing that the proposed implementation of Boian Mitov "Visual Live Binding" is really revolutionary and probably most in the spirit of a RAD like Delphi.<br />Stefan Glienke has too an interesting implementation of the binding but as he said him self not visual (at this stage).Eddyhttps://www.blogger.com/profile/10885931540980829588noreply@blogger.comtag:blogger.com,1999:blog-6222893893652665733.post-50447400582284541292012-02-29T00:13:21.756-08:002012-02-29T00:13:21.756-08:00The problem currently is a similar as in .Net (but...The problem currently is a similar as in .Net (but where you have the ability to do AOP to your rescue) - property change notifications. You have to implement setters for every property you want to bind to (at least when you want to be notified if that property has changed).<br /><br />Also it requires the controls to be binding aware which means when you type into an edit for example it should send the updated value directly or after leaving the control (or after validation) to the bound object.<br /><br />This all works kinda with LiveBindings currently (although some things still require some or lots of extra code).<br /><br />But when it comes to for example bind a list of objects to some list control or grid LiveBindings reveal their weakness. They are just a collection of expressions and all these expressions have to be defined resulting in like a dozen different expressions which are very brittle.<br /><br />That is why my approach in DSharp was using data templates as in WPF to specify how to display these items inside a list, tree or grid. Of course that is not RAD anymore but to me a less error prone way is better than the RAD way in that case.Stefan Glienkehttps://www.blogger.com/profile/09320735081289619570noreply@blogger.comtag:blogger.com,1999:blog-6222893893652665733.post-78746824511582686862012-02-28T06:49:30.279-08:002012-02-28T06:49:30.279-08:00Won't the breakthrough that Live Bindings prom...Won't the breakthrough that Live Bindings promises be the ability to connect objects to UI controls so that we can move away from DB aware components to true OOP programming ? In this paradigm, an object can be created and loaded (perhaps by using an ORM framework such as TMS Aurelius) and then linked via LiveBindings to UI controls as well as other objects. This seems to be the preferred way to work in VS for some time already. To the non-techno developer, such as myself, there has always been a gap between implementing OOP principles and interacting with the UI. Will LiveBindings be the solution ?Andre Greylinghttps://www.blogger.com/profile/03502795858662672337noreply@blogger.comtag:blogger.com,1999:blog-6222893893652665733.post-66945193663721599802012-02-28T06:23:12.554-08:002012-02-28T06:23:12.554-08:00I really appreciate the comments that have been po...I really appreciate the comments that have been posted so far. Embarcadero is aware of the limitations and weaknesses that have been mentioned. The good news is that this was just the first release of LiveBindings. I expect that we will continue to see improvements and enhancements in future releases.Cary Jensenhttps://www.blogger.com/profile/09264435441034661563noreply@blogger.comtag:blogger.com,1999:blog-6222893893652665733.post-27458712584633934922012-02-28T03:33:50.848-08:002012-02-28T03:33:50.848-08:00Hi, I view LiveBindings in the following way.
The...Hi, I view LiveBindings in the following way.<br /><br />The sides effects produced by LiveBindings are the consequence of its implementations: it uses an Observer Pattern (I think LV is a mix of ModelViewPresenter / Interpreter Patterns; Observer is used inside the ModelViewPresenter). In general an observer can be used to keep application's components synchronized. E.G. the subject "opendatataset" can be subscribed by a form in order to activate the datasource; a datamodule could trigger the subject calling the Notify method of the observer when one of its dataset has been opened. <br /><br />BindingsList1.Notify(Sender, '') means. I call the observer manager (BindingList1) to inform that my state (sender) has been changed. The observer manager notify the subscribers. <br />The subscriber is a control component in the binding expression.<br /><br />Regards,<br />Stefano Moratto<br />www.csiat.itStefanohttps://www.blogger.com/profile/09410259920607883770noreply@blogger.comtag:blogger.com,1999:blog-6222893893652665733.post-83613595005226894072012-02-27T23:47:54.649-08:002012-02-27T23:47:54.649-08:00LiveBindings (because being string based) are chan...LiveBindings (because being string based) are changing a Delphi program from being strongly typed and having compiletime safety into something that is hard to maintain and easy to break (refactoring?).<br /><br />In .Net that all works ten time better because the xaml code is being compiler checked while the dfm code is not which is the major design flaw here.Stefan Glienkehttps://www.blogger.com/profile/09320735081289619570noreply@blogger.comtag:blogger.com,1999:blog-6222893893652665733.post-67169533270814700962012-02-27T23:23:45.030-08:002012-02-27T23:23:45.030-08:00You're basically trying to use LiveBindings as...You're basically trying to use LiveBindings as a poor man's scripting engine, that would lack most of the facilities a regular script engine offers (like compilation, static typing, syntax checks, breakpoints, proper error/exception signaling, leaks protection, etc.).<br /><br />If you use DWScript for what you propose f.i., you can syntax checks all the expressions at application startup (rather than having them bomb only when executed), and you get expression capability that goes far beyond what LiveBindings can do, with a much higher execution speed, less "behind the scenes" code involved, more flexibility, more support tools, etc.<br />And as a bonus you have the choice between accessing through RTTI (little code required, but fragile and subject to memory overwrites/leaks) or through static, strongly-typed, error-checked wrappers.Erichttps://www.blogger.com/profile/05912696305224378407noreply@blogger.comtag:blogger.com,1999:blog-6222893893652665733.post-43317661561949337482012-02-27T08:12:20.842-08:002012-02-27T08:12:20.842-08:00Birger: Good points. At design time you can evalua...Birger: Good points. At design time you can evaluate an expression from the expression editor, but it does not always reflect how the expression will be evaluated at runtime. And, expressions are much slower than compiled code, which is why they are not replacements for traditional event handlers.Cary Jensenhttps://www.blogger.com/profile/09264435441034661563noreply@blogger.comtag:blogger.com,1999:blog-6222893893652665733.post-20727896232960680872012-02-27T07:57:28.886-08:002012-02-27T07:57:28.886-08:00What is still bothering me with LiveBindings is th...What is still bothering me with LiveBindings is that with the ExpressionEngine it is af we are using Delphi as a script interpreter.<br /><br />Errors in expressions will not be noticed by the compiler, so there is a lot of manual checking involved. If I rename a control the compiler will not compile any code that uses the old control name, but with LiveBindings I won't notice the error untill the expression is evaluated at runtime. I hope that in a future update the expressions will be checked by the compiler somehow.Anonymousnoreply@blogger.com