Is RMI the best way for Applet to Java communications?

I have an application that uses a Java program to read values from a PLC (programmable logic controller) via ethernet. I want to display them in Internet Explorer. Currently, I use SQL statements in the application and an applet to pass the values, but this causes the hard drive to be busy all the time. A better way would be to have the applet pass which registers to read for the current page to the application. The application then reads these values once every second (to update the page) and passes them back to the applet. Is RMI the best way to do this? The application and the applet run currently on the same PC, but I can envision going with a client/server architecture at some point in the future. Please respond to: [email protected] or [email protected] Thanks!

Writing to the DB and reading back is not the best way of achieving IPC. You can use DB directly as long as both applet and application have permissions to do that. This has an advantage that it avoids RMI overhead (though not much). You would not be able to do this if your applet is going to be launched on a web environment (as typically, security policies do not allow you to write/read on local machine's DB or any m/c other than web-server's).
I feel your current approach has the following
advantages:
--> There's no RMI(or any other IPC mech.) overhead involved.
--> Best way to communicate if applet is permitted to do all the things that the application can do on DB.
limitations:
--> When applets are launched through web, this approach would work only if the DB resides on the same m/c as web-server(JDBC).
--> Lot of DB I/O, table locks etc... affect performance. Application alone can do all that activity(minimized) and communicate it to the applet through RMI/callbacks.
Alternate/better approach:
RMI and Servlet combination can be used in order to overcome those limitations. In this scenario, your applet gets downloaded on to the client's m/c, servlets (which make RMI calls to the application running anywhere) reside on the webserver's m/c. applet talks to servlets, which in turn communicate with application(DB). This approach would work in any scenario, but not without the overheads of RMI and/or HTTP. But in my experience, I have noticed that these overheads are not too large.
To decide upon the strategy to be employed, you should consider all the possible deployment scenarios of your system. For passing any object, you may use RMI for reliable, easy communication. It can serve more purposes than just passing DB data. This will make your system extensible.
regds,
CA

Similar Messages

  • The best way for moving from Java To JSP....

    Hello Guys ,
    Actually i am New to Java Technology and i Love it very much , i am trying to do my best ...
    i Understand it , it`s Logical for me , as you told you i`m New to Java Technology and i wanna learn JSP as soon as i can , because i have to do the commercial Project "Website" for my Univ... And Sure i wanna Continue With Jsp .. For Enterprise Commercial Projects .Sure i will Continue with Java Too ..
    The Question is .. , What is the Best way i MUST follow to achive my target ?
    i mean if i can start with Jsp Directly , or i have to focus on special Topics in Java Before Strat JSP ...
    i have just 6 monthes to Perform my Commercial Project "Payment On line ..etc"
    So Please i really want your Help
    I`d be really thankfull for you guys
    thanx for your time
    Java son

    Enterprise Applications != JSP. JSP is just a
    front-end. For enterprise apps you'd probably rather
    need EJBs...Argh... not true. I see what you are getting at, as JSP is merely presentation layer stuff; however, EJBs are certainly not ever required per se, altho they may offer some services that may be useful. I suggest OP takes a look at Struts in order to separate the webapp in an MVC style so that the decision for what to use at the back is decoupled from everything else. If it is a simple webapp, and for a University then I don't think a complex back-end will be required. In any case webapps are not enterprise systems, but they may act as views on them in some cases.

  • What's the best way for a web app to handle logins and sessions?

    I'm deploying in JBoss, using JSF. As is often the case, I keep User information in an entity bean. My question is, what's the best way to handle this bean?
    My inclination is to create a login page with a LoginBackingBean atached to it. When the user attempts to log in, it will see if there is a User entity bean that corresponds to the given name and password. If there is no User bean that matches, obviously we show an informative error screen.
    But what happens if there is a valid user?
    In the plain old Servlet world (without EJB / J2EE) I would just put the User object (it's an object, not an EJB) into the HttpSession, and I would create a Filter that would check for the presence of that User object, and I would map the filter to something like /members/*, and that would be it. I would use Hibernate to persist the User object, and there would also be a filter that creates a Hibernate session and stores it in the Request so that the User object would work and persist.
    How do I do this within the J2EE / EJB world?
    My first thought would be to just do the same thing. Install the User bean into the HttpSession, and create a filter and do all the same stuff. Is that the right way to do it? It would work pretty well with JSF because I could just access things in the normal JSF way: #{user.firstName} would find the "user" object in the HttpSession scope. So that's good.
    One question that comes up from that is if the user makes some change to the User object that is in the Session scope, will the EJB automatically do the right thing and make those changes persistent? Is there anything else I need to do?
    I'm new to the EJB world, but from what I can see so far, it seems like it's the best way to think about a web application.
    Thanks

    hi ,
    i think the best way is to create java beans ,in that bean call your EJB ,
    and check the validation over there.
    and make that bean scope to session.
    in each and everypage try to check the session ,if it is not valid then forward to your login page...
    otherwise continue to give access to him like guest
    Regards,
    AfTaB

  • What are the best ways (for best performance) in MII to process the incoming process messages from shop floor systems to SAP ECC 6.0 and vice versa?

    Hi All,
    Can you please suggest to choose the best ways (for best performance) in MII (12.2 on NW 7.3), to process the incoming process messages from shop floor systems to SAP ECC 6.0 and vice versa?
    Thanks

    Hi Surya,
    Best practices for flow of data from ECC --> SAP MII --> Shop floor & Vice verse:
    1. Send ECC data through IDOC's/RFC's as messages to SAP MII message listener and BSL transaction process data and update directly on shop floor database as if you configured in Data services or later send those data by web service to shop floor system (i.e. depends on Shop floor machines).
    From Shop floor:
    shop floor --> SAP MII --> ECC
    1. Use either Web service or fetch data from DB and pass data to BAPI's  for sending to ECC through BLS transaction.
    Regards,
    Praveen Reddy

  • WHat is the best way for other iphone users to share pictures with me?  I am doing a project which req. people to send me 100 pictures at a time that I'll be putting in my iphoto?

    WHat is the best way for other iphone users to share pictures with me?  I am doing a project which req. people to send me 100 pictures at a time that I'll be putting in my iphoto? thank you.

    ingridlisa,
    I'd suggest to ask them to create Shared PhotoStreams and to invite you to view the streams, see:
    iCloud: Using and troubleshooting Shared Photo Streams
    Regards
    Léonie
    Added:
    that I'll be putting in my iphoto?
    Will you be collecting the photos in iPhoto on your iPhone or on a Mac? On a Mac a Shared PhotoStream requires Mac OS X 10.8.2.

  • Acrobat Standard XI, but can only find the CD for windows.  I have a mac (I have access to an external CD drive and I have the product keys for windows).  What is the best way for me to install it?

    Hi, I purchased Acrobat Standard XI, but can only find the CD for windows.  I have a mac (I have access to an external CD drive and I have the product keys for windows).  I have never installed it anywhere else.  What is the best way for me to install it?

    Hi lintonm86921521,
    I can understand your concern & will guide you through this.
    I am so sorry to inform you that Acrobat XI Standard is not available on Mac, you can only use it on your Windows computer.
    You can also refer to the system requirements at : System requirements | Acrobat family of products—older versions (XI, X, 9)
    In case if you have any further query please let us know, we will be happy to help you.
    Regards,
    Aadesh

  • HT4914 I purchased iMatch because my old computer was failing and I was afraid of losing my music library. Now I bought a new laptop; what is the best way for me to transfer my library to my new laptop? Will iMatch help me do this?

    I purchased iMatch because my old computer was failing and I was afraid of losing my music library. Now I bought a new laptop; what is the best way for me to transfer my library to my new laptop? Will iMatch help me do this?

    Is/was failing or has failed?
    If the old computer still runs one of these methods may be best.
    Method 1
    Backup the library with this User Tip.
    Restore the backup to your new computer using the same tool used to back it up.
    Deauthorize the old computer if you no longer want to access protected content on it.
    Keep your backup up-to-date in future.
    Method 2
    Connect the two computers to the same network. Share your <User's Music> folder from the old computer and copy the entire iTunes library folder into the <User's Music> folder on the new one. Again, deauthorize the old computer if no longer required.
    I'd recommend method 1 since it establishes an ongoing backup for your library.
    I don't have personal experience with iTunes Match, but in principle you should be able to download all the tracks currently registered to your iTunes Match account. This isn't quite the same as restoring your previous library exactly as it was. There is always the potential for iTunes match to provide the wrong version of a song and could be content such as movies, podcasts, audiobooks etc. that would have been excluded.
    tt2

  • I am looking to start developing apps for the iTunes Store, but I have no previous experience. What is the best way for me to start on this? As in which programs and materials must I need and what I need to know. Thanks!

    I am looking to start developing apps for the iTunes Store, but I have no previous experience. What is the best way for me to start on this? As in which programs and materials must I need and what I need to know. Thanks!

    You will need a Mac, with OS X 10.6+ on it, to be able to develop iOS apps.
    There is some info on these pages :
    developer site : https://developer.apple.com
    developing for iOS 7 : https://developer.apple.com/ios7/
    developer support : https://developer.apple.com/support/
    developer forums : https://devforums.apple.com/index.jspa (you will need to be a registered developer to access them)

  • Hello, what is the best way for me to convert RW2 raw format for use in Photoshop CC

    Hello, what is the best way for me to convert RW2 raw format for use in Photoshop CC. I would appreciate any help with this.

    Thanks for the quick help. I do have to leave for work. When I try to
    download the images from the camera they seem to only be in jpeg (I don't
    see any rw2 or raw files to download). If I select the jpeg file it seems
    to only download a jpeg file. I do understand that I do have the option to
    open the jpeg in RAW. In doing this, is all the extra information included
    in the RAW file there or is it lost coming from the camera
    Once again thank you for trying to make me understand how this works.
    Have a great day.
    On Sat, Sep 13, 2014 at 12:14 PM, ssprengel <[email protected]>

  • What is the best  way for using a  C++ in the EJB?

    What is the best way for using C++ in the EJB ie
    either 1. Socket programming
    2. JNI

    To what purpose?
    To use C++ in the client you could generate IDL from your remote interfaces and run that through your vendor's IDL-to-C++ processor.

  • Which is the best way for posting a large number of records?

    I have around 12000 register to commit to dababase.
    Which is the best way for doing it?
    What depends on ?
    Nowadays I can't commit such a large number of register..The dabatase seems hanged!!!
    Thanks in advance

    Xavi wrote:
    Nowadays I can't commit such a large number of registerIt should be possible to insert tens of thousands of rows in a few seconds using an insert statement even with a complex query such as the all_objects view, and commit at the end.
    SQL> create table t as select * from all_objects where 0 = 1;
    Table created.
    Elapsed: 00:00:00.03
    SQL> insert into t select * from all_objects;
    32151 rows created.
    Elapsed: 00:00:09.01
    SQL> commit;
    Commit complete.
    Elapsed: 00:00:00.00
    I meant RECORDS instead of REGISTERS.Maybe that is where you are going wrong, records are for putting on turntables.

  • What's the best way for home sharing to iDevices without iTunes?

    What's the best way for home sharing movies and tv shows on my iDevices?  I know I can use home sharing through iTunes, but I'm looking for a way to share videos to my iDevices without having to leave my computer on.  I have a MacPro, iPhone, iPad, Airport Extreme, and Airport Express (and several external hard drives).  Can anyone suggest an app that would do this?  Can I have videos on an external hd attached to an Airport Extreme/Express and have it stream without iTunes?

    If your "server" is new enough to run Mountain Lion, you can purchase the OS X Server app from the Mac App store and you'll have everything you need to host a NetInstall (NetBoot) server.
    If your machine does not support Mountain Lion, you'll need to purchase the appropriate Mac OS X Server software (i.e. Lion Server or Snow Leopard Server)
    From there you can host NetInstall or NetRestore images, depending on your preferred workflow, which can be created using System Image Utility.
    As Richard points out you can also use Deploy Studio which, again depending on your preferred workflow, might simplify things.

  • My Mum( a pensioner) is wanting to purchase both an iPhone and iPad.  What is the best way for her to manage her data /calls/txt etc. obviously the cost needs to be as low as possible.  Currently does not have WiFi but uses dongle

    My Mum( a pensioner) is wanting to purchase both an iPhone and iPad.  What is the best way for her to manage her data /calls/txt etc. obviously the cost needs to be as low as possible.  Currently does not have WiFi but uses dongle

    My Mum( a pensioner) is wanting to purchase both an iPhone and iPad.  What is the best way for her to manage her data /calls/txt etc. obviously the cost needs to be as low as possible.  Currently does not have WiFi but uses dongle

  • The BEST way for recharge iPhone4.

    Hy to all!
    My answer is:
    Which is the BEST way for recharge the iPhone4?
    When the battery is completely to %0 or not?
    Finally, the iPhone when is in recharge mode, the best way is that it is turned on or turned off? Because if it's are turned off, how i understand that are 100% recharged?
    Thank you!

    Garydp wrote:
    I agree that you can't charge while off unless it is completely flat. Even then when it has charged for a while the phone switches back on. Just tried again to make sure and as soon as I plugged the charger in the phone turned on.
    Hi, Actually an iPhone can be charged when off at any time, not just when totally exhausted. It is true the the phone will turn on when plugged in if it's off to begin with, however, if it is turned off after being plugged in, it will indeed charge. This is how I habitually charge mine overnight.
    Regards, R.

  • [Solved] What's the best way for me to help with Arch?

    I've been using Linux for about 10 years and Arch for a little over a year.  I used to do a lot of distro-hopping but I've found that since finding Arch, I haven't been doing much of that.  I don't know why it took me so long to find it.
    Anyway, I'd like to give back a little so what's the best way for me to help?  I'm not a programmer so I'd be no help there.  I have made a couple contributions to the wiki and filed a bug.  I know that kind of stuff is easy and obvious.  Is there anything else I could be doing?
    Last edited by brianhanna (2010-04-07 02:25:34)

    I hear the Arch Linux Magazine could always use some contributions, if you're inclined towards that sort of thing. I've been wanting to write an article for a while, but I've not run into anything in my Arch experience so far that's really inspired an article out of me.

Maybe you are looking for

  • Lost all my music in itunes

    When I opened itunes this morning all my music that I had on the computer is gone! No list, no podcasts, no purchased music, nothing. The other day I did accidentally trash my music folder but I dragged it back out of the trash and itunes still worke

  • Possible to extend java Concurrent Program and replace standard??

    Hi All! i have following developing need. There is a java concurrent program POXPOPDF (PO Output for Communication). The customer needs this program to do actually something complete different than printing the PO in PDF. The executable for this CP i

  • Change Minutes Plan = $500 Bill

    Back in October I called the 1-800 line to inquire about having a lower allotment of minutes for the two lines on my account because of the fact that we hardly use any of them. The representative I talked to was able to take our 700 minutes plan and

  • How to create Internal Order with LKD status

    Hi All Experts , Can anybody tell me how can we create IO directly in LKD status ? Or it is manual acitivity by clicking on Set / Rest button and then check LKD and save. I tried in KOT2_OPA but not no any option found. If any experts can guide for t

  • Zeros in ALV Output

    Hello Friends, We have a custom report , where we have couple of currency columns(product values item level) .We may have many products linked to one header record. For some of the records the product value is zero, and I wanted to display for that p