Recent

Author Topic: Database on the Internet  (Read 18398 times)

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1186
Re: Database on the Internet
« Reply #15 on: November 08, 2015, 03:32:07 pm »
Webservice as I state above. The protocol is up to you, but JSON based REST web services are so damn popular nowadays, though SOAP services still exist alongside.
I agree. The book I mentioned above introduces RPC and SOAP, but mainly it introduces JSON, XML and REST. It's a book for beginners on webservices in PHP.

If your hosting supports at least CGI, using Pascal on both sides would be easier for maintenance.
Here comes the problem. Cheap hosting usually does not support CGIs of any kind, that's why we are forced to use a solution outside Lazarus/Free Pascal. This solution usually goes on PHP.

shobits1

  • Sr. Member
  • ****
  • Posts: 271
  • .
Re: Database on the Internet
« Reply #16 on: November 08, 2015, 08:06:38 pm »
@DonAlfredo
when I said best, I meant the flexibility, performance, crossplatform, features, documentation, design, stability under stress... and anything that can be plus to the framework.

Anyway I'm planning to develop a client/server software for the faculty I work in, the main objective is to help administration personnel and teachers to track the scores and records (etc...) of each student and easify the processes of registration and orientation. also there should be access level control (not all users have equal privilege and teachers can only see the students they teach).
after that (secondary objective) I plan to deploy web interface which students can access to track their own records and see latest announcement of the faculty or the department they belong to.
Ultimately the software would grow to be university management system of some sort.

Now based on your experience should I go tiopf or mormot (I didn't use any of them so I can't just decide).

also I read that mormot don't handle RTTI under FPC correctly or FPC don't (I don't remember), what are the affected features.

since reports will be major part of the software, how easy to use mormot reporting system (pdf generator); is tiopf has similaire feature; and if I want to use say lazreport how do I do it.

thanks  :)

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1869
Re: Database on the Internet
« Reply #17 on: November 08, 2015, 09:47:04 pm »
AFAIK (but I am also quite sure about it), mORMot only needs (the new) RTTI when using interfaces for client - server communication.

My apps use simple CRUD methods, with some specialized SQL.
No RTTI is needed in this case.

If you want to start with mORMot, just start with the samples.
These samples will lead the way.
Many users of mORMot start with a sample to build there own app.
Samples 1,2 26 and 27 are very informative.

And, if you want to use the advanced RTTI, just install FPC with RTTI from the special RTTI branch.
You can use fpcup e.g.: fpcup --fpcURL="RTTI" --installdir="C:\fpcrtti"

Graeme

  • Hero Member
  • *****
  • Posts: 1496
    • Graeme on the web
Re: Database on the Internet
« Reply #18 on: November 09, 2015, 01:45:28 am »
Now based on your experience should I go tiopf or mormot (I didn't use any of them so I can't just decide).
The software you described is typical admin/schedule type software. I have written three such systems in the past all using tiOPF. One of those are used in a franchisee environment with 2500 franchisees. The system can be deployed in a Client/Server or 3-tier environment - simply by me changing 1 compiler define. Because our business logic and UI layers were clearly separated, we could use the necessary business objects to build a web front-end too.

One of tiOPF's larger demos show such a setup. Client/Server and 3-tier. Then also shows the same client application implemented as a Console, VCL, fpGUI and Web app.

Quote
since reports will be major part of the software, how easy to use mormot reporting system (pdf generator); is tiopf has similaire feature; and if I want to use say lazreport how do I do it.
Reporting is not a problem either. tiOPF includes its own (optional) reporting based or RTF template files. Write the report template using OpenOffice, LibreOffice or MS Word - in a .RTF file. The report engine then translates that into a full report. We used OpenOffice to display the report too - in a read-only mode which was very nice actually, because OpenOffice hides all ending functionality so it looks like a "print preview" screen.

You can use other reporting too. After years of using the RTF reporting, we switched to PDF reporting - functionality built into fpGUI.

TDataset based reporting tools can also be used, as tiOPF supplies a TtiDataset class which translates Objects into a compatible TDataset. I've never personally used this before, but know of many other that do use this - especially for reporting.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

Dr.Theopolis

  • Jr. Member
  • **
  • Posts: 69
Re: Database on the Internet
« Reply #19 on: November 09, 2015, 03:27:29 am »
What I have always wanted but have never found is a way to connect my application running at home to a MySQL database running on my shared web hosting server over http with a php script in the middle. That is what I want; it will always work no matter what cheapo web hosting service I use. Does anyone know of an existing solutions for that?

When I ask about an existing solution, I appreciate the information that was provided about how one would go about making a complete solutions. But what I am asking is if someone has already done it. Year after year I think about sitting down and writing the components and php script that would go together to accomplish what I described. I already know how to do it. It is just hard to believe nobody has already done it.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1186
Re: Database on the Internet
« Reply #20 on: November 09, 2015, 04:08:15 am »
When I ask about an existing solution, I appreciate the information that was provided about how one would go about making a complete solutions. But what I am asking is if someone has already done it. Year after year I think about sitting down and writing the components and php script that would go together to accomplish what I described. I already know how to do it. It is just hard to believe nobody has already done it.

Yes, I have already done it using PHP on the server side (webservices on some hosting companies) and Lazarus (Free Pascal) and Android (Java) on the client side consuming those webservices.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Database on the Internet
« Reply #21 on: November 09, 2015, 06:11:46 am »
When I ask about an existing solution, I appreciate the information that was provided about how one would go about making a complete solutions. But what I am asking is if someone has already done it. Year after year I think about sitting down and writing the components and php script that would go together to accomplish what I described. I already know how to do it. It is just hard to believe nobody has already done it.
I believe many of us has already done it, not necessarily Pascal client with PHP server, though. When developing/consuming webservices, protocols matter more than language. I have interfaced Pascal with some web services (Twitter, Plurk, Instagram, etc.) I don't even know what language is behind the service.

Dr.Theopolis

  • Jr. Member
  • **
  • Posts: 69
Re: Database on the Internet
« Reply #22 on: November 09, 2015, 07:44:22 am »
When I ask about an existing solution, I appreciate the information that was provided about how one would go about making a complete solutions. But what I am asking is if someone has already done it. Year after year I think about sitting down and writing the components and php script that would go together to accomplish what I described. I already know how to do it. It is just hard to believe nobody has already done it.

Yes, I have already done it using PHP on the server side (webservices on some hosting companies) and Lazarus (Free Pascal) and Android (Java) on the client side consuming those webservices.

Did you make TDatabase and TSQLQuery descendents that connect to database on a remote server over http?

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1186
Re: Database on the Internet
« Reply #23 on: November 09, 2015, 03:49:04 pm »
Yes, I have already done it using PHP on the server side (webservices on some hosting companies) and Lazarus (Free Pascal) and Android (Java) on the client side consuming those webservices.

Did you make TDatabase and TSQLQuery descendents that connect to database on a remote server over http?

No, it's not possible (or is too effortful) to connect Lazarus' datasets to PDO's PHP.

Yes, I have made a straight connection from Lazarus' datasets to the database server via http, but the result was not good: security challenges made the project more expensive, slowness due to high latency of http increased costumers' complains too much and higher network traffic made the project more expensive. That database server (web hosting company) did not accept Pascal CGIs.

See the disadvantages of data aware controls on Internet here:
http://tiopf.sourceforge.net/Doc/Concepts/1_WhatIsAnOPF.shtml

 

TinyPortal © 2005-2018