HMGSCRIPT 2012: Programming For The Web in The Right Way :)

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Roberto Lopez »

rathinagiri wrote:In that case, can we mingle uhttp and websocket server so that we can use single Harbour server to produce both html and data over network?
Eventually yes.

But I'm not interested in generating dynamic html pages from a Harbour server. That is the classic/old model with all the problems related to sessions, security, speed and program logic.

The HMGSCRIPT idea is that the program logic be in the client with the server providing data services (basically: query, append, delete and modify tables).

In such context, we only need an http server to make our client applications available (html+javascript). Those applications will connect with a websockets server to manage data.

The beauty of this is that (eventually) we could change servers, from (ie) a Harbour websockets server to a PHP one, capable to manage MySql.

Despite this (of course) everyone can made their choice and use mixed programming models, but IMHO that will only make the things more complex.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5481
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Rathinagiri »

I do like the thin server concept. This will make the server free.

IMHO, raw data (with encryption and compression if possible) shall be sent over the network by the server and html pages creation (even tagging like <td><tr><tr/></td>) shall be done at client side. This will save the bandwidth a lot.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Roberto Lopez »

rathinagiri wrote:I do like the thin server concept. This will make the server free.

IMHO, raw data (with encryption and compression if possible) shall be sent over the network by the server and html pages creation (even tagging like <td><tr><tr/></td>) shall be done at client side. This will save the bandwidth a lot.
Regarding (ie) query sample, a more clean design should send the data to the client in xml, json or any other format, then decode in the client and 'load' the table with it.

But consider that encoding the data (ie) in xml, will add some load to the original data, making bigger, as the table tags do.

We must study this carefully.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5481
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Rathinagiri »

Yes. There are open source Pure JavaScript GZip decompressors available. And if we can gzip the whole thing at the server and send that will be nice.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Roberto Lopez »

rathinagiri wrote:Yes. There are open source Pure JavaScript GZip decompressors available. And if we can gzip the whole thing at the server and send that will be nice.
Sounds good.

Anyway, prior to that, we must create a nice generic query function on the server to avoiding to recode every time we need a new one for other table and/or filter conditions.

I'm facing a problem with that, since doing this:

Code: Select all

   Button( 'button_1' , 'win' , 390 , 110 , "Exec. QueryTest() " , "SendMessage( 'QueryTest()' , processresponse );" );  
Works fine, but, trying to include a character parameter to specify table name, the JS application crash. ie:

Code: Select all

   Button( 'button_1' , 'win' , 390 , 110 , "Exec. QueryTest() " , "SendMessage( 'QueryTest( "test" )' , processresponse );" );  
I'm stuck here...

Making only four generic routines like these:

Query ( cTable , cFIlter , cOrder , aFields )
Append ( cTable , aFields, aValues)
Replace ( cTable , cForCondition , aFields, aValues )
Delete ( cTable , cForCondition )

We will not need to create our own server routines in most cases and we could easily adapt them for another websockets server (ie: a PHP one) that we could host everywhere (no necessarily an in-house server).

ANy help with JS problem described above is welcome.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5481
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Rathinagiri »

Can't we do like this and alter prg source to accommodate this?

Code: Select all

Button( 'button_1' , 'win' , 390 , 110 , "Exec. QueryTest() " , "SendMessage( 'QueryTest( )', 'test' , processresponse );" );  
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Roberto Lopez »

rathinagiri wrote:Can't we do like this and alter prg source to accommodate this?

Code: Select all

Button( 'button_1' , 'win' , 390 , 110 , "Exec. QueryTest() " , "SendMessage( 'QueryTest( )', 'test' , processresponse );" );  
I'm trying to make it in the most intuitive and easy way as possible... I'll still thinking about that...
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
apais
Posts: 440
Joined: Fri Aug 01, 2008 6:03 pm
DBs Used: DBF
Location: uruguay
Contact:

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by apais »

since clipper days [ and ] are also string delimiters IE: Querytest([string])
Angel Pais
Web Apps consultant/architect/developer.
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Roberto Lopez »

HMGSCRIPT R011

I've added 'Panel'. it serves as container. It is basically a scrollable div intended to be an HTML container (I've used in the server demo to put the query table there).

I've enhanced server query() function. It includes now checkboxes. I've changed the client too. It allows to select/unselect rows, show selected rows content and change cell content.

Enjoy!
Attachments
hmgs011.zip
(613.91 KiB) Downloaded 257 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Roberto Lopez »

apais wrote:since clipper days [ and ] are also string delimiters IE: Querytest([string])
It Works!

I've use Clipper since Autumn'86 and I've don't knew that :)

Thanks!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply