• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Question about compiled byte code

New Here ,
Apr 17, 2006 Apr 17, 2006

Copy link to clipboard

Copied


Howdy folks,

I have a client who wants to run an application in both on-line and off-line modes. The user could run the application locally on their laptop making changes and such which would get stored to local database files (probably FoxPro free tables just to make it easier on me). Then when the user got back to their internet connection they could run the application and it would sync with the online tables (probably MySql tables at that point).

So the question is, if I compile Cold Fusion code into Java byte code, will it be able to execute independantly of the Cold Fusion Server? I realize that I could load ColdFusion on the user's laptop, but I don't think I want to do that. I'm assuming that the answer to my question will be "No. You can't do that. Cold Fusion isn't meant to work like that." To which my next question would be, "Well, what language would be best for the type of application I have described above? Action Script, maybe?"

Any thoughts are welcome, especially if you've written an application like the one I've described.
Thanks very much,
Chris

Views

764

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 17, 2006 Apr 17, 2006

Copy link to clipboard

Copied

No "web" application actually runs that way, so I don't know how you would possibly do it using only web-enabled products. Even Javascript has security issues that cause it to run differently in a browser locally than it does when processed from a webserver.

If you need to just store DATA locally and then potentially synch that data to a web server's database for an already existing CF project ( or any WEB application for that matter - this inquiry is not isolated to CF) then why don't you actually create a FoxPro program for the user's desktop?

The user can then run the app offline, and then when online tell the FoxPro "program" to transfer the data to the server's database.

The same thing could be done with an Access database.

If you want to use FoxPro or Access plus a secondary app as a frontend, the you could create a program in something like VB, Director/Lingo, Flash, C#, C++, etc etc etc that would do the same thing ... but since FoxPro and Access have VB/programming abilities built-in, creating a standalone app would likely be easier, especially if it only needs to run on Windows.



Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 17, 2006 Apr 17, 2006

Copy link to clipboard

Copied

Thanks for posting Glen.

The short answer is that I don't know FoxPro nearly as well as I know Cold Fusion. I'm guessing that writing a desktop app in Fox is what I'll end up having to do, but I then post the question (and this is completely academic now):

Why is it that "No 'web' application actually runs that way..."?

With more and more businesses wanting to web-enable their applications isn't it remotely possible that they could run into a situation like the one I've described. Perhaps not larger business, but smaller ones. I'm specifically writing this for a therapist friend of mine who rarely if ever has an internet connection for her laptop while she's with a patient, but needs to enter information that will later be synced with an online application. I was hoping to not have to write two different programs in two different languages, you know?

I also realize that this issue isn't isolated to CF, I just know CF better than say, PHP, or VB etc. Also, there was this ability to compile the code into Java byte code that intrigued me.

I had initially thought of writing the code in JavaScript, but then remembered that I couldn't access files via that language. I realize and understand the security risk, but it's very limiting when you actually want to write a legitimate application using the language.

Anybody have any other thoughts or views (academic or otherwise) on this topic?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 17, 2006 Apr 17, 2006

Copy link to clipboard

Copied

Many applications are Web-enabled, and connect/disconnect-aware. This isn't a new situation.

What version of Fox are you running? The newer versions would work well for developing such an app. You could even embed a Web browser in the interface.

What's your Web data server? Do you administer it? It's possible to write an app that writes to the local DB and does a merge replication with the mothership at re-connection, but you have to make the proper replication settings to all participants.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 17, 2006 Apr 17, 2006

Copy link to clipboard

Copied

Thanks for posting philh! I always love it when folks think enough of my topics to bother responding to my posts.

I'd probably do it in Fox 6 or above. I'm not a big fan of West Wind Web stuff. I just wanted the simplicity of writing in CF (simple because I know it), although writing the interface in Fox would probably be easier (meaning: drag 'n drop, etc.). The app will be very simple (I think), and I'm not getting paid for it so anything new that I learn I have to do on my own time (unlike writing this post since I'm at a paying client right now...aaah but I'm at lunch so I'm not being unethical ;-)).

I wonder if there's any other reason that the Adob-romedia folks don't offer something like this? Then again, since flash and action script get compiled, maybe that's their answer. Has anybody ever used Flas/Action Script (or some combo there of), to do this sort of thing?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 17, 2006 Apr 17, 2006

Copy link to clipboard

Copied

You could do that in Java, by means of an applet. At the server end, Coldfusion MX can handle Java.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 17, 2006 Apr 17, 2006

Copy link to clipboard

Copied

Yeah, I could, except that I don't know java. Also (and this is anecdotal, of course), but a friend of mine who used to love java doesn't love it so much any more for quickly creating small apps. This guy is no dummy and is a good programmer, so I'm taking his word for it, but I'm not sure I could get up to speed on Java quick enough.

I know that Cold Fusion will handle java, which is why I was wondering if the "compiled byte code" could possibly run independant of the CFServer. That would be slick. Maybe it's time that I learn a bit of java and give coding this a go... but I'm on a bit of a time crunch.

I've considered storing any data entered offline in the form of a character delimited cookie (or series of cookies, maybe one cookie per record) and just writing the whole thing in JavaScript. JavaScript can set cookies, can't it? (Okay, now I've got to check... ... yup)

That may just be the way I go with this for the time being. It's not like this is an enterprise application, and I can control my ONE user's operating environment. How does that sound? Anybody see any problems with that, other than the user clearing their cookies prematurely of course

I suppose I could write a little batch file that would look for my cookies and write them to a safe place so that if they did clear their cookies it would still have those saved files as a backup. How about something like that?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 18, 2006 Apr 18, 2006

Copy link to clipboard

Copied

If you go by way of Javascript, you might want to spend some time on AJAX. It was in fact invented for fat clients like yours.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 18, 2006 Apr 18, 2006

Copy link to clipboard

Copied

LATEST
Well, rats.

I wrote a nice reply to your message BKBK, but lost it because, apparently, my session timed out.

The basic jist, was that I've been working on AJAX, and have been implementing some AJAX-like techniques at some other clients (using hidden iframes combined with innerHTML -- I know not a standard, but darn handy otherwise), but I couldn't see how that would solve my on-line/off-line problem (unless I stuck with the cookies idea).

I also did some reading on cookies last night (obviously, I don't use cookies very often if at all in my daily coding), and I'm a bit put off by the different browser limitations. I'd hate my client to be chugging along, entering appointments into the "database" (read: data being stored as cookies to be sync'd later when the user goes online), and then suddenly run into the cookie limitation. On top of that, if I'm reading right, IE (my client's most likely choise of browser), will not let you know that you've reached this limit, but will just begin dropping the older cookies in favor of the newer ones. If I could programmatically sense this limitation and then write the cookies to some file before continuing that'd be geat, but since JavaScript can't write files (that I know of) this isn't feasable. Also, if I could write a file like that, I wouldn't bother with the cookies.

I think I'm going to end up writing it in FoxPro since my company has a bunch of copies of it (and it's licenced per developer and not per copy), and there are lots of folks in my company who can help me get up to speed. That also means that I'll probably need to write a web version of the code for when my client's client's (does that make sense? 🙂 ) connect to the app via the internet.

Anyway, I'm really enjoying everyones comments on the subject. Can anybody think of a technique for a way around the cookie limitations? Or perhaps another language that this whole thing could be written in?

I really wish that I could compile my ColdFusion code for use independant of the CF server. I know, that's not the way it works and typically not what scripting languages like this are used for. I suppose I could always install the developer's version of CF on the user's local machine, write the code in CF and then just detect whether or not the user is online and behave accordingly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation