• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Java Client (topic of the day!)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java Client (topic of the day!)


  • Subject: Re: Java Client (topic of the day!)
  • From: David Avendasora <email@hidden>
  • Date: Thu, 26 Mar 2009 06:56:33 -0400


On Mar 25, 2009, at 6:22 PM, Stamenkovic Florijan wrote:

Hi John

On Mar 25, 2009, at 17:46, John Ours wrote:

Funny to see all these messages about creating a Java Client, since that's exactly what I've been working on today.

I've been following Florijan's write up and David's examples (thank you both!) and I've actually got things working so far. After all these years of grinding through client-server builds, this is like a gift from God.

Cool to see that the hard work is being put to use :D For a while it seemed like Dave and I were the only ones out there...

Welcome aboard, and I'm glad you are getting value out of the work Flor and I have put in!



Anyhow, when working with this in development, what's the best way to handle starting the app from the IDE?

I use Java WebStart with both the server- and client-side applications in one project. I use it because that's the way Xcode would setup a D2JC project and that's where I started. It works great if you have everything setup just right. But it can be quite tricky and makes your project build more complicated. Don't get me wrong it's still a fully automatic process, it's just more difficult to setup and working the first time.


WebObjects has JC-specific WOComponents that take care of generating the WebStart JNLP file for you automatically It will have all the current IP/Port information in it so you never have to worry about it being up-to-date, which solves the problem you describe below. It also imbeds the client-side jar locations into the JNLP file for download at launch.

The big drawback to using WebStart and one project is that the normal WOLips incremental builder is unaware that JC exists so it doesn't build or place your client-side classes where the server-side WO app needs them in order to sent them down to the client (via WebStart) at launch. I created a new javaclientbuild.xml file and setup a custom Ant builder for my project that does all this, including handling some D2JC-specific stuff that currently doesn't work with the Fluffy-Bunny project layout.

I'll be updating all my Wiki JC posts today to bring them to my current setup, which seems to work quite well.


I do exactly what you describe below, with some minor improvements. Please read on.


The way it's set up now, I've got my WebObjects server application in one project and my Swing client app in another. In the client app I call EOClientApplicationSupport.main and pass in the URL to the running server app. The problem is that the port changes on the server app every time I start it. Is there a way to set it to a fixed port?

Yes. Use the WOPort property in the server app's launch config (in the WO tab of a WOLips launch config).

If you use WebStart you don't have to worry about this, with two separate projects, I believe what Flor is saying is the best way.



Or a better way to setup the run profiles for a Java Client app?

I don't do anything fancy there. Sometimes I set heap sizes, but that's it.

Same here.

Still, depending on what you're doing there might be a better way to deal with EOClientAppSupport. Attached is a class that I use as a parent class for the main class of my JC apps. It takes care of some things for you... It's main purpose is to allow you to pass it multiple URLs to try to connect to. It is a part of my WOJCKit framework (a set of client and server side stuff for WOJC apps), which I guess I should publish, seeing all the interest on WOJC lately :)

Wow Flor. I think you need to consider calling your stuff "Client-Side Wonder" or similar!


I know, I know, much of what JBND does isn't specific to WO, it could be used with other ORMs or Java UIs. But maybe you could package the two (JBND and WOJCKit) together into one Framework called ERJavaClient...

Just sayin'.

Dave


_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Java Client (topic of the day!)
      • From: John Ours <email@hidden>
References: 
 >Java Client (topic of the day!) (From: John Ours <email@hidden>)
 >Re: Java Client (topic of the day!) (From: Stamenkovic Florijan <email@hidden>)

  • Prev by Date: Re: Handling exceptions when saving editing conext changes
  • Next by Date: Re: Java Client (topic of the day!)
  • Previous by thread: Re: Java Client (topic of the day!)
  • Next by thread: Re: Java Client (topic of the day!)
  • Index(es):
    • Date
    • Thread