Architecture for 3-tier application with D7 [closed]
Asked Answered
A

3

7

I have had experience with COM+ technology so far to build 3-tier applications. This is huge and advanced technology which supports many interesting concepts. It just works as it should for the applications which operate on LAN.

Now I am planning to build 3-tier system, still based on D7. The difference is that it should work in the internet. The clients will be scattered all over the world. From my experience in such situation I wouldn't rely on com+. Com+ basically needs stable connection, it is not easy to configure the firewall server which has to open quite wide range of ports (even if you narrow it).

So the question is. What architecture (web services, services or something else) works for you in production? I think I would like to have the service which listens on one tcp port. In which I could save session client parameters available for the open session. Also some kind of built in encryption would be a plus.

Thanks for help!

Ashleeashleigh answered 25/7, 2011 at 11:3 Comment(1)
Anything but COM+ or DCOM. They suck. And anybody remember BOLD? good thing you didn't use that either. :-)Lowell
S
7

We use RemObjects SDK for our services, and we are very happy with the quality! You can use TCP + Binary messages (for high speed), with optional encryption and compression. But also HTTP + SOAP (or XML or whatever) is possible, or TCP + SOAP etc. It is very easy to use, and worth the price (it is not very expensive)!

BTW: Data Abstract is based on the SDK, both are from RemObjects.com.

Stagey answered 25/7, 2011 at 11:34 Comment(0)
I
6

SOAP or REST WebServices are widely supported and are (SOAP almost always, REST definitely always) HTTP based so are firewall friendly and could be encrypted using SSL. Delphi 7 does SOAP, but doing your own REST isn't that difficult either.

The other option would be a 3rd party library like Data Abstract which might have better out of the box support for Multi-Tier, but you might lock yourself into a technology more.

That having said: I don't have extensive experience either of these in production.

Incoordinate answered 25/7, 2011 at 11:15 Comment(0)
A
2

You could take a look at our ORM framework, which implements an n-Tier Client-Server architecture over several protocols, including HTTP/1.1.

So it could help you build Client-Server applications over the Internet, using an ORM approach, and a n-Tier/SOA architecture.

The SOA (Service Oriented Architecture) can be used in an ORM Client-Server approach:

Take a look at the documentation, which can be downloaded as pdf files. There are some pages highlighting all those architecture aspects, in the first part of the SAD document:

  • MVC and Multi-Tier architecture;
  • Why an ORM (with advanced RTTI) - why it is not only a layer over the DB;
  • Why a Client/Server ORM;
  • Writing RESTful Services in a SOA approach;
  • ORM and SQL (via SQLite3 virtual tables, custom functions to access BLOB).

It's Open Source, working from Delphi 6 up to XE, full Unicode (even on Delphi 7, since it uses internally UTF-8 encoding, like JSON). So when you'll upgrade to a newer Delphi version, your code will still be valid. Could be useful.

Aylesbury answered 25/7, 2011 at 12:7 Comment(9)
Is it easy to use non-Delphi clients with this framework to access the REST resources using JSON?Weaverbird
Since the JSON content is standard, and since the REST commands are implemented (GET/POST/PUT/DELETE), you can access it from other clients which handle both procotols. See blog.synopse.info/post/2010/07/02/… and the framework documentation (there a chapter dedicated to the RESTful/JSON implementation).Aylesbury
+1. I have been experimenting with the Synopse stuff (Arnaud's work) and it's very high quality, and worth evaluating! I wish I could upvote twice for it using Unicode JSON (via Utf8 encoding) even in Delphi 7. Brilliant idea. Makes me regret wide-char Unicode when I think about the fact that even with 16bit Chars, there are still some multi-byte codes in Unicode... So why bother with UTF16 ever! Well except that basically ALL of Windows APIs are 16 bit WideChar based, and the narrow APIs only support win-MBCS-codepages... Which suck... :-)Lowell
@Arnaud Hey Arnaud, I have just spent 3 hours reading the docs and skimming the sample projects included :) To be honest I am impressed that there are people who spends their time for writing free opensource projects like you. But back to the topic. I will probably not use it unfortunately. I'have started looking rather for some kind of a transportation layer through TCP/IP and encryption, than ORM. JSON probably would fit my needs, but here is what i Wanted to achieve: I am SP(storedProc) and MSSQL guy.Ashleeashleigh
I believe in the code in SP and I have recently sticked to MSSQL server. (I just need to eecute SP to insert/update and fetch data from) I would probably have to write(rewrite) one of the TSQLRestServer descendant classes to operate on mssql database, besides It would have to be done in a thread-safe manner. Lots of code to write, lots of tests to perform, code open for bugs at my side and the lack of knowledge whether these all will work outAshleeashleigh
in production or not. Well I know I have just understood only main concepts of this huge framework and maybe if I knew this better I would try to write something but now I am a little discourage :)Ashleeashleigh
John - it's not a one-day mental leap from MS-SQL to an ORM based on SQLite. SQLite is incredible technology.Lowell
@Ashleeashleigh Thanks for your interrest, and taking the time to read the f****g manual. ;) I'm no native English, so it could be frustrating reading it. I understand you may feel a little discouraged, since it's not pedagogical. But the doc is also OpenSource, and there is the source (.pro text file), so I hope some day someone will help with my syntax. With the next version of the ORM, you'll be able to use MSSQL as backend, via direct OleDB link. About thread-safe, the framework is already thread-safe.Aylesbury
@Ashleeashleigh Note that SQLite3 will remain the core of the framework. Thanks to its Virtual Tables mechanism, you can mix database backends, i.e. mix native SQLite3 tables, and our fast in-memory JSON/Binary tables, or any SynDB database (MSSQL, Oracle via OCI, any OleDB database). With our framework, you can still write your own code in SPs if you want, then call remotely them via JSON RESTful services. I'm sure that re-using and expanding an existing framework like ours will finally spare your time.Aylesbury

© 2022 - 2024 — McMap. All rights reserved.