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

  • Home
  • SEARCH
  • 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 8306473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:20:17+00:00 2026-06-08T18:20:17+00:00

I have an application that consists of two processes, one client process with a

  • 0

I have an application that consists of two processes, one client process with a (SWT-based) GUI and one server process. The client process is very lightweight, which means a lot of GUI operations will have to query the server process or request it to something, for example in response to the user clicking a button or choosing a menu item. This means that there will be a lot of event handlers that looks like this:

// Method invoked e.g. in response to the user choosing a menu item
void execute(Event event) {
    // This code is executed on the client, and now we need some info off the server:
    server.execute(new RemoteRequest() {
        public void run() {
            // This code is executed on the server, and we need to update the client 
            // GUI with current progress
            final Result result = doSomeProcessing();
            client.execute(new RemoteRequest() {
                public void run() {
                    // This code is again executed on the client
                    updateUi(result);
                }
            }
        }
    });
}

However, since the server.execute implies a serialization (it is executed on a remote machine), this pattern is not possible without making the whole class serializable (since the RemoteRequest inner classes are not static (just to be clear: it is not a requirement that the Request implementation can access the parent instance, for the sake of the application they could be static).

Of course, one solution is to create separate (possibly static inner) classes for the Request and Response, but this hurts readability and makes it harder to understand the execution flow.

I have tried to find any standard pattern for solving this problem, but I have not find anything that answers my concern about readability.

To be clear, there will be a lot of these operations, and the operations are often quite short. Note that Future objects are not entirely useful here, since in many cases one request to the server will need to do multiple things on the client (often varying), and it is also not always a result being returned.

Ideally, I would like to be able to write code like this: (obvious pseudo-code now, please disregard the obvious errors in details)

String personName = nameField.getText();
async exec on server {
    String personAddress = database.find(personName);
    async exec on client {
        addressField.setText(personAddress);
    }
    Order[] orders = database.searchOrderHistory(personName);
    async exec on client {
        orderListViewer.setInput(orders);
    }
}

Now I want to be clear, that the underlying architecture is in place and works well, the reason this solution is there is of course not the above example. The only thing I am looking for is a way to write code like the above, without having to define static classes for each process transition. I hope that I did not just complicate things by giving this example…

  • 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-08T18:20:18+00:00Added an answer on June 8, 2026 at 6:20 pm

    I actually ended up solving this by creating a base class with a custom serializer that takes care of this. I still hope it is solved in the language eventually.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that consists of two processes (let's call them A and
I have an application that consists of two forms. One form displays data returned
I have a web application that consists of two websites - one running on
I have a server application that consists of multiple OSGi bundles, some mine, some
I have wrote an application that consists of two projects in a solution, each
I have this application that consists of two phases. Queuing phase and chatting Phase.
Suppose you have an application that consists of two layers: A: A data layer
I have a web application that consists of a web service with two operations:
I have an asp.net 4.0 framework application that consists of a Masterpage and contentplaceholders.
I would like to have a custom view in my application that consists of

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.