Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 19 total
Thread Recreating A Windows Application In EWB
Wed, Apr 18 2018 6:41 PMPermanent Link

Frederick Chin

I am attempting to recreate a DBISAM based Windows application in EWB and I would like your thoughts on the following:-

1.   In the Windows application, I dynamically create queries on the fly based on settings and parameters set by the user. How do I achieve the equivalent in EWB since there is no TDBISAMQuery with an SQL property?

2.   There are times when I create temporary tables during a query session and then delete them when the process is completed. In some cases, the tables are created and become a permanent part of the application. How do I achieve this in EWB?

3.   In Windows, it is easy for me to check the tables for correct structures and then update them if needed. Do I use a web module for this and if yes, does it mean that I have to purchase a DBISAM license to install in Rad Studio?

4.   The Windows application allow switching of the table locations based on the user's selection. In EWB, the database's location is defined in the IDE and cannot be changed at runtime. In my case, the application uses 250 tables. If I were to do it in EWB, I would need 4 databases with each having 250 datasets to allow me to switch between the databases. Is there a way to just create one database with 250 datasets and then change the DatabaseName property at runtime?

--
Frederick
Thu, Apr 19 2018 6:01 AMPermanent Link

Walter Matte

Tactical Business Corporation

Frederick:

This is a general post discussing of Web vs Desktop programming.

Both a Web Application and a Windows Application can do the same work - BUT - they do it differently.  You cannot design and write a Web Application the same way you write a Windows Application.

