Creating a connection between the GUI and a program's back end

I have created a program (over 50 classes) and am currently a little confused as to how I should connect the back end of my program (the real functionality) to my front end (the GUI). Currently I am thinking about using a list of event listeners in my back end that will announce when certain events have completed and thus front end can handle the updates accordingly.
But I want to ensure that the back end doesn't "know" about the front end. In other words, I would like to ensure that the back end and the front end are as independent/modular as possible.
Can anyone make some suggestions besides event listeners?
Thanks,
Timmers

From what I am able to ascertain from your post, you would advocate using EventListeners in the back end (in same VM) to inform the GUI of changes?
Is this the commonly accepted way of communicating your back end functionality to your front-end (GUI)?
I've read that all EventListeners are part of a single thread. So what happens if two events occur simulataneously in the back-end. Do those events get queued or do some of them get lost?
Thanks,
Tim
If the back-end changes state asynchronously to the
front-end GUI (ie does work in background threads and
then notifies the front-end when something happens),
then you should make it send events when this happens.
The basic concept is the same for CORBA, RMI, JINI,
or running everything in the local VM.
To do this you define a set of events (or maybe you
can use the java.beans.PropertyChangeEvent) and
listener interfaces. The front-end then registers to
receive events (probably via an addXXXListener()
method in the back-end). You would have to have a
class (or classes) in the front-end that implemented
the event listener interfaces to receive the events.
If you are using a distributed technology (CORBA, RMI,
JINI, ...) the concept is the same, but the event
mechanisms are slightly different.
To notify the back-end of state changes in the
front-end you probably can just do plain old method
calls from the front-end to the back-end.

Similar Messages

  • Can't establish wireless connection between the printer and computer.

    I recently upgraded my wireless to an Apple AirPort Time Capsule. I'm able to set up the printer via USB cable. And I'm able to set up the printer on the network via the Airport WPA utility. However I cannot establish a wireless connection between the computer and the printer. When I go to the printers window  in my system prefereces, there is no wireless printer available to add in the "available printers" menu. Only the USB version printer is listed and of course when I disconnect the USB cable it shows as offline.I've tried all the fixes on HP's support pages. I've tried reinstalling the printer on both the router and the computer numerous times. The only thing I haven't done is reinstall the printer using the "Install Wizard" software that is supposed to come with the printer - (mine never came with it in the first place and of course HP doesn't have it available for download). And when I reset the printer to factory settings, then connect it to the computer via the USB, there is no installation software that pops up. Cant even find the **bleep** thing in "Finder". (I'm assuming that it should show up as some sort of external device.) I've checked to make sure both computer and printer are on the same network. (sometimes my computer will grab a connection with the next nearest network.) I've checked all the settings for the printer via the HTML configuration utility. I've even updated my Macbook software and restarted it multiple times. Note: the printer actually worked for a bit when I first switched routers, but the printer's wireless function went offline several times and then quit  altogether. Really frustrated that I bought another HP product thinking this time things would be different. HP is no help unless you want to pay $$ for a phone call. I'm about ready to take this thing out in the desert to use for target practice and never buy another HP product ever again.

    Hi , I saw your post regarding the problems you are having with your LaserJet Pro P1102w Printer not showing on your Macintosh computer. I may have found some resources for you. 
    I have a few questions for you, so I can offer some additional assistance:Before you upgraded to the Apple AirPort Time Capsule, was the printer working wirelessly without any issues?
    When you say; 'I reset the printer to factory settings', how where you trying to do this? 
    I found some instructions from this post: How do I reset my Laserjet p1102w to its defaults, copied here for you:
    To restore the printer back to factory settings, turn the printer off, hold down the wireless button and the cancel button (x button) then turn the printer back on and don't release the two buttons until the printer stops making noise. (When they say turn the printer off, I think they mean unplug the power cable.)
    "I've checked to make sure both computer and printer are on the same network."  Do you know if you are able to access the printers Embedded Web Server (EWS)?To access the EWS - Make sure that the Ready light () is on and that the printer is idle and silent.Press and hold the Cancel button (), and release it when the Ready light () begins blinking.The configuration page prints.Type the IP address or host name of the product in the address field of a supported Web browser, and then press Enter on your keyboardLet me know if this page loads 
    To answer a few more items you have listed:... When I go to the printers window in my system preferences, there is no wireless printer available to add in the "available printers" menu.This could be an issue with your print system, I recommend resetting the printing system and then Repair Disk Permissions - after that try to add the printer again.
    ... the "Install Wizard" software that is supposed to come with the printer - (mine never came with it in the first place and of course HP doesn't have it available for download)HP provides their software/drivers to Apple to be released through your Apple software updates. You can review this document on how to Install a Mac Printer Driver Using Apple Software Update. Which leads into your next point...
    ... there is no installation software that pops upWhen you connect the USB cable your mac may still recognize the printer software as being already installed - check for apple updatesOn the Mac, click the Apple menu (), and then click Software Update, or click About this Mac, and then click Software Update. A list of available updates displays.
    ... Not seeing the printer in "Finder" From what I understand most printers will not show in Finder unless you install a memory card into a supported port on certain printer models, only then will it read it like an external device. A few more things you can check are that the new settings in the Apple AirPort Time Capsule are setup to allow the printer to communicate. There are several of these settings listed in this document; Tips and Workarounds for Common Wireless Network Printer Issues.  HP regularly releases firmware updates that may also correct the problem you are experiencing. You can click on this link to Getting Printer Updates for HP LaserJet Pro P1102w Printer.  I did find 2 more documents that may offer some additional information as well;HP LaserJet Pro P1102w Printer - Connecting the Printer After Changing Your Wireless NetworkAn 'Unable to Find Printer' Error Displays for the HP LaserJet Pro P1102w Printer  Please let me know if any of these steps resolved your issue, or the details of what happened.  I look forward to hearing from you, hopefully with good news!   Thanks, 

  • HT1766 what's the difference between the icloud and itunes when installing back up

    what's the difference between the Icloud and Itunes when installing back up???

    Backing up using iTunes stores your backup locally on your computer. Using iCloud stores your backup on Apple's servers. If you never backup your computer(bad idea), iCloud would be a better choice. Read more here:
    http://support.apple.com/kb/HT1766

  • Is there a connection between the performance and the number of photos?

    Is there a connection between the performance of LR 4 (LR 5) and the number of photos in the catalog? Will it slow down LR with a directory of more than 40,000 images (Win7, 4 Gb RAM)?

    I use lots of smart and dumb collections, lots of keywords too, also on Win7/64 though with 12Gb of Ram.
    Have you read through Optimizing performance, especially running a File > Optimize. Also Performance hints is more handy for troubleshooting.
    John

  • How to know the status of concurrent program from back-end in oracle apps

    Hi,
    Can you please explain me step by step how to know the status of the concurrent program from back end in oracle apps.
    Thanks,
    Raj

    When a record is being updated by a form, if you create a Pre-Update trigger on the block, the trigger will run for each record being updated.
    Same thing happens with a Pre-Insert and Pre-Delete trigger.

  • How to create ODBC connection between Oracle 10g and MS SQL Server

    Hi,
    Can someone help us with the steps to create an ODBC connection between Oracle APPS using Oracle 10g database and MS SQL Server.
    Requirement is to extract the transactional data from MS SQL Server on a daily basis and dump it into Oracle tables for an interface to be run. Currently it is being done through Dataloader tool which we feel is causing the data issue with Arabic characters. We want to create the ODBC directly between Oracle and MS SQL Server and check if the data is being pulled correctly.
    The data is in sql server 2000 which has data in Arabic_CI_AS character set which is moved to Oracle 10.2.0.3 database with characterset AL32UTF8. The table data is moved to oracle using the dataloader 3.6 standard edition licensed version. We cannot change the character set of Sql Server 2000.
    Please help
    Thanks
    Shanil

    Hi,
    If you're trying to PULL data from SQLServer into an Oracle database, you wouldnt use Oracle ODBC driver for that, so you may want to post in the Heterogeneous Services forum instead:
    Heterogeneous Connectivity
    If you're trying to PUSH data from SQLServer into an Oracle database, you could use ODBC but most folks use OLEDB for that, and the following note on MOS should help:
    How to Create a Sql Server Linked Server With The Oracle Provider for OLE DB     (Doc ID 191368.1)
    As with any NLS related issue, the first thing to do is dump the codepoints of the data in the Oracle database to see if it is stored validly, rather than relying on what the data "looks like" from some tool or other. It's best to check a single row, with only a few characters in it if you can, and you can do that via
    SELECT DUMP(<columname>,1016) FROM <tablename> WHERE ...
    Hope it helps,
    Greg

  • How to create a connection between EP-Portal and BW system

    Hi friends ,
    Can you pl expalin me How ro connect EP to BW ,I have created an Iview in the portal to get some BW data using BSP application .How to assign Iview to system object ? and what are parameters i need to give in the system object .
    Thanks,
    Sunitha Reddy

    Probably better asked in the PORTAL forum. But anyways...
    Create iView for BI.
    Assign BI iView the ALIAS of your BI system (this assumes you created a BI system object previously and assigned it an alias)
    Just that easy.
    If you are on BI 7, then your BI might have it's own portal and you can create a federated portal network between BI and your portal. It works GREAT and is easy as cake.

  • No connection between wireless keyboard and IMac

    I had to change batteries in my wireless keyboard for my Imac. After that I did not manage to reestablish the connection between the keyboard and the machine. I did not manage to get the blue tooth going again before I went to bed and the session timed out , my IMac is now locked and since my keyboard does not work I am not able to type the password. How can I solve this?

    Are the batteries installed properly?  Have you tried other batteries?
    Have you read for possible solutions over in the "More Like This" thread over here?----------------------->
    Plan B:  It's a good idea to keep a wired keyboard as a standby.  Suggest that you get hold of one. 

  • No connection between EIS Server and EIS Console

    Hi AllWhile saving a meta model I get this error message:"There is currently no connection between the console and intgeration server. Ensure the server is running and try reconnecting"I have checked properly that EIS server is installed and also running, but don't know why throwing this errors...I am unable to save the metamodel....any suggestions ?Thanks in advance !

    Any Help on this please!!!

  • How to set up internet connection between MacBook Pro and an old eMac?

    I got an old eMac without wifi and a MacBook Pro. I'd like to share the network connection via ethernet cable to my eMac, but I can't get it work.
    I'd like to use it with screenrecycler and it needs a network connection.
    How to do it? How to set up the connection between the client and the host? Could somebedy give me a step by step guide?
    Thank you very much

    Hello,
    First, are you using Wifi for Internet on the MBP?
    System Preferences>Network, click on the little gear at the bottom next to the + & - icons, (unlock lock first if locked), choose Set Service Order.
    The interface that connects to the Internet should be dragged to the top of the list, Wifi on the MBP.
    In Shating on both, enable File Sharing, Screen Sharing, & Web Sharing on both.
    Then with the Ethernet cable between the two, find the IPs of both, or use Finder>Go>Connect to Server>Browse... see what shows up.

  • API to create a link between Sales order and Requisition

    We are upgrade 11i to R12. We have a custom drop ship process. We have a original SO and through the sales order we create a Reqisition. We send the requisition details to the factory and the factory sends us a flat file with the quantity shipped and dates. There might be multiple lines for each requisition received. We will add the details to the SO and update the Requision with the flat file details for the SO shipment. But We will have to create a link between the SO and the requisition. Is there an API to do the linking between a SO and A requisition line?

    I created a SO and a requisition
    declare
    p_rsv inv_reservation_global.mtl_reservation_rec_type;
    p_dummy_sn inv_reservation_global.serial_number_tbl_type;
    x_msg_count NUMBER;
    x_msg_data VARCHAR2(240);
    x_rsv_id NUMBER;
    x_dummy_sn inv_reservation_global.serial_number_tbl_type;
    x_status VARCHAR2(1);
    x_qty NUMBER;
    l_inventory_item_id number;
    l_source_header_id number;
    l_reservation_qty number;
    l_error_message VARCHAR2(300);
    l_order_number NUMBER;
    begin
    fnd_global.APPS_Initialize(1131,50654,660);
    p_rsv.reservation_id := NULL;
    p_rsv.requirement_date := to_date('30-JUN-2012','DD-MON-YYYY');
    p_rsv.organization_id := 88; ---ship_from_org_id
    p_rsv.inventory_item_id := 147001; --inventory_item_id
    p_rsv.demand_source_type_id := inv_reservation_global.g_source_type_oe;
    p_rsv.demand_source_name := NULL;-------'SALES ORDER';
    p_rsv.demand_source_header_id := 27005; --- sales order header id
    p_rsv.demand_source_line_id := 29010; --- sales order line id
    p_rsv.primary_uom_code := 'EA';
    p_rsv.primary_uom_id := NULL;
    p_rsv.reservation_uom_code := 'EA';
    p_rsv.reservation_uom_id := NULL;
    p_rsv.reservation_quantity := 200;
    p_rsv.primary_reservation_quantity := 200;
    ----p_rsv.supply_source_type_id := inv_reservation_global.g_source_type_internal_req;
    p_rsv.supply_source_type_id :=inv_reservation_global.g_source_type_inv;
    p_rsv.supply_source_header_id :=18001; -- requisition header id
    p_rsv.supply_source_line_id :=12172; -- requisition line id
    p_rsv.supply_source_name := NULL;
    p_rsv.supply_source_line_detail := NULL;
    p_rsv.autodetail_group_id := NULL;
    p_rsv.external_source_code := NULL;
    p_rsv.external_source_line_id := NULL;
    p_rsv.supply_source_line_detail := NULL;
    p_rsv.revision := NULL;
    p_rsv.subinventory_code := NULL;
    p_rsv.subinventory_id := NULL;
    p_rsv.locator_id := NULL;
    p_rsv.lot_number := NULL;
    p_rsv.lot_number_id := NULL;
    p_rsv.pick_slip_number := NULL;
    p_rsv.lpn_id := NULL;
    p_rsv.attribute_category := NULL;
    p_rsv.ship_ready_flag := NULL;
    p_rsv.demand_source_delivery := NULL;
    p_rsv.attribute1 := NULL;
    p_rsv.attribute2 := NULL;
    p_rsv.attribute3 := NULL;
    p_rsv.attribute4 := NULL;
    p_rsv.attribute5 := NULL;
    p_rsv.attribute6 := NULL;
    p_rsv.attribute7 := NULL;
    p_rsv.attribute8 := NULL;
    p_rsv.attribute9 := NULL;
    p_rsv.attribute10 := NULL;
    p_rsv.attribute11 := NULL;
    p_rsv.attribute12 := NULL;
    p_rsv.attribute13 := NULL;
    p_rsv.attribute14 := NULL;
    p_rsv.attribute15 := NULL;
    inv_reservation_pub.create_reservation
    p_api_version_number => 1.0
    , x_return_status => x_status
    , x_msg_count => x_msg_count
    , x_msg_data => x_msg_data
    , p_rsv_rec => p_rsv
    , p_serial_number => p_dummy_sn
    , x_serial_number => x_dummy_sn
    , x_quantity_reserved => x_qty
    , x_reservation_id => x_rsv_id
    IF x_status='S' THEN --- HARD RESERVATION IS DONE SUCCESFULLY ---
    dbms_output.put_line('reservation succesful');
    dbms_output.put_line('reservation id: || x_rsv_id');
    ELSE
    if(nvl(x_msg_count,0) = 0) then
    dbms_output.put_line('no message return');
    else
    for I in 1..x_msg_count LOOP
    l_error_message := fnd_msg_pub.get(I, 'F');
    end LOOP;
    end if;
    --- HARD RESERVATION API fails ---
    dbms_output.put_line('Reservation API Error Message: '||l_error_message);
    END IF;
    EXCEPTION
    WHEN OTHERS THEN ------------------ In case of any pl/sql error
    l_error_message := SQLERRM;
    dbms_output.put_line('Plsql Error Message: '||l_error_message);
    END;
    but i am getting an error
    "Reservation API Error Message: INV_RSV_DS_SO"
    I am stuck and no idea how to fix this. Any help is appreciated.
    Edited by: 901524 on May 23, 2012 1:26 PM

  • How to test the connection between DSD backend and DSD connector

    Dear all,
    I am configuring the MDSD scenario .. and i want to insure that my customization is correct
    How to test the connection between DSD Backend and DSD connector ??

    Hi Viren,
    The problem is:
    We have a new BW system. The basis people asked me to check the connection between this BW system and the R/3. There is only one client for now(100). I have logged into 100 and tried executing RSA1 to check the connection, but it gave a message box saying "You can only work in Client 000". Then I have treid logging into 000(just to make sure) and tried executing RSA1. Even here I got a message saying "The SAP BW system must not be operated in client 000". Now, I am not sure of what is wrong in clien 100. I am not sure if I have to do some settings before I access RSA1 or any other BW transaction. Could you please help me in this.
    Also, I just checked the RFC destinations in BW. There is a destination created for our R/3 and I have noticed that they have given a remote UserID and password for remote login. I tried to check the Remote UserID in SU01 but there is no userID with that name. Could this be a problem?
    Thanks,
    RPK.

  • How to create more than one connections between my host and server

    Hi,
    I want to create multiple connections(at least, two connections) between my host and the server.
    And use them to transfer data at the same time.
    Could you help me, and could you give me a sample code example?
    ^-^
    Thank you very much

    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.net.*;
    import java.io.*;
    import java.nio.channels.*;
    import javax.swing.*;
       This program shows how to interrupt a socket channel.
    public class InterruptibleSocketTest
       public static void main(String[] args)
          JFrame frame = new InterruptibleSocketFrame();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setVisible(true);
    class InterruptibleSocketFrame extends JFrame
       public InterruptibleSocketFrame()
          setSize(WIDTH, HEIGHT);
          setTitle("InterruptibleSocketTest");
          JPanel northPanel = new JPanel();
          add(northPanel, BorderLayout.NORTH);
          messages = new JTextArea();
          add(new JScrollPane(messages));
          busyBox = new JCheckBox("Busy");
          northPanel.add(busyBox);
          startButton = new JButton("Start");
          northPanel.add(startButton);
          startButton.addActionListener(new
             ActionListener()
                public void actionPerformed(ActionEvent event)
    //               startButton.setEnabled(false);
                   cancelButton.setEnabled(true);
                   connectThread = new Thread(new
                      Runnable()
                         public void run()
                            connect();
                   connectThread.start();
          cancelButton = new JButton("Cancel");    
          cancelButton.setEnabled(false);
          northPanel.add(cancelButton);
          cancelButton.addActionListener(new
             ActionListener()
                public void actionPerformed(ActionEvent event)
                   connectThread.interrupt();
                   startButton.setEnabled(true);
                   cancelButton.setEnabled(false);
              new Thread(new TestServer(Port)).start();
          Connects to the test server.
       public void connect()
           new Thread(new Client(Port)).start();
    //       Port++;
       class Client implements Runnable{
               Client(int port){
                   this.port = port;
               private Scanner in;
           private int port;
            public void run() {
                    try
                       SocketChannel channel = SocketChannel.open(new InetSocketAddress("localhost", port));
                       try
                          in = new Scanner(channel);
                          while (true)
                               try{
                                  if (in.hasNextLine())
                                     String line = in.nextLine();
                                     System.out.println(line + "  " + channel);
         //                            messages.append(line);
         //                            messages.append("\n");                       
                                  else Thread.sleep(100);
                               }catch(Exception e){
                                    e.printStackTrace();
                       }finally
                            messages.append("Socket closed\n" + channel);
                          channel.close();
                    catch (IOException e)
                       messages.append("\nInterruptibleSocketTest.connect: " + e);
          A multithreaded server that listens to port 8189 and sends random numbers to the client.
       class TestServer implements Runnable
              ServerSocket s;
              private int port;
              TestServer(int port){
                  this.port = port;
                  try {
                   s = new ServerSocket(port);
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
          public void run()
             try
                int i = 1;
                while (true)
                   Socket incoming = s.accept();
                   Runnable r = new RandomNumberHandler(incoming);
                   Thread t = new Thread(r);
                   t.start();
             catch (IOException e)
                messages.append("\nTestServer.run: " + e);
          This class handles the client input for one server socket connection.
       class RandomNumberHandler implements Runnable
             Constructs a handler.
             @param i the incoming socket
          public RandomNumberHandler(Socket i)
             incoming = i;
          public void run()
             try          
                  int i = 0;
                OutputStream outStream = incoming.getOutputStream();
                PrintWriter out = new PrintWriter(outStream, true /* autoFlush */);
                while (true)
                   out.println(i);  
                   i++;
                   Thread.sleep(100);
             catch (IOException e)
                messages.append("\nRandomNumberHandler.run: " + e);
             catch (InterruptedException e)
                messages.append("\nRandomNumberHandler.run: " + e);
          private Socket incoming;
       private JButton startButton;
       private JButton cancelButton;
       private JCheckBox busyBox;
       private JTextArea messages;
       private TestServer server;
       private Thread connectThread;
       public static final int WIDTH = 300;
       public static final int HEIGHT = 300;
       public static int Port = 8848;

  • Create JNDI Connection Between MSAcess and BIPublisher

    Hi,
    Can Anyone guide me in establishing the connection between MSAcess database and BIPublisher.
    I had tried by creating the JNDI where i had the details DSN and i am not sore of JNDI name. What can i provide for JNDI Name?
    Any pointers on this is of Great Help!!!!!!!

    Please post your question here:
    BI Publisher
    This is the BI Apps forum.

  • Creating a relationship between one table and the PK in another

    Sorry the subject of this message is a bit vague. I'm not sure how to describe this problem in one sentence.
    So here's the issue: I've just created a new block on my form based on table2. Table2 contains t1_id which is the FK link to Table1.
    What I want is when one of the fields in Table2's block is changed and inserted, the t1_id is inserted in the applicable row. Essentially, I need :table2.t1_id to have the 'Copy From Item' property set at :table1.id
    I cannot seem to see where in designer this option is. I asked a friend and he said what I need to do is 'create a relationship between the two values in designer'. Huh? In the Table Definitions the FK is set for the two, so I'm not sure how to do this.
    Another problem, which I'm believing will be solved when this is, is that when the form loads, this new block, table2, is not automatically populated with the applicable values from the table.
    Thanks for any help. It's greatly appreciated!

    Do you mean that you want to create a Master-Detail Form using Designer?
    If yes, you need to define the entity usage from the Function Hierarchy Diagrammer, then attribute usage definition. Generate the module using Application Design Transformer. You need to define the Context so that master table's PK will be carried over to the detail table.

Maybe you are looking for