Announcement

Collapse
No announcement yet.

An alternative approach to GUI!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • An alternative approach to GUI!

    Ladies and Gentlemen

    As Black Adder used to say, "I have a cunning plan” and thought you might find it useful.

    Unfortunately I cannot post any code as my work belongs to my employer. However, I came up with the original idea before he hired me. Since he refuses to look at Powerbasic then I guess it is his loss.

    I will explain the concept in broad terms and then you are on your own. Some feedback would be nice.

    When speed of the GUI is not an issue we can use a web browser as our GUI front-end. Here is how…

    We write all the application's logic in Powerbasic and compile it into an .exe. When the plication is invoked, it will show a very simple Dialog/Splash screen (simple stuff in DDT). If necessary, we ask for username and password here. Then the program will detect and show the IP address of the PC (in large friendly letters ). The program then invokes the browser and “serves” a “default.html” file to the browser and minimises itself. What is in the browser is our application’s main “screen”.

    The program then enters the main loop and monitors “Port 80” for user interaction. The entire user interface is handled through HTML pages and a browser. The program either dynamically builds the HTML pages in memory or retrieves them from the disk and modifies them through text substitution.

    The advantages are many. Here are some of them…

    1. We do not need to worry about Windows messages and callback functions any more.
    2. We do not need to learn DDT or API and the complexities of Windows GUI. Just HTML/XML.
    3. As HTML and XML standards evolve we can do better and better user interfaces.
    4. Our applications can be content driven.
    5. We can change the user interface very quickly.

    Of course this is not appropriate for every application and there are many disadvantages too .

    Obviously performance is a major consideration, but as someone suggested before, many applications sit idle most of the time while the user or the database back-end do their bit.

    This option will give us total independence from Windows native GUI and can be used with any language. PB/CC and PB/DLL are obviously among the best.

    The fact that these programs can also communicate with other similar programs through “Port 80” over any TCP/IP connection should open interesting avenues for distributed computing.

    If the concept is successful then Bob Zale and his team can consider introducing native support for this model at the compiler level.

    I know this sounds quite revolutionary and GUI elements in a browses are not as mature as Windows native GUI. But lateral thinking never hurt anyone.

    Siamack




    [This message has been edited by Siamack Yousofi (edited March 06, 2000).]

  • #2
    Hello,

    One of my school projects using a Java app (servlets) used this idea to create a web-based application. The application sits on the server, the client simply uses a browser window.

    Like you said, there are MANY advantages to this, especially in programs that can use a simple interface.

    I have not heard of any one using this though for a single stand alone app on a single computer. Could be useful though. I'll definitely keep the idea around

    Thanks,
    Colin Schmidt

    ------------------
    Colin Schmidt & James Duffy, Praxis Enterprises, Canada

    Comment


    • #3
      So, what happens if people don't have a browser installed? Many
      are still using Win95 and if the machine they are working on isn't
      connected to the Internet, they have no need for a browser.

      I actually have several machines myself that I use for different
      tasks, with no browser components installed in them - and I would
      prefer to continue to have it like that too..


      ------------------

      Comment


      • #4
        Colin

        I used Java in a few projects. More accurately I was forced to use Java.

        Like many technologies it started with a big splash and many promises. All reasoning behind it like "virtual machine architecture", OOP, etc. are very valid. Unfortunately performance suffers as we add layers over layers of software components.

        Major vendors started re-writing their apps in java and all of them have now abandoned these projects due to performance issues. Just in time compilation is an after-thought and sometimes mis-fires. Java is well on its way to becoming just another language.

        Some argue that as PC's get more and more powerful the performance issue will become irrelevant . The fact is that on the same "powerful" future PCs, Powerbasic will even outperform the Concord.

        In other words the performance gap between Powerbasic and VB or Java will always be there.

        In the model I am suggesting we use Powerbasic’s performance for doing process intensive work and HTML/XML for user interface.

        If this concept works, Powerbasic or one of us could write an optimised, no fat, dedicated “browser” for free distribution . In other words we can totally redefine GUI by separating the “compiled” logic and the “interpreted” user interface.

        What I am proposing has particular merit with PB/CC, PB/Linux and those who are making the transition from DOS and do not have time or inclination to learn Windows API.

        Currently, I am up to my [email protected]# in alligators and can not work on this . May be David, Lance, Powerbasic R&D or someone in this forum could investigate this and write an example framework that we could all use and include in our projects . Once the framework is written it needs very little change.

        Siamack

        P.S. Eric Olsen has done some of the work for us in his HTTP server example.


        ------------------




        [This message has been edited by Siamack Yousofi (edited February 24, 2000).]

        Comment


        • #5
          Borje

          People who do not have browsers can pay extera for all the work that goes into doing native Windows GUI.

          Remember this is only an alternative. It is indeed useless in many situations.

          Siamack

          ------------------

          Comment


          • #6
            Yes of course, I understand that and it's an interesting idea. I wouldn't
            want to be in charge of the support for an application that only can be used
            in browser-enabled systems though..


            ------------------

            Comment


            • #7
              The fact is that using a UI description language like XML we would not be tied to using a browser for the UI. I can imagine a designer which has mappings to DDT, SDK style code as well as HTML/XML markup.

              This would mean you could change the look and feel of your app or benefit from native speed by having your XML translate to SDK style code.

              I see lots of possibilities. I am (among many other things) working on an XML parser for Powerbasic as I'm not aware of such as beast...

              Cheers

              Florent

              ------------------

              Comment


              • #8
                <<
                I see lots of possibilities. I am (among many other things) working on an XML parser for Powerbasic as I'm not aware of such as beast...
                >>
                I would suggest to use the (free) one provided with IE4/5
                and available in the form of a COM component object model
                exposed as a DLL, and fully usable using JA COM/PB 2.0...

                Your idea of describing a UI interface in the form of an XML
                file is excellent. I was even thinking that it would be
                interesting to store the semantical analyzis of a PB (for example) program in such a form, and then apply a large number
                of services to such descriptions: code instrumentation/profiling,
                an IDE with syntax checking, intellisense technology, language
                translators to the turn the initial code into C and then have
                it compiled by one of the Linux free compilers and make PB Linux
                compatible and multiplatform in one step if you provide the PB runtime with its C source code...

                Philippe Monteil
                JAZZAge Software
                http://www.jazzagesoft.com



                ------------------

                Comment


                • #9
                  Hi Philippe

                  using the free IE XMLParser with JACOMPB IS interesting - OTOH I might still continue the hand-coded version as I've made a good start (I'll look into it 8)...

                  I was even thinking that it would be
                  interesting to store the semantical analyzis of a PB (for example) program in such a form, and then apply a large number
                  of services to such descriptions: code instrumentation/profiling,
                  an IDE with syntax checking, intellisense technology, language
                  translators to the turn the initial code into C and then have
                  it compiled by one of the Linux free compilers and make PB Linux
                  compatible and multiplatform in one step if you provide the PB runtime with its C source code...
                  Good stuff! Adding a preprocessor for PB would be straight forward when applying XML for code description/instrumentation as well as for UI description. This would be a very interesting project... (hmmm)

                  Cheers

                  Florent



                  ------------------

                  Comment


                  • #10
                    Quite a while back I thought it would be easy to convert
                    accounting reports into html tables. That way we could have
                    fancy fonts and all, right and left justification. And it was
                    very easy to do.

                    However, I soon found that, at the time, there was no way to
                    print them with headers repeated. Has that situation changed ?
                    Can todays browers print with table headers repeated ?


                    ------------------

                    Comment


                    • #11
                      Hi John

                      if I understand you properly you want to display long reports as HTML tables - as the user scrolls down he does not see the column headers.

                      There several ways you could do this - the easiest way I can think of is to use frames. You would display the column headers in one frame and have the user scroll to look at the records which would be contained in another frame. That way the column headers would always visible.

                      Cheers

                      Florent

                      ------------------

                      Comment


                      • #12
                        Print to a printer, with headings repeated on each page.
                        Regular reports are sort of dull, html tables can use
                        proportional fonts with numbers right justified so they line up.


                        ------------------

                        Comment


                        • #13
                          Florent

                          Your idea for using XML as a resource definition language is brilliant. You did suggest it in the "visual design tool" thread and IMHO it should be taken seriously by those who are thinking of developing such tools for Powerbasic.

                          In fact future resource editors would possibly create resource scripts in XML instead of the current plain text format.

                          However, my suggestion at the beginning of the current discussion was to offer an alternative technique that we could use right now with what we have. Once the concept is proven as workable, a logical path for future development would present itself.

                          It is possible to take Eric Olson's "HTTP server" example and modify it to do what I am suggesting.

                          It just needs someone with a bit of spare time to investigate the practicality of the concept.


                          Siamack


                          ------------------


                          [This message has been edited by Siamack Yousofi (edited February 26, 2000).]

                          Comment


                          • #14
                            Hi Siamack

                            FWIW I've been exploring the possibility of using a browser as a UI component. I've got a half-clobbering example of an app - the PB app is implemented as single-threaded concurrent server using a "select" loop ISO of Eric's HTTP server. When it's a bit further along I'll be happy to post the code.

                            However, even at that early stage many problems become apparent: using a browser (IE is the most advanced at the moment) does not IMO simplify UI design. To get any non-trivial UI interface together requires a thorough grounding in HTML as well as a good working knowledge of Javascript/Jscript. The interaction between the page elements and the PB server app rapidly become complex.

                            Implementing some kind of CGI is straightforward - but updating parts of the page ISO just presenting a new page requires using (I won't mention XML data islands or other forms of data binding) numerous frames which again complicates UI design.

                            Additionally, Microsoft has been extending IE so that it is becoming an application development tool in its own right. As an example see the code below. Cut and paste the code and save it to a file with an HTA (HTML Application) extension as in "test.hta". You can provide an icon in the current directory so that you'll see an application icon. Test the code by invoking it from the command line: test.hta

                            Note that this example requires IE5 (might work with IE4)
                            Code:
                            <HTML>
                            <HEAD>
                            <TITLE>Test Application</TITLE>
                            <HTA:APPLICATION ID="Test App"
                                 APPLICATIONNAME="myApp"
                                 BORDER="thin"
                                 BORDERSTYLE="complex"
                                 CAPTION="yes"
                                 MAXIMIZEBUTTON="yes"
                                 MINIMIZEBUTTON="yes"
                                 SHOWINTASKBAR="yes"
                                 SINGLEINSTANCE="yes"
                                 SYSMENU="yes"
                                 VERSION="1.0"
                                 SCROLL="no"
                                 ICON="Gnome.ico"
                                 >
                            </HEAD>
                            <BODY>
                            This is a simple HTML Application.
                            <BR>
                            <BUTTON onclick="self.close()">Exit</BUTTON>
                            </BODY>
                            </HTML>
                            If you were able to run the code, you'll see that very much is possible (when using IE4/5). Can we get the best of both worlds (simple UI and PB speed and syntax? I think that the answer is: yes, to a point, but it is complex. The point being that I do not see the development cycle becoming easier/faster than using DDT/the API let alone a Visual Designer. Supplying the right framework/tools might hide a lot of the complexity but I don't know if it's worth the trouble.

                            Implementing the PB server side you basically get the following beast: a lightweight server serving documents/data on the client side. The client does not need a webserver. You can make sure that the HTML page requests data using a particular port, etc..

                            In essence you get a lightweight, personal application server. Again is it worth the trouble when you can essentially install the light version of "Cold Fusion" or some other app server on your client's computer and have a lot more functionality "out of the box" - if you need speed you can always spawn off a PB app to deliver the information.

                            My personal opinion is that it's not worth the effort, although, as I said, I will post the prototype as soon as it's ready for human consumption .

                            I think that the way to go is with a description language, layout designers, ideally using XML - which can be used as a common language by all Visual designers.

                            Stay tuned

                            Cheers

                            Florent

                            ------------------

                            Comment


                            • #15
                              florent

                              i see your point about the complexity of the html/javascript page negating the advantages of this model.

                              we are all so used to windows that it is natural to think in windows gui terms when we design web pages. if we think within html limits then may be a simpler interface could do the trick for certain applications.

                              after all the real advantage of a browser interface is its "content-driven" paradigm. many web designers seem to have forgotten about this capability and are carried away with fancy graphics and special effects.

                              i am very grateful to you for trying out this idea. obviously, it will not be a universal method of gui design but if it proves useful even for specific applications where user interaction is minimal then we have an alternative solution.

                              since the application can send the data to the browser without waiting for a "request" then we have some sort of "push" technology right away. it may also prove more useful on linux where the os and its many gui front-ends are in a constant state of flux.

                              i forgot to mention before but greg turgeon posted the code for a utility that allows us to embed any file in an exe or dll




                              i used it in conjunction with eric olson's http server and created an "instanet" where web pages are linked into the executable and are modified through text substitution just before they are served. text substitution is in the same way eric has done it in his example. the result is a single exe containing both the server and content that you can run from the floppy. nothing needs to reside on the pc. combine this with the model i am proposing and we have some very clever stuff.

                              i think no matter what the outcome, it is worth a try. thank you again for investigating the idea.


                              siamack


                              ------------------


                              [this message has been edited by siamack yousofi (edited february 26, 2000).]

                              Comment


                              • #16
                                Originally posted by Siamack Yousofi:

                                I forgot to mention before but Greg Turgeon posted the code for a utility that allows us to embed any file in an EXE or DLL
                                You can do the same thing using the rsrc utility ( or now with BRC32 from the free BC++ 5.5 download) and a standard rc file.

                                Saves you having to recompile the bas source evertime you need changes.

                                James




                                ------------------

                                Comment


                                • #17
                                  James

                                  Thanks for the tip. I shall have a look. Where can I find rsrc utility?

                                  Siamack

                                  ------------------


                                  [This message has been edited by Siamack Yousofi (edited February 27, 2000).]

                                  Comment


                                  • #18
                                    Originally posted by Siamack Yousofi:
                                    James

                                    Thanks for the tip. I shall have a look. Where can I find rsrc utility?

                                    Siamack

                                    www.capital.net/com/jcfuller/rsrc.zip


                                    ------------------

                                    Comment


                                    • #19
                                      Thank you.

                                      ------------------

                                      Comment


                                      • #20
                                        Siamack Yousofi
                                        Philippe Monteil

                                        Yousofi, your idea (which I also have been working on) is right on que!
                                        Monteil, when I purchased your skin, I had asked you for the source to the html/help file. This engine of yours does exactly what Siamack was talking about. In fact, many of clients are now using my program, because of your software, which I'm unlimited in what I can do with HTML & PowerBasic together.

                                        If others out there don't know what I'm talking about, contact
                                        Philippe Monteil and ask for a demo of the skwebber application. This is a simple example, but gives you an idea what some of the possiblities are! I can now create html files as I need them and delete them when I'm done, using a simple PB DLL file. I now label my html (dll's) of what the content is. No reason to add this to my fast exe file.

                                        As far as I'm concern, Philippe has already done the work for me. All I have to do is design my html pages. Couldn't haven't any better than this!

                                        My $.02 worth!

                                        MWM Consulting



                                        ------------------
                                        mwm
                                        mwm

                                        Comment

                                        Working...
                                        X