Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call Delphi method from another Delphi program

Tags:

delphi

I would like to setup a small program that retrieves info from a database and then distributes that information to another program when requested. For instance, a program called 'Master' would retrieve data from the database and create a collection of objects (list, array, etc. whatever works best) and then a program called 'Slave' (running from multiple desktops) could call a method (i.e., GetNextRecord) from 'Master' to retrieve the next record in the collection.

I would like to be able to only allow one 'Slave' to be able to call the GetNextRecord method at a time to avoid giving multiple slaves the same record. 'Master' would run on the server with the database while 'Slave' would be running on multiple desktop machines.

Does anyone have an example of this or a tutorial on how this is done?

TIA, Brian Enderle

like image 392
BrianKE Avatar asked Nov 16 '10 20:11

BrianKE


1 Answers

What you are describing is generally known as three-tier or multi-tier design.

There are some Delphi libraries out there to make it easier:

  • DataSnap (part of Delphi)
  • http://www.remobjectssdk.com/
  • http://www.realthinclient.com/
  • http://www.components4programmers.com/products/kbmmw/index.htm

Related question:

Advice on moving to a multi tier Delphi architecture

like image 137
Jens Mühlenhoff Avatar answered Sep 19 '22 21:09

Jens Mühlenhoff