I look to EWB as the User Interface.   I lean on the Server Side (whether Delphi, C#, or any html scripting) to do work you are describing.  EWB Server with "your" coded DLL's to do the business rules and methods, can accomplish the task.

1. Dynamic Queries - the server side can do this.   Use EWB to collect the user input and send that to the Server and the Server can do the Query and send back results.  I do it all the time.

2. Temporary tables.  This has to be done on the server side.  I do it regularly for complex processing.

3. The need to check structure of tables and update them relates to deploying updates to the application?  In a Web deployed application are you hosting or do you see each of your customers hosting their own solution.  Provide a EXE during update to check and update tables structures.  This make no sense to include in the EWB side of things.

4. Hard to comment on a specific design - but I see all the database work being done on the server - it is never done in the EWB Client side.  


I know EWB 3 is expected to give Server side capabilities.  But regardless of what that is, it will have its limitations.  

Whatever back end server coding you choose needs to be a programming tool that can to do all the manipulation you require.

Walter


Frederick Chin wrote:

I am attempting to recreate a DBISAM based Windows application in EWB and I would like your thoughts on the following:-

1.   In the Windows application, I dynamically create queries on the fly based on settings and parameters set by the user. How do I achieve the equivalent in EWB since there is no TDBISAMQuery with an SQL property?

2.   There are times when I create temporary tables during a query session and then delete them when the process is completed. In some cases, the tables are created and become a permanent part of the application. How do I achieve this in EWB?

3.   In Windows, it is easy for me to check the tables for correct structures and then update them if needed. Do I use a web module for this and if yes, does it mean that I have to purchase a DBISAM license to install in Rad Studio?

4.   The Windows application allow switching of the table locations based on the user's selection. In EWB, the database's location is defined in the IDE and cannot be changed at runtime. In my case, the application uses 250 tables. If I were to do it in EWB, I would need 4 databases with each having 250 datasets to allow me to switch between the databases. Is there a way to just create one database with 250 datasets and then change the DatabaseName property at runtime?

--
Frederick
Thu, Apr 19 2018 10:35 AMPermanent Link

Frederick Chin

Walter,

/*
1. Dynamic Queries - the server side can do this.   Use EWB to collect the user input and send that to the Server and the Server can do the Query and send back results.  I do it all the time.

2. Temporary tables.  This has to be done on the server side.  I do it regularly for complex processing.
*/

Ok, I'll have to explore this further since I have never created a DLL yet. So far, I do all database work in EWB itself.

/*
3. The need to check structure of tables and update them relates to deploying updates to the application?  In a Web deployed application are you hosting or do you see each of your customers hosting their own solution.  Provide a EXE during update to check and update tables structures.  This make no sense to include in the EWB side of things.
*/

Correct. It is the process of deploying the updated application that the table structures are to be checked and updated, if necessary.

If the DLL route is possible, it would be the ideal way to check and update the table structures, regardless where the application is hosted, as it would be delivered as part of the application.

/*
4. Hard to comment on a specific design - but I see all the database work being done on the server - it is never done in the EWB Client side.  
*/

I gather that you don't use the database manager much? Smile

Taking my example of 250 tables and I have just one dataset for each defined in the database manager, and I have four directories containing 250 tables each, would I be able to include code in the DLL to reference data from any of the four directories depending on what the user selects?

--
Frederick
Thu, Apr 19 2018 1:32 PMPermanent Link

Walter Matte

Tactical Business Corporation

EDB Database Manager or DBISAM Database Manager to create tables or alter table structures.

Then in the EWB IDE after I add a dataset, I go to Columns and click the button "Import Items from a URL" -  I enter a URL to my Server(which I wrote) and it reverse engineers a query or a table and returns to EWB the columns.

Walter
Thu, Apr 19 2018 2:12 PMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 4/18/2018 6:41 PM, Frederick Chin wrote:
> 1.   In the Windows application, I dynamically create queries on the fly based on settings and parameters set by the user. How do I achieve the equivalent in EWB since there is no TDBISAMQuery with an SQL property?

Like Walter already said you need to this in the back end (web server).

EWB app is just javascript so assume that one can intercept 100% what
your app does - for good security practices you should avoid doing any
dynamic SQL creation or operations on the client side that might put
your data at risk.

Have a well defined API endpoints on server that do the actual heavy
lifting. This does usually mean redesigning some of the logic to
basically move some of the logic to server side.

> 2.   There are times when I create temporary tables during a query session and then delete them when the process is completed. In some cases, the tables are created and become a permanent part of the application. How do I achieve this in EWB?

Server side

> 3.   In Windows, it is easy for me to check the tables for correct structures and then update them if needed. Do I use a web module for this and if yes, does it mean that I have to purchase a DBISAM license to install in Rad Studio?

Module could do it or have your installer do this (assuming you have an
installer) or even stand-alone utility to run on server.

You do need DBISAM license at some point if you're planning to to table
restructuring and such and your data is in DBISAM.

Is the original DBISAM app also yours - you would have a license from
that i assume.

All this discussion of modules assumes you're going to use EWB Web
Server. Note that you can write your own server in any other language as
well (the only "ewb unique" thing in the web server is native support
for returning EWB JSON format for datasets. This can be done in any
other server side language as well.

If you still need to access DBISAM you would need DBISAM components still.


> 4.   The Windows application allow switching of the table locations based on the user's selection. In EWB, the database's location is defined in the IDE and cannot be changed at runtime. In my case, the application uses 250 tables. If I were to do it in EWB, I would need 4 databases with each having 250 datasets to allow me to switch between the databases. Is there a way to just create one database with 250 datasets and then change the DatabaseName property at runtime?

There are couple of things at play here.

IDE database is there just to make design time user friendly.

You can absolutely override the database name runtime to connect to any
of your 4 databases (assumes your tables structures are the same).

You do need to define the databases on ewb web server though.


Or if you're doing your own back end or module you could go even more
flexible

Raul
Fri, Apr 20 2018 11:43 AMPermanent Link

Frederick Chin

Raul wrote:

/*
Is the original DBISAM app also yours - you would have a license from
that i assume.
*/

It is my own app and I do have the licence for the DBISAM client server components with source but it is an older version of DBISAM that cannot be installed into Rad Studio. I have several reasons for not upgrading to the latest version but it is out-of-topic here.

/*
All this discussion of modules assumes you're going to use EWB Web
Server. Note that you can write your own server in any other language as
well (the only "ewb unique" thing in the web server is native support
for returning EWB JSON format for datasets. This can be done in any
other server side language as well.
*/

When you say any server side language, is it possible to say, use PHP to access DBISAM tables, process it and push the data back to the client. I am strictly working with DBISAM because it is the database used for most of my apps.

/*
If you still need to access DBISAM you would need DBISAM components still.
*/

I was thinking that I could create the web module from Rad Studio and then test it in EWB without having to install any DBISAM components in Rad Studio. (I may hit another DBISAM roadblock when I do reporting later)

/*
You can absolutely override the database name runtime to connect to any
of your 4 databases (assumes your tables structures are the same).
*/

I will have to perform the test again because I remembered that I could not do so and one of my apps actually had 4 databases of the same set of datasets and I switched between the 4 databases. Remember, I am talking about changing the path to the tables of a single database and not the name of the database to use.

--
Frederick
Fri, Apr 20 2018 11:46 AMPermanent Link

Frederick Chin

Walter Matte wrote:

/*
EDB Database Manager or DBISAM Database Manager to create tables or alter table structures.
*/

Yes.

/*
Then in the EWB IDE after I add a dataset, I go to Columns and click the button "Import Items from a URL" -  I enter a URL to my Server(which I wrote) and it reverse engineers a query or a table and returns to EWB the columns.
*/

Pretty advanced stuff and definitely way beyond my web programming capabilities.

--
Frederick
Fri, Apr 20 2018 12:25 PMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 4/20/2018 11:43 AM, Frederick Chin wrote:
> When you say any server side language, is it possible to say, use PHP to access DBISAM tables, process it and push the data back to the client. I am strictly working with DBISAM because it is the database used for most of my apps.

If you're only working with DBISAM then you would need some components.

You could use your existing Rad Studio/Delphi for example with the
components you have and write a web server.

In terms of PHP you would need to buy the DBISAM ODBC driver but yes it
should work(see
https://www.elevatesoft.com/products?category=dbisam&type=other). Note
that you would need to run all of this on Windows though since DBISAM is
windows only AFAIK.

> I was thinking that I could create the web module from Rad Studio and then test it in EWB without having to install any DBISAM components in Rad Studio. (I may hit another DBISAM roadblock when I do reporting later)

I have not really used modules enough myself so i can't really spaek to
specifics here. I suspect you would need DBISAM components here (i don't
think the built-in DBISAM support extends to custom modules - but could
be totally wrong).

> I will have to perform the test again because I remembered that I could not do so and one of my apps actually had 4 databases of the same set of datasets and I switched between the 4 databases. Remember, I am talking about changing the path to the tables of a single database and not the name of the database to use.

EWB has no concept of a DBISAM database path since it's a web app so all
it can do it populate the URL for data access.

This might not do what you need to.

Basically what you can do is change database name in EWB runtime but on
your back end (EWB web server) you do need all 4 defined. Note that all
those settings are in INI so you can just do copy/paste mass edit - not
trivial but not bad either.

If you want to fully control this from EWB then you can do so with your
own module but not with built-IN AFAIK

Raul
Sat, Apr 21 2018 9:24 PMPermanent Link

Frederick Chin

Raul wrote:

/*
You could use your existing Rad Studio/Delphi for example with the
components you have and write a web server.
*/

Can you point me to a starting point to write a web server? It seems that almost everyone is writing one. I might as well join in. Can I write one in Delphi 7?

/*
I have not really used modules enough myself so i can't really spaek to
specifics here. I suspect you would need DBISAM components here (i don't
think the built-in DBISAM support extends to custom modules - but could
be totally wrong).
*/

I'll research this further. Thanks.

/*
Basically what you can do is change database name in EWB runtime but on
your back end (EWB web server) you do need all 4 defined. Note that all
those settings are in INI so you can just do copy/paste mass edit - not
trivial but not bad either.
*/

I've done copying and pasting the same database definitions with different data paths but I am concerned about the size of the INI file file and if there is a limit.

/*
If you want to fully control this from EWB then you can do so with your
own module but not with built-IN AFAIK
*/

Noted

--
Frederick
Mon, Apr 23 2018 4:01 AMPermanent Link

Matthew Jones

Frederick Chin wrote:

> Can you point me to a starting point to write a web server? It seems that almost everyone is writing one. I might as well join in. Can I write one in Delphi 7?

Have a look back at previous postings. Various people have described their servers. I've used RemObjects SDK and C#/.Net web services personally.

I will also say that you may be suite surprised at how much time it takes to convert a desktop project into a web application. You get a lot of things "for free" in Delphi components that you have to code in web applications. Doing a "like for like" will be difficult and not get the best experience from the web.

--

Matthew Jones
Page 1 of 2Next Page
Jump to Page:  1 2
Image