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 8606769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:10:43+00:00 2026-06-12T03:10:43+00:00

This question is based on an answer I received for another question : https://stackoverflow.com/a/3060233/323357

  • 0

This question is based on an answer I received for another question : https://stackoverflow.com/a/3060233/323357

My understanding is that the use of interfaces to declare return types and parameters types in my services forces the compiler to generate multiple compilation units, which increase my compile time and the size of generated files.

I don’t think this is the case, but does the latest versions of gwt compiler (2.4 – 2.5) have a way to detect unnecessary compilation units…

  • for local variables and parameters?

    void someFunction()
    {
        ArrayList<String> list = new ArrayList<String>();
        privateFunction(list); //only use of the private function
    }
    
    private void privateFunction(List<String> list)
    {
        Set<Integer> set = new HashSet<Integer>();
        //do stuff without reallocating list or set
    }
    
  • for final members?

    private final Interface member = new InterfaceImpl();
    
    @override
    Interface getInterface()
    {
        return this.member;
    }
    
  • for return type?

    List<String> myFunction()
    {
        List<String> ret = new ArrayList<String>();
        //do stuff and fill the list
        return ret;
    }
    
  • in services?

    //Service Interface
    List<String> myService();
    
    //Service implementation
    List<String> myService()
    {
        List<String> ret = new ArrayList<String>();
        //do stuff and fill the list
        return ret;
    }
    
  • 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-06-12T03:10:44+00:00Added an answer on June 12, 2026 at 3:10 am

    Don’t worry about the first 3 of your 4 examples. Usage of interfaces (or classes with many subclasses) on the client side has no cost: Unnecessary classes can be detected easily by analyzing which classes are ever instantiated. If in doubt, examine a compile report.

    However, this is impossible in GWT-RPC for server side calls: The client has no way to know, which instances the server will create. Consider that

    • the same client can continue to work with updated versions of the server (as long as the service definition is unchanged)
    • the server can use reflection to dynamically generate objects: any subtype of the declared type (and this is by the way a major reason why reflection isn’t available on the client side)

    The only ways this code size overhead can ever be eliminated, are to either

    • give up type safety (you can use JSON based approaches!)
    • or analyze the server side during compilation and forbidding to transfer objects that were generated dynamically (this would require a GWT re-compile whenever object instantiation code on the server side changes)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Based on the answer I received on this question ( https://stackoverflow.com/questions/1911969/... ) I have
This question is based on my previous question which I got a working answer
This is a further question based on this answer: How can I implement a
Based on the answer for this question What's the difference between CompositionBatch and catalogs?
Based the accepted answer to this question I've setup a NetBeans/tomcat environment. In testing
Based on some answers to this question it appears that +alloc does some behind-the-scenes
I have a query based on the answer to this question: Handling ties when
Based on the accepted answer to this question I wrote the following code: NSData*
This question is based on this answer . What does the following sentence mean?
Ok, I'm having trouble finding an answer to this that isn't just use JSON

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.