Mega Search
23.2 Million


Sign Up

Make a donation  
How to get rid of LiveBindings and be happy?  
News Group: embarcadero.public.delphi.firemonkey

xe7.1

Hi there!

I am using live bindings extensivelly in my software.

It works, however it is slow, difficult to use in forms with large number 
of connections, and mainly impossible to be used when I need to load data 
by thread.

ListView is the component that I use most and it has the nasty behavior of 
loading everything on the table it is connected. 

Using live binding I have no pratical control of it and the ueser needs to 
wait it load everything before the form shows up (since i open the table 
on the formcreate)

In a network or internet connection it is slow and make boring the usage 
of the software.
  
There is also the fact of some VCL - datasource like behavior do not exist, 
like the fields needs to be disabled when not in edit mode.


Said that, I wonder if someone could give and idea or point to solution, 
example, framework I could be use to connect the FMX editors and controls 
(TEdit, TListView, etc) to a TDataSet in a such way i could open the dataset 
on a thread an then connect/link/bind everything after I have the dataset 
done. This will make the View present itself and the user have a responsive 
view while waiting for the data, it could even open each tdataset in separated 
threads.

Please help !

Eduardo

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 22-Jan-2015, at 5:38 PM EST
From: Eduardo Elias
 
Re: How to get rid of LiveBindings and be happy?  
News Group: embarcadero.public.delphi.firemonkey
I havent done much with FMX yet, but perhaps doing owner draw grids may 
work better.

is there some kind of beginUpdate/endUpdate to call when populating so 
it doesn't keep redrawing?

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-Jan-2015, at 2:23 PM EST
From: Mike Margerum
 
Re: How to get rid of LiveBindings and be happy?  
News Group: embarcadero.public.delphi.firemonkey
Lieven,

I am not sure what you mean....

However to let you know, I have a big ERP software written on Delphi (now 
XE7 but i have started it on XE5 with some code from XE2 and D6) using LiveBinding.

it DOES WORK always. 

The problem is that:

- it is slow on android, on windows is ok most of the time.
- TListView has a bad behavior of loading everything. But other Grids and 
list are not like that. It only happens to TListView, and it is only a problem 
if you have a lot of data to load.

Firemonkey lacks few things based on TDataSource comparison, but instead 
you can do a lot more other things.

My problem here is related to use threads with livebinding. With TDataLink 
it would be easier for sure.

However what I see frequently are lazy programmers that wants to keep using 
Delphi 7 stuff only. Lets have some space for evolution....

Here you will find some information and link for tutorials:

http://docwiki.embarcadero.com/RADStudio/XE6/en/LiveBindings_in_RAD_Studio

There are many examples over the internet and youtube videos. 

Eduardo

