Call the Delphi method from another Delphi program

I would like to set up a small program that extracts information from a database, and then distributes this information to another program upon request. For example, a program called "Master" will extract data from a database and create a collection of objects (list, array, etc., which works best), and then a program called "Slave" (running from multiple desktop computers) can call the method (ie GetNextRecord) from the "Wizard" to get the next record in the collection.

I would like to be able to allow only one “slave” the ability to call the GetNextRecord method at a time to avoid providing multiple slaves with the same record. The "wizard" will work on a server with a database, and the "Slave" will work on several desktop computers.

Does anyone have an example of this or a tutorial on how to do this?

TIA, Brian Enderle

+7
delphi
source share
3 answers

What you are describing is also known as load balancing , which can be implemented using Message Queue .

See the Oriented Middleware message and check for existing implementations, such as Microsoft Message Queuing (MSMQ) :

MSMQ is essentially a messaging protocol that allows applications to run on separate servers / processes to communicate in a secure manner.

Recommended Reading is also a book on Enterprise Integration Templates.


Note. I am the author of the Delphi and Free Pascal client libraries for open source message queues / message brokers (ActiveMQ, HornetQ, OpenMQ, RabbitMQ).

+1
source share

What you describe is commonly known as a three-level or multi-level construction.

There are several Delphi libraries to facilitate:

Related questions:

Recommendations for migrating to a layered Delphi architecture

+12
source share

I would look at DataSnap in Delphi XE. There is a free DataSnap 2010 document with videos http://www.embarcadero-info.com/in_action/radstudio/db.html , and I'm currently working on a small but real-life example of a Delphi XE application for another white paper (possibly published next month or early 2011). In the meantime, you can also read the Delphi XE DataSnap Development Essentials study guide published today at http://www.eBob42.com/courseware (see TOC at http://www.ebob42.com/training/DataSnapXE .pdf ).

If you do not have an Enterprise version of Delphi and do not want to update it, you might want to take a look at the RemObjects SDK.

Note. I am a reseller of both, but I also use both in real projects for clients and theirs, so I know what I'm talking about -)

0
source share

All Articles