Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7529019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:32:40+00:00 2026-05-30T04:32:40+00:00

With performance in consideration, how would you store multiple overlay types for the entire

  • 0

With performance in consideration, how would you store multiple overlay types for the entire of your GWT app to use upon request?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:32:42+00:00Added an answer on May 30, 2026 at 4:32 am

    If I understand correctly, you are wanting to reference an overlay type from anywhere within your application. In that case, consider creating a public static variable.

    For example, say we have a JavaScript Overlay Type called Book. Inside of it, we can create a static variable to hold our global instance.

    public class Book extends JavaScriptObject {
       public static Book instance; // The global
    
       protected Book(){}
    
       public final native String getName()/*-{ 
          return this.name; 
       }-*/;
    
       public final native void setName(String name)/*-{
          this.name = name; 
       }-*/;
    }
    

    Then later on, we reference it from wherever we want:

    Book.instance = (Book) JavaScriptObject.createObject();
    Book.instance.setName("How I Sailed the Seven Seas");
    GWT.log( Book.instance.getName() );
    

    Truth be told, this is how any “global” variable works in Java. Overlay types happen to work the same way!

    Do note that there is no magic happening by putting the instance inside of the Book class. You could very easily do the same thing:

    public class FooBar{
       public static Book global_book;
    }
    

    and later:

    FooBar.global_book.setName("My Biography")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Which one is better when performance is taken into consideration an if else if
In performance point of view what should you use Nested foreach's or lambda/linq queries?
Why would someone use a group by versus distinct when there are no aggregations
Taking into consideration performance and readability, how should dates be encoded in JSON for
i am displaying thumbnail images from youtube in my iOS app. which upon click,
Performance issue, when generating around 800~ options from jSon object via javascript. Any suggestion,
Strange performance outcome, I have a LINQ to SQL query which uses several let
Criteria: Performance, Performance, Performance. I need a way to convert a uint, int, etc
Keeping performance on a mobile device in mind, what do you think is the
For performance reasons, I draw the strings for my UITableViewCell in a custom view

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.