JustMe
JustMe

Reputation: 2383

Client-Server application writing in delphi

What is the best way to write a client-server application under delphi? I know there's a DataSnap technology, but it's not in Professional version. Do You have any experience that You can share?

Upvotes: 3

Views: 9385

Answers (7)

Christopher Ramírez
Christopher Ramírez

Reputation: 1720

Since a few months ago I stopped to implement new projects with this kind of architecture (n-tiers, 2-tiers) Based on Delphis and specific DB technologies. I believe these architecture are not future prof. The architecture i'm using now is a 2-pier one. The server is a normal HTTP server. It works as app server* and optionally provides a web client. Developing clients in Delphi it's harder but worth it. Since specif tools are not available as the ones offered for DB connections, I use indy to send and receive data from the HTTP server. I do a GET request to fetch data and then parse it to show it on the GUI. Then a POST request to update or insert new data. The HTTP server handle all business logic :-)

Apart of being future prof, this architecture is cheaper and platform independent. And if you analyze it, this is the same architecture used by most mobile apps. So, if you plan to write a mobile client in the future, consider developing the app server with script languages (Python, PHP, Ruby, etc.).

That's my recommendation. Don't forget: Great things require great commitments!

  • An App Server is a service which provides your application (thin client) with with an interface to get and send data. Also it control the business logic. Your application don't care about DB's or controlling record relations and data constrains. That's all is transparently done by the app server.

Upvotes: 1

Arnaud Bouchez
Arnaud Bouchez

Reputation: 43053

Take a look at our Open Source Client/Server ORM.

It's multi-tier compatible, and you can have ORM at both Client and Server level. ORM is used everywhere, and JSON is the format chosen for the Client/Server transmission.

You can start your application as local application, then just by changing the class type used to access to the data, it will become a Client/Server application communicating via Named Pipes, HTTP/1.1 or GDI messages.

It was designed to work with SQLite3 as a small but efficient database engine on the server side, but you can use the ORM without SQlite3. There is a pure Delphi in-memory engine provided, if you prefer.

This framework try to implement N-Tier architecture from the bottom up. The upcoming 1.13 version will have a powerful filtering and validation mechanism, perfect for N-Tier architecture. There is some User-Interface units, with full reporting (and pdf generation), able to create most of the User Interface from code, using the ORM layout of the data.

It's based on the RESTful paradigm to access the data from the Client, via JSON. And there is a easy way of implementing Client/Server Services if the RESTful approach is not enough, just like DataSnap.

It's Unicode ready (uses UTF-8 at all internal level), and works with every version of the IDE, from Delphi 6 up to XE (even the Starter edition).

Upvotes: 1

mjn
mjn

Reputation: 36674

With Delphi Professional it is possible to write simple (no WS-* standards, no Soap 1.2 servers) SOAP client and server applications.

In many cases, Soap offers advantages regarding cross-platform / cross-language integration, standardization, design-by-contract and mature implementation guidelines, best practices and patterns.

For Soap there are great (and free) tools like SoapUI and IDE editors for Web Service Description Language (WSDL) documents like NetBeans.

Upvotes: 1

Inoussa OUEDRAOGO
Inoussa OUEDRAOGO

Reputation: 517

You can use WST is a free and open source toolkit for web services consumption and creation with support for SOAP and XmlRPC and JsonRPC (the JsonRPC support is available only for FPC). It is compatible with Delphi. Better check out from svn as the 0.5 release is actualy outdated.

Upvotes: 2

For general-purpose client-server communication you can use our lightweight MsgConnect product. This is a cross-platform MOM (message-oriented-middleware).

Upvotes: 0

Robert Love
Robert Love

Reputation: 12581

This is fairly wide open question, as it can depend on your database decision.

DataSnap really allows for N-Tier solutions, if your looking for Client Server you have most everything you need in the professional version depending on the Database Choice.

For Client Server:

Client Server Architecture is when the Client communicates directly with the server.

There are several frameworks available they all follow the same pattern.

DB Connection -> Query -> (Optional Provider -> TClientDataset) -> TDataSource -> Visual Control

DBX

  • TSqlConnection - Connects to the Database
  • TSqlQuery - Query against DB producing uni-directional Dataset
  • TSqlStoredProc - Executes Stores Procedures against DB

ADO

  • TAdoConnection - Connects to Database
  • TAdoQuery - Query against DB producing Bi-Directional Dataset

Common Components

  • TClientDataSet - In Memory dataset that is bi-directional
  • TDatasetProvider - Takes other datasets and ties the data to TClientDataset
  • TDataSource - Ties a Dataset to a data-aware visual control

There are several other options available depending on Database Choice.

However, you seem to be asking about N-Tier (Middle-Tier) type solutions

For N-Tier

N-Tier architecture is when the Client communicates with Middle Tier that then communicates with the Server. It's referred to N-Tier as you have option to have multiple Middle Tiers or Application Servers.

Commercial Options (Required additional $$ to be spent)

I personally don't know of any free or open source options, although I suspect some exist.

Upvotes: 6

Marjan Venema
Marjan Venema

Reputation: 19356

Two options:

  • DIY (Do It Yourself). Write a communications layer and protocol yourself using Indy and/or ICS internet components. A lot of hard work and needs a lot of testing to get right.
  • Use a ready made framework such as kbmMW: http://components4developers.com/ or RemObjects: http://www.remobjects.com/ Both are not free but well worth the money you pay even if only measured by the development time/costs that you spare.

Upvotes: 3

Related Questions