> OK Ed, Show me how would you do a life whatever it is called do with
> main members and dependants, having a check box that is hiding
> dependants by selecting this box.(any database)
> 
> Show me how in firemonkey with livebuildersbindings.
> 
> I might buy XE& if you show me this.
> 
> "Eduardo Elias" <@> wrote in message
> news:711136@forums.embarcadero.com...
> 
>> Kees,
>> 
>> Thanks for you idea.
>> 
>> I am using Aurelius, that is similar to mORMot is some functions.
>> 
>> At beginning I was just happy codiing normal way until I reach to
>> some
>> limitation
>> specially from TListView in FMX that always load everything.
>> Just an hour ago Wagner from TMS (who wrote aurelius) just told me
>> the
>> very
>> same idea that you are sharing!!!
>> Instead of using regular "dataset" structure, use a TList<>. On
>> Aurelius there is a TAureliusDataSet that permit to wire livebinding
>> on it.
>> 
>> However it permit more than one way to connect data to it. One is to
>> ICriteria,
>> that is what I use now, and it is "closer" to what TDataSet is when
>> opening
>> a table directly
>> But it DOES accept getting a TList for example. And using
>> livebinding
>> it share the same data as a regular dataset.
>> I am very inclined to this direction right now.
>> 
>> However I was looking to hear options, since there is also missing
>> things on LiveBinding, not to mention the speed.
>> 
>> Eduardo
>> 
>>> Eduard,
>>> 
>>> Just wondering, did you try using Lists of objects, like
>>> TList?
>>> 
>>> With such an approach you can use any method to populate the list
>>> (like REST call, DataSnap or else). Once populated the list is
>>> hooked up to your controls.
>>> 
>>> Using mORMot
>>> (http://synopse.info/fossil/wiki?name=SQLite3+Framework) would make
>>> such a task even simpler.
>>> 
>>> I have no hands on experience, but this would be my approach.
>>> 
>>> Kees
>>>

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-Jan-2015, at 11:12 AM EST
From: Eduardo Elias
 
Re: How to get rid of LiveBindings and be happy?  
News Group: embarcadero.public.delphi.firemonkey
This is an age-old problem and it gets very little attention. The built-in plumbing was designed to make it quick and simple to build data-aware forms. But it's often restricted in several ways, and you're stuck with whatever dynamics the particular plumbing solution offers.

(BTW, data-aware controls weren't introduced into Delphi until Delphi 2, which also introduced support for 32-bit code.)

I made a presentation on this general topic at CodeRage 9, entitled "Have You Embraced Your Inner Plumber Lately?"

http://schwartzthink.com/coderage-9/

If you have a form that accesses data from somewhere, then either the form needs to have implicit knowledge of the data source (eg., via a data connection or stuff dropped onto the form or a DataModule), or you need to feed it data from the client that creates and/or uses it.

The former requires you to specific some data source parameters at design time and initialize them when the program starts up. This tightly-couples the form to the data sources and whatever dynamics it imposes.

The latter leaves the form ignorant of where the data comes from, as it relies entirely on data fed to it after it's created but before it's made visible (usually) to the user. You can even load a little data initially to make the form visible quickly, then continue loading data invisibly (possibly in a separate thread) after the form is Activated.

The latter approach is more of an example of Inversion of Control, because it's possible to pass in iterators that connect to any data source you want on the client side, where the form has no need to ever be aware of HOW or WHERE the data is coming from.

This has the benefit of allowing you to craft whatever dynamics you want in terms of how the form behaves.

Yes, it's takes a bit more code, but it gives you a lot more flexibility.

-David

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-Jan-2015, at 10:30 AM EST
From: David Schwartz
 
Re: How to get rid of LiveBindings and be happy?  
News Group: embarcadero.public.delphi.firemonkey
OK Ed, Show me how would you do a life whatever it is called do with main 
members and dependants, having a check box that is hiding dependants by 
selecting this box.(any database)

Show me how in firemonkey with livebuildersbindings.

I might buy XE& if you show me this.



"Eduardo Elias" <@> wrote in message news:711136@forums.embarcadero.com...
> Kees,
>
> Thanks for you idea.
>
> I am using Aurelius, that is similar to mORMot is some functions.
>
> At beginning I was just happy codiing normal way until I reach to some 
> limitation
> specially from TListView in FMX that always load everything.
>
> Just an hour ago Wagner from TMS (who wrote aurelius) just told me the 
> very
> same idea that you are sharing!!!
>
> Instead of using regular "dataset" structure, use a TList<>. On Aurelius
> there is a TAureliusDataSet that permit to wire livebinding on it.
>
> However it permit more than one way to connect data to it. One is to 
> ICriteria,
> that is what I use now, and it is "closer" to what TDataSet is when 
> opening
> a table directly
>
> But it DOES accept getting a TList for example. And using 
> livebinding
> it share the same data as a regular dataset.
>
> I am very inclined to this direction right now.
>
> However I was looking to hear options, since there is also missing things
> on LiveBinding, not to mention the speed.
>
> Eduardo
>
>> Eduard,
>>
>> Just wondering, did you try using Lists of objects, like
>> TList?
>>
>> With such an approach you can use any method to populate the list
>> (like REST call, DataSnap or else). Once populated the list is hooked
>> up to your controls.
>>
>> Using mORMot (http://synopse.info/fossil/wiki?name=SQLite3+Framework)
>> would make such a task even simpler.
>>
>> I have no hands on experience, but this would be my approach.
>>
>> Kees
>>

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-Jan-2015, at 8:15 AM EST
From: Lieven Vandaele
 
Re: How to get rid of LiveBindings and be happy?  
News Group: embarcadero.public.delphi.firemonkey
Kees,

Thanks for you idea.

I am using Aurelius, that is similar to mORMot is some functions.

At beginning I was just happy codiing normal way until I reach to some limitation 
specially from TListView in FMX that always load everything. 

Just an hour ago Wagner from TMS (who wrote aurelius) just told me the very 
same idea that you are sharing!!!

Instead of using regular "dataset" structure, use a TList<>. On Aurelius 
there is a TAureliusDataSet that permit to wire livebinding on it. 

However it permit more than one way to connect data to it. One is to ICriteria, 
that is what I use now, and it is "closer" to what TDataSet is when opening 
a table directly

But it DOES accept getting a TList for example. And using livebinding 
it share the same data as a regular dataset.

I am very inclined to this direction right now.

However I was looking to hear options, since there is also missing things 
on LiveBinding, not to mention the speed.

Eduardo

> Eduard,
> 
> Just wondering, did you try using Lists of objects, like
> TList?
> 
> With such an approach you can use any method to populate the list
> (like REST call, DataSnap or else). Once populated the list is hooked
> up to your controls.
> 
> Using mORMot (http://synopse.info/fossil/wiki?name=SQLite3+Framework)
> would make such a task even simpler.
> 
> I have no hands on experience, but this would be my approach.
> 
> Kees
>

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-Jan-2015, at 7:59 AM EST
From: Eduardo Elias
 
Re: How to get rid of LiveBindings and be happy?  
News Group: embarcadero.public.delphi.firemonkey
Did  you buy XE7, if not why not.
Otherwise stick with Borland Delphi, bybye.
Delphi 2010 is my last one, any other I come back if time is right.

Delphi2010 for unicode yes, any other Delphi7 would be alright,i think, 
Delphi5 also worked just fine  for me.

Stop talking any if you are not even able to show any code here,TeamB does 
not like this.
You need to understand the differents between languages, Delphi is not 
firemonkey.
Firemonkey is resource related and you need cpu speed for this, mb not to 
worry about this in thismegamb era.

Choose to loose.

Sorry, nobody is going to help you with this.




"Eduardo Elias" <@> wrote in message news:711012@forums.embarcadero.com...
> xe7.1
>
> Hi there!
>
> I am using live bindings extensivelly in my software.
>
> It works, however it is slow, difficult to use in forms with large number
> of connections, and mainly impossible to be used when I need to load data
> by thread.
>
> ListView is the component that I use most and it has the nasty behavior of
> loading everything on the table it is connected.
>
> Using live binding I have no pratical control of it and the ueser needs to
> wait it load everything before the form shows up (since i open the table
> on the formcreate)
>
> In a network or internet connection it is slow and make boring the usage
> of the software.
>
> There is also the fact of some VCL - datasource like behavior do not 
> exist,
> like the fields needs to be disabled when not in edit mode.
>
>
> Said that, I wonder if someone could give and idea or point to solution,
> example, framework I could be use to connect the FMX editors and controls
> (TEdit, TListView, etc) to a TDataSet in a such way i could open the 
> dataset
> on a thread an then connect/link/bind everything after I have the dataset
> done. This will make the View present itself and the user have a 
> responsive
> view while waiting for the data, it could even open each tdataset in 
> separated
> threads.
>
> Please help !
>
> Eduardo

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-Jan-2015, at 7:59 AM EST
From: Lieven Vandaele
 
Re: How to get rid of LiveBindings and be happy?  
News Group: embarcadero.public.delphi.firemonkey
Robert,

Add more one real-world experience to your list.

I have used VCL with TDataLink since Delphi 1. Made big projects and either 
big mistakes. However it was always easy and simple and fast.

Most recent version of LB made easier for many things. The idea is really 
not bad. But the implementation still need to change a lot.

I have made a POS system using FMX and all the new stuff, and using LiveBindings 
for the Grid that represents the receipt.

First tests and the POS system was amanzingly slow. On Android even worst. 
I was so disappointed.

It took 1.5 seconds per Item to add a new product. Imagine that in a supermarket.

Then I removed the LiveBinding, the only wiring in the entire application, 
and start using the Grid witout it.

And the performance just came back! It is now an instant to add an item. 
So the problem was LiveBinding.

Said that, not that I think it is not a good direction, however like always 
EMB should test the products in real conditions. 

All that we have is some of the Top Old Guys on EMB showing small little 
tricks with the tecnology. Show me where you can see a real word application 
with hundreds of forms, tables and fields? This is the real customer of Delphi 
products.

Well....  just a little rant.

I have asked myself why anyone did not created anything like TDataLink for 
FMX yet. What is the limitation of that? 

Thanks, I will take a look.

> Well, I am still in the old good VCL-world so I never tried
> livebinding
> myself so far...
> I've only heard some real-world experiences (and not good ones) from a
> friend of mine.
> (that BTW is a great and experienced developer, so I tend to give him
> credit)
> I'm surprised that so far noone did a set of components for firemonkey
> using
> the old data-aware approach,
> just maybe for the nostalgic programmers around (or maybe also for
> some
> practical reasons).
> (or maybe they exists but I am unaware of this)
> I don't think there are technical obstacles in inheriting firemonkey
> components and using the old TDataLink approach, valid since D1....
> 
> http://docs.embarcadero.com/products/rad_studio/radstudio2007/RS2007_h
> elpupdates/HUpdate4/EN/html/devwin32/makingacontroldataawarepart_xml.h
> tml
> 
> "Eduardo Elias"  ha scritto nel messaggio
> news:711012@forums.embarcadero.com...
> 
> xe7.1
> 
> Hi there!
> 
> I am using live bindings extensivelly in my software.
> 
> It works, however it is slow, difficult to use in forms with large
> number of connections, and mainly impossible to be used when I need to
> load data by thread.
> 
> ListView is the component that I use most and it has the nasty
> behavior of loading everything on the table it is connected.
> 
> Using live binding I have no pratical control of it and the ueser
> needs to wait it load everything before the form shows up (since i
> open the table on the formcreate)
> 
> In a network or internet connection it is slow and make boring the
> usage of the software.
> 
> There is also the fact of some VCL - datasource like behavior do not
> exist, like the fields needs to be disabled when not in edit mode.
> 
> Said that, I wonder if someone could give and idea or point to
> solution,
> example, framework I could be use to connect the FMX editors and
> controls
> (TEdit, TListView, etc) to a TDataSet in a such way i could open the
> dataset
> on a thread an then connect/link/bind everything after I have the
> dataset
> done. This will make the View present itself and the user have a
> responsive
> view while waiting for the data, it could even open each tdataset in
> separated
> threads.
> Please help !
> 
> Eduardo
>

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-Jan-2015, at 7:40 AM EST
From: Eduardo Elias
 
Re: How to get rid of LiveBindings and be happy?  
News Group: embarcadero.public.delphi.firemonkey
Eduard,

Just wondering, did you try using Lists of objects, like TList?

With such an approach you can use any method to populate the list (like 
REST call, DataSnap or else). Once populated the list is hooked up to 
your controls.

Using mORMot (http://synopse.info/fossil/wiki?name=SQLite3+Framework) 
would make such a task even simpler.

I have no hands on experience, but this would be my approach.

Kees

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-Jan-2015, at 7:28 AM EST
From: Kees Vermeulen
 
Re: How to get rid of LiveBindings and be happy?  
News Group: embarcadero.public.delphi.firemonkey
Well, I am still in the old good VCL-world so I never tried livebinding 
myself so far...
I've only heard some real-world experiences (and not good ones) from a 
friend of mine.
(that BTW is a great and experienced developer, so I tend to give him 
credit)

I'm surprised that so far noone did a set of components for firemonkey using 
the old data-aware approach,
just maybe for the nostalgic programmers around (or maybe also for some 
practical reasons).
(or maybe they exists but I am unaware of this)

I don't think there are technical obstacles in inheriting firemonkey 
components and using the old TDataLink approach, valid since D1....

http://docs.embarcadero.com/products/rad_studio/radstudio2007/RS2007_helpupdates/HUpdate4/EN/html/devwin32/makingacontroldataawarepart_xml.html



"Eduardo Elias"  ha scritto nel messaggio 
news:711012@forums.embarcadero.com...

xe7.1

Hi there!

I am using live bindings extensivelly in my software.

It works, however it is slow, difficult to use in forms with large number
of connections, and mainly impossible to be used when I need to load data
by thread.

ListView is the component that I use most and it has the nasty behavior of
loading everything on the table it is connected.

Using live binding I have no pratical control of it and the ueser needs to
wait it load everything before the form shows up (since i open the table
on the formcreate)

In a network or internet connection it is slow and make boring the usage
of the software.

There is also the fact of some VCL - datasource like behavior do not exist,
like the fields needs to be disabled when not in edit mode.


Said that, I wonder if someone could give and idea or point to solution,
example, framework I could be use to connect the FMX editors and controls
(TEdit, TListView, etc) to a TDataSet in a such way i could open the dataset
on a thread an then connect/link/bind everything after I have the dataset
done. This will make the View present itself and the user have a responsive
view while waiting for the data, it could even open each tdataset in 
separated
threads.

Please help !

Eduardo

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-Jan-2015, at 5:51 AM EST
From: Roberto Icardi