Desktop : Good practice

  1. #1

    Desktop : Good practice

    Hi!

    I develop a desktop application with several windows.
    Each windows is associated to an aspx page.
    I create the window dynamically specifying the source of the frame to the good aspx page.

    In each window (aspx file) I include some javascript file and some of the window use the same js files.
    It works fine but I want to know if it is the best way to manage windows.
    If I debug (in client side) my web app, I see all the js files loaded in the browser.
    If I do a close (action = close) on the window, I still view the js file in memory in the browser.
    I feel that each time I open a window, it reload the js files in memory (duplication of the files) event it is used in cache.

    Another way could be to load ALL the js files in the main desktop window and do a reference from each child window ?

    For you, is it correct or not ?
    What should I do to optimize ?

    Thanks.
  2. #2
    Hi,

    Please clarify the following.

    If I do a close (action = close) on the window
    Do you mean CloseAction="Close" of DesktopWindows?

    If I do a close (action = close) on the window, I still view the js file in memory in the browser.
    How can you see the JS files remain in the browser memory?

    I feel that each time I open a window, it reload the js files in memory (duplication of the files) event it is used in cache.
    Why do you think the are duplicated? Why do you think they don't come from browser cache? What are the requests statuses?
  3. #3
    Hi Dannii,


    1. When I create dynamically the window I specify action = close in the config of the window. After I use the close method of the window to close it.
    2. I use Firebug and the web dev tool of IE9 to debug. I go to the script tab and the list is empty before debugging. If I create a window, I can see the js files used in the aspx page in the list.
    3. If I close the window (method close) I still view the js files in the list. If I reload the same window it will use the same js files from the cache. But if I create a new window with same js files referenced in the aspx page, I will see duplicated js files in the list of the IE debugger. I imagine that it will use memory and the system will become slow.


    Other thing, in the debugger I see a lot of "ext.axd?v=21133/eval/seq" or something like this. The content comes from ExtJS and Ext.Net (1.2) and I saw different version of ExtJS in the files 2.2, 3.3, 3.4, ...
    Is it normal ?

    I saw too that my web site used ext-base and ext-all. I need both ?

    I want to optimize the creation and the display of each window. If I create dynamically (with javascript) the window without frame, it is immediate.
    If I use frame with src=...aspx it is more slowly. I think it is normal (due to a server access).
    I imagined a way where all the js files where referenced in the main desktop window. I don't know if it could be optimized, faster and use less memory?

    Thank you !
    Yannis.
  4. #4
    Quote Originally Posted by Yannis View Post

    1. When I create dynamically the window I specify action = close in the config of the window. After I use the close method of the window to close it.


    The CloseAction is only affected when clicked the "close" button in the header.

    But your choice to use the close method to close and destroy a Window instance is correct.

    Quote Originally Posted by Yannis View Post
    2. I use Firebug and the web dev tool of IE9 to debug. I go to the script tab and the list is empty before debugging. If I create a window, I can see the js files used in the aspx page in the list
    3. If I close the window (method close) I still view the js files in the list. If I reload the same window it will use the same js files from the cache. But if I create a new window with same js files referenced in the aspx page, I will see duplicated js files in the list of the IE debugger. I imagine that it will use memory and the system will become slow.
    I understand now, you are talking about iframes. Yes, each iframe loads its own instances of resources. This is a disadvantage of iframe and there is no any workaround.

    Quote Originally Posted by Yannis View Post
    Other thing, in the debugger I see a lot of "ext.axd?v=21133/eval/seq" or something like this. The content comes from ExtJS and Ext.Net (1.2) and I saw different version of ExtJS in the files 2.2, 3.3, 3.4, ...
    Is it normal ?
    Generally, there should not be different versions. Though a different version might appear in some plugin or extension script if their docs was not updated. I've seen old versions in some plugins and extension. Don't worry about it, they are really ready to use within Ext.NET.

    Here is some more info about these "ext.axd?v=21133/eval/seq" scripts.
    http://groups.google.com/group/fireb...e549a2ff?pli=1


    Quote Originally Posted by Yannis View Post
    I saw too that my web site used ext-base and ext-all. I need both ?
    As far as I can understand you mean these scripts:
    <script type="text/javascript" src="/extjs/adapter/ext/ext-base-debug-js/ext.axd?v=36704"></script>
    <script type="text/javascript" src="/extjs/ext-all-debug-js/ext.axd?v=36704"></script>
    Yes, they are required both. Don't worry, there is no repeated code.

    Quote Originally Posted by Yannis View Post
    I want to optimize the creation and the display of each window. If I create dynamically (with javascript) the window without frame, it is immediate.
    If I use frame with src=...aspx it is more slowly. I think it is normal (due to a server access).
    I imagined a way where all the js files where referenced in the main desktop window. I don't know if it could be optimized, faster and use less memory?
    Repeat myself, this is a disadvantage of iframe and there is no any workaround. Iframe is rather heavy-weight thing for a browser.

    And yes, creating a Window without an iframe via JavaScript is the fastest way.


    Please investigate some threads regarding to optimizing an application.
    http://forums.ext.net/showthread.php?13726
    http://forums.ext.net/showthread.php?15712
    http://forums.ext.net/showthread.php?15699
    http://forums.ext.net/showthread.php...ll=1#post73904
  5. #5
    Hi Daniil,

    Thank you for your response.
    I also read your reference pages.

    I saw also that there is some new features about desktop application in the Ext.Net 2 as the tray items.
    Ok, now in a desktop app, I have build some aspx files with a design completly made with ext component (no html, no aspx component).
    Each aspx file owns a .cs file corresponding to the server side.

    At now, I have a main page : Desktop.aspx that contains main menu, context menu, modules, ...
    When I want to open a new window from the desktop I use a js code to create dynamically a window usign iframes pointing to one aspx file.

    If you think it is not a very good way to manage windows in desktop environment, how can I manage it ?
    Do I have to manage all the windows of my app in one single aspx file ???

    Sometimes, I have complex design, where can I store it ?
    I don't really understand the logic to do this kind of application.

    Thank you again...
    Yannis.
  6. #6
    Quote Originally Posted by Yannis View Post
    If you think it is not a very good way to manage windows in desktop environment, how can I manage it ?
    Do I have to manage all the windows of my app in one single aspx file ???
    I think your design is good.

    Quote Originally Posted by Yannis View Post
    Sometimes, I have complex design, where can I store it ?
    I don't really understand the logic to do this kind of application.
    Not sure that I understand that question. MasterPage + ContentPages, user controls, custom controls, iframes - all of these things help to organize things. A business logic layer you could move out to WebServices or Handlers (ashx).

Similar Threads

  1. [CLOSED] Ext .NET Override method best practice?
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 19, 2012, 12:50 PM
  2. Script runs good in IE9 but not in IE8
    By AlexMaslakov in forum 1.x Help
    Replies: 2
    Last Post: Sep 29, 2011, 7:01 AM
  3. Codebehind: Best practice
    By plykkegaard in forum Open Discussions
    Replies: 3
    Last Post: Jan 27, 2011, 8:41 PM
  4. [CLOSED] Questions about best practice for Column Renderers
    By anup in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 02, 2010, 7:55 AM
  5. Replies: 1
    Last Post: Jan 16, 2009, 4:50 PM

Tags for this Thread

Posting Permissions