where is laz-n-tier demos lazarus / 16-Databases ---------------------------------------------------------------------- lazpas · 2022-02-19 09:59 Hi,all I found this component as laz-n-tier,but its demo lazdemo not work. Any help is welcome. ps:https://sourceforge.net/projects/laz-n-tier/ ---------------------------------------------------------------------- Thaddy · 2022-02-19 10:43 That is a bit weird, since the standard Lazarus/FPC components support N-tier as standard: sqldb and family. Bit suspicious all that. I am not going to check that link. You do not need anything else because everything is already there.... And comes with plenty examples. ---------------------------------------------------------------------- lazpas · 2022-02-19 12:00 Quote from: Thaddy on February 19, 2022, 11:43:36 amThat is a bit weird, since the standard Lazarus/FPC components support N-tier as standard: sqldb and family. Bit suspicious all that. I am not going to check that link. You do not need anything else because everything is already there.... And comes with plenty examples. Thanks for reply. Could you give me some examples? ---------------------------------------------------------------------- Thaddy · 2022-02-19 12:04 The examples are in the packages/fcl-db/examples directory. ( and on the wiki some more) If you do have some specific requirements, just ask. Michael wrote some great articles on the subject here:https://www.freepascal.org/~michael/articles/ ---------------------------------------------------------------------- lazpas · 2022-02-19 12:14 Quote from: Thaddy on February 19, 2022, 01:04:56 pmThe examples are in the packages/fcl-db/examples directory. ( and on the wiki some more) :)Thank you for these informations. ibconnection component can use for multi tier? ---------------------------------------------------------------------- Thaddy · 2022-02-19 12:15 Yes it can, but you not need it. Basically running around old software is not the way to go. ---------------------------------------------------------------------- lazpas · 2022-02-19 13:16 Quote from: Thaddy on February 19, 2022, 01:15:52 pmYes it can, but you not need it. Basically running around old software is not the way to go. Now, without multiple layers, what to do?web? ---------------------------------------------------------------------- Thaddy · 2022-02-19 13:37 As many layers that you want are already supported, like I wrote. N-tier upto umptiest tier. What exactly is your problem? I have about six layers running in some applications. (mostly security related) ---------------------------------------------------------------------- lazpas · 2022-02-20 02:20 Quote from: Thaddy on February 19, 2022, 02:37:58 pmAs many layers that you want are already supported, like I wrote. N-tier upto umptiest tier. What exactly is your problem? I have about six layers running in some applications. (mostly security related) I plan to write a small database application for learning purposes. Client/server architecture. I heard that Layer 3 is safe and wanted to try it out, so I found this component. I don't know how sqldb implements three layers. You say that going back to old software is not the way to go, and I wonder what is appropriate at the moment. I would like to be advised. Thank you. ---------------------------------------------------------------------- af0815 · 2022-02-20 07:51 If you say Layer 3 is safe, what are the other layer. Only to understand what kind of layer you mean. ---------------------------------------------------------------------- Thaddy · 2022-02-20 08:10 The layers you implement yourself. In the example  I gave there are six layers to separate responsibilities'. There is one exposed layer for login etc. One layer to userinterface. Then there are several layers that should  not, and do not, share information between tables. Then there is a layer, that is completely separate, that can access those tables to perform queries. The last layer is behind a very strict firewall - no exposure - and queries are done as much as possible with stored procedures. That layer exposes its result to layer 2, but if and only if, the correct certificates are in place. All this is done using sqldb + MariaDb+ Openssl/tls 1.2 So there is a certificate chain on the intraweb servers and only the most exposed two really interact with users, but not with each other. (In essense, this is how banking software works (or is supposed to work)) ---------------------------------------------------------------------- PierceNg · 2022-02-20 08:16 Quote from: lazpas on February 19, 2022, 10:59:53 amHi,all I found this component as laz-n-tier,but its demo lazdemo not work. Any help is welcome. ps:https://sourceforge.net/projects/laz-n-tier/ I did not attempt to build and run, but glancing at the code, it uses Synapse to implement a network server, which then uses Zeos to talk to database. Code was written ~10 years ago so will need work to build with current Lazarus. Suggest you instead start with fpWeb tutorial and then the tutorials in the database portal. ---------------------------------------------------------------------- Thaddy · 2022-02-20 08:18 Yes and he needs to understand what N-tier actually is. ---------------------------------------------------------------------- lazpas · 2022-02-20 11:38 Quote from: af0815 on February 20, 2022, 08:51:12 amIf you say Layer 3 is safe, what are the other layer. Only to understand what kind of layer you mean. The three-tier architecture divides the entire business application into: user interface layer, business logic layer, and data access layer. ---------------------------------------------------------------------- lazpas · 2022-02-20 11:43 Quote from: Thaddy on February 20, 2022, 09:10:09 amThe layers you implement yourself. In the example  I gave there are six layers to separate responsibilities'. There is one exposed layer for login etc. One layer to userinterface. Then there are several layers that should  not, and do not, share information between tables. Then there is a layer, that is completely separate, that can access those tables to perform queries. The last layer is behind a very strict firewall - no exposure - and queries are done as much as possible with stored procedures. That layer exposes its result to layer 2, but if and only if, the correct certificates are in place. All this is done using sqldb + MariaDb+ Openssl/tls 1.2 So there is a certificate chain on the intraweb servers and only the most exposed two really interact with users, but not with each other. (In essense, this is how banking software works (or is supposed to work)) Thanks for help. ---------------------------------------------------------------------- lazpas · 2022-02-20 11:47 Quote from: PierceNg on February 20, 2022, 09:16:39 amQuote from: lazpas on February 19, 2022, 10:59:53 amHi,all I found this component as laz-n-tier,but its demo lazdemo not work. Any help is welcome. ps:https://sourceforge.net/projects/laz-n-tier/ I did not attempt to build and run, but glancing at the code, it uses Synapse to implement a network server, which then uses Zeos to talk to database. Code was written ~10 years ago so will need work to build with current Lazarus. Suggest you instead start with fpWeb tutorial and then the tutorials in the database portal. Thank you for the advice. ---------------------------------------------------------------------- lazpas · 2022-02-20 12:04 Quote from: lazpas on February 20, 2022, 12:38:15 pmQuote from: af0815 on February 20, 2022, 08:51:12 amIf you say Layer 3 is safe, what are the other layer. Only to understand what kind of layer you mean. The three-tier architecture divides the entire business application into: user interface layer, business logic layer, and data access layer. UI (Presentation Layer): Mainly refers to the interface that interacts with the user. BLL: (Business Logic Layer): The bridge between the UI layer and the DAL layer. Implement business logic. DAL: (Data Access Layer): Dealing with databases. It mainly realizes the addition, deletion, modification and investigation of data. Submits the data stored in the database to the business layer, and saves the data processed by the business layer to the database. ---------------------------------------------------------------------- wp · 2022-02-20 12:38 Quote from: PierceNg on February 20, 2022, 09:16:39 amI did not attempt to build and run[...] Using Laz 2.2/FPC 3.2.2/64-bit, I tried to compile the package and found only a few issues: It requires a very old version of ZEOS (package zeoslcl which does not exist any more). Either look for it on the zeos site (but there is doubt that it is still usable with today's laz/fpc versions), or remove it and add the package zcomponent.In the MemDBRedv.inc file, add the define OverRad2k7 to the FPC section:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$IFDEF FPC}   {$IFDEF MSWINDOWS}    {$DEFINE EnableLOG}  {$ENDIF}  {$DEFINE OverRad2k7}    // <---- ADDED{$ENDIF} With these modifications, the package compiles. It does not install, thought, because of a conflict with online-package-manager. I did not investigate any further, and resolved the issue by temporarily uninstalling OPM. Then the package could be installed. I could compile and run the server demo and the client demo (the latter causing a warning of the Windows firewall), but I did not test them, leaving this to the TS.