• 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: Common library, how to
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Common library, how to


  • Subject: Re: Common library, how to
  • From: Gavin Eadie <email@hidden>
  • Date: Mon, 23 Jan 2006 12:14:50 -0500

At 12:08 PM +0100 1/23/06, Dev WO wrote:
this is really a beginner question...most probably because I'm still a beginner;)

... we've all been beginners !!

I'd like to share some code between different applications, so I was thinking about creating "something" that would holds my shared code.
So here's a few question if someone can point me to the correct resource or give me the answer:
-Which type of project should I choose: a "WebObject Framework" or an "Ant-based Java Library"? I'm pretty sure there's different goal using one or the other, but I don't actually get all of them

Jerry's long answer covers this well. I'd add a couple more comments and suggestions.


You should use a "WebObjects Framework" because the WebObjects runtime knows about them and uses them in various ways. In fact, if you built an "Ant-based Java Library", you'd be advised to put the resulting jar in a "WebObjects Framework" anyway!!

When you use a WebObjects Framework to carry common code and assets, you need to add it to the list of frameworks that your application(s) use. You need to do that in order to satisfy imports anyway, but another effect is to add any jars in that WebObjects Framework to the classpath when the application runs, so they are found without any any need to fiddle with CLASSPATH.

I have a WebObjects Framework (called JakartaCommons) which I use to carry several Jakata Commons jar files into my applications -- it's really useful. I've enclosed (or will have if 48k makes it through the mailing list) my XCode 2.2 project for that WebObjects Framework zipped up for your exploration.

Note a couple of things when you look at this with XCode:

The Java entry in the Resources group is a folder reference (blue icon). This makes that whole folder be treated as a resource and moved into the WebObjects Framework resources (and not the individual jar files). When the project is built, it will have a folder in it as follows:

      JakartaCommons.framework/Contents/Resources/Java/

and every jar file in that folder will be added to the applications classpath.

I've taken all but the smallest Jakarta jar out of my copy of that folder to make this enclosure small enough to mail -- you would want to drop any jars you want into that Java folder.

You'll also find an ant script which builds this framework -- that's added by me, it's not a part of the XCode template for a WebObject Framework. It may, or may not, be interesting.

________________________________________

Xavier will get a copy of this message anyway, but I can't remember the rules for the mailing list -- if that enclosure is stripped from the message, for a few weeks it'll be at:

      http://umich.edu/~gavin/wo-ex/JakartaCommons.zip

Attachment: %JakartaCommons.zip
Description: application/applefile

Attachment: JakartaCommons.zip
Description: Binary data

 _______________________________________________
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

References: 
 >Common library, how to (From: Dev WO <email@hidden>)

  • Prev by Date: Re: Managing EOF caching
  • Next by Date: Re: Common library, how to
  • Previous by thread: Re: Common library, how to
  • Next by thread: Re: Common library, how to
  • Index(es):
    • Date
    • Thread