Client-Server application writing in delphi

前端 未结 7 1461
盖世英雄少女心
盖世英雄少女心 2021-02-11 01:19

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

相关标签:
7条回答
  • 2021-02-11 01:38

    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.
    0 讨论(0)
  • 2021-02-11 01:39

    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.
    0 讨论(0)
  • 2021-02-11 01:45

    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)

    • DataSnap
    • DataAbstract
    • RemObjects SDK (Part of DataAbstract but can be used by itself)
    • KBMMw
    • Midware

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

    0 讨论(0)
  • 2021-02-11 01:45

    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).

    0 讨论(0)
  • 2021-02-11 01:48

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

    0 讨论(0)
  • 2021-02-11 01:49

    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.

    0 讨论(0)
提交回复
热议问题