What is strategic window? What is the example?

Titanium Mobile: [Best Practice] - For a Ti.UI.Window which you may need to frequently switching, for example, a CHAT window in an IM. Is it good to keep opening/closing ONE window and kept changing its content? OR is it good to create say 4, 5 of these windows?

  • 1 consideration is, usually one only talks to less than 5, 6 people in one activity circle. So even if we create 1 chat window for each, we only create, say 6 windows, at most. And we only "open" 1 of them at any time. 2nd consideration is, since we only open 1 chat window at any time anyway, so why not just keep 1 window and re-render its content everytime it opens?

  • Answer:

    Windows make many developers nervous, but i'm all too fond of them. As long as you understand the basics of closing and nullifying Windows, you'll never run into Memory leaks. For what you're wanting, i don't foresee too much of an issue running 5-6 windows, but it will depend on the amount of controls used within Windows. My recommendation though is: Use 1 Window and manage the Data Model in a separate commonJS file. One of the pros of using commonJS is that it remains in Memory even though you feel like you're re-initializing it from scratch. Keep the multiple instances of Chat data in this commonJS file and load them when relevant to your Window.

John Jardin at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.