Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: DataModules



Permlink Replies: 4 - Last Post: Sep 25, 2016 4:59 AM Last Post By: John MacDonald
John MacDonald

Posts: 179
Registered: 3/22/98
DataModules
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 22, 2016 9:33 AM
Can anyone tell me any reason(s) why I should not use DataModules with FireDac?

Our applications are not that complex, but, I don't think I've seem even one demo where a DataModule was used.

Our legacy app has many tables and in some cases queries against a BDE table.

Thanks

John
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: DataModules
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 22, 2016 10:35 AM   in response to: John MacDonald in response to: John MacDonald
John MacDonald wrote:
Can anyone tell me any reason(s) why I should not use DataModules with FireDac?

Our applications are not that complex, but, I don't think I've seem even one demo where a DataModule was used.

Our legacy app has many tables and in some cases queries against a BDE table.

Thanks

John

There is no reason. Demos tend to be quick and dirty examples of how to use
things, not how to properly build an app. Datamodules are just extra steps that
get in the way of a demo's demonstrating a feature, but are something you should
be using to partition your UI from your business logic (which includes working
with your backend).

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
John MacDonald

Posts: 179
Registered: 3/22/98
Re: DataModules
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 24, 2016 8:50 AM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
Thanks Jeff:

I am still getting up to speed with FireDac and Interbase.

One of my queries (inside a datamodule ) could not access a datasource located in another datamodule.

Once I put them in the same datamodule, all is well.

Thanks again.

John

Jeff Overcash (TeamB) wrote:
John MacDonald wrote:
Can anyone tell me any reason(s) why I should not use DataModules with FireDac?

Our applications are not that complex, but, I don't think I've seem even one demo where a DataModule was used.

Our legacy app has many tables and in some cases queries against a BDE table.

Thanks

John

There is no reason. Demos tend to be quick and dirty examples of how to use
things, not how to properly build an app. Datamodules are just extra steps that
get in the way of a demo's demonstrating a feature, but are something you should
be using to partition your UI from your business logic (which includes working
with your backend).

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

--
JMAC out
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: DataModules
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 24, 2016 3:46 PM   in response to: John MacDonald in response to: John MacDonald
John MacDonald wrote:
Thanks Jeff:

I am still getting up to speed with FireDac and Interbase.

One of my queries (inside a datamodule ) could not access a datasource located in another datamodule.

Once I put them in the same datamodule, all is well.

Thanks again.

John

That usually is creation order. The Datamodule with the data source is not
created before the datamodule with the dataset is. The streaming mechanism
links up by name so the name of the datamodule with the data source must be the
default name the IDE would generate (if you are creating the main DM by hand
first, but named differnetly).

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
John MacDonald

Posts: 179
Registered: 3/22/98
Re: DataModules
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 25, 2016 4:59 AM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
thanks for your help.

I'm not quite sure I understand.

I am setting up my database relationships at design time with the datamodules.
I have included the other datamodule. When looking for the master datasource from the other module it could not find it.

I will double check creation orders, but, I thought these were created since I put them in the datamodule?

Over the last year or so, I've moved my main projects from C++ builder 5 and now I am moving from the BDE/DBASE to FireDac/Interbase.
I'm sure I have lots to learn.

thanks again.

John

Jeff Overcash (TeamB) wrote:
John MacDonald wrote:
Thanks Jeff:

I am still getting up to speed with FireDac and Interbase.

One of my queries (inside a datamodule ) could not access a datasource located in another datamodule.

Once I put them in the same datamodule, all is well.

Thanks again.

John

That usually is creation order. The Datamodule with the data source is not
created before the datamodule with the dataset is. The streaming mechanism
links up by name so the name of the datamodule with the data source must be the
default name the IDE would generate (if you are creating the main DM by hand
first, but named differnetly).

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

--
JMAC out
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02