Re: WO and Java 'packages'?
Re: WO and Java 'packages'?
- Subject: Re: WO and Java 'packages'?
- From: Jonathan Rochkind <email@hidden>
- Date: Wed, 21 Apr 2004 16:59:55 -0500
This sounds promising.
If, as a first transitionary step, I simply put _everything_ in the
_same_ package, then I have to change very little. It's all in the
same package, don't need to worry about 'protected' access. [I know I
need to worry about .wod bindings to 'protected' variables/methods,
but I also know there is a simple fix to allow .wod binding access to
'protected' on a per-package basis, and I'll only _have_ one
package!]. I don't need to worry about two classes with the same
name in two different packages---I'll only _have_ one package.
So I'll need to do is go add the "package" qualifier to my EOEntity
definitions in the EOModel. Which is tedious, since I have a lot
models, but not at all frightening.
Hmm, maybe this will really be no problem. Of course, if I can simply
leave everything in the 'default' package as current, then it's
_really_ no problem. But I too could swear I read that there were
changes to how the 'default' package was handled in 1.4.x which made
it _especially_ a bad idea to use the default package at all. But I
can't remember what they were, and dont' feel like googling around
now. Perhaps they are problems that don't effect a typical WO app.
--Jonathan
On Apr 21, 2004, at 2:12 PM, Jonathan Rochkind wrote:
So I'm still using WO 5.2.1, with Java JRE 1.3.1.
And I must confess, I've never put my code in Java packages. Which
I guess means all of my classes are in the default package.
Well, I'm shocked! :-P
My understanding is that JRE 1.4.x (which newest versions of WO
require) pretty much forces me to put my code in explicit packages.
Leaving it all in the default package doesn't really work anymore.
No problem, I can certainly add a 'package net.whatever.something;"
statement to the top of every line of source. (I know better
organization would be desirable, but one step at a time).
I thought that was true as well but the default package seems to
work just fine. I searched and could find no reference to this
requirement. Did we both just hallucinate this?
My question is, how does this effect other WO/EOF stuff that
specifies class names as strings? Do I generally need to specify
the qualified-with-package class name _everywhere_?
Generally, not if you import the package.
In pageWithName calls?
Only if you have a component with the same name in different
packages, otherwise no change is needed.
How about in EOEntity "Class" specifications?
In the EOModel? Yes, that needs the package.
What about partial/reusable components? Does my .wod need to read:
ReusableComponent1: fully.package.qualified.ReusableComponent {
}
How about WOSwitchComponent, do I need to bind it's
"WOComponentName" binding to a value that's a package qualified
name?
Only if you have a component with the same name in different
packages, otherwise no change is needed.
Anything else I'm not thinking of?
KVC won't work with protected / package access ivar if there are no
public accessor/mutators.
Some guidance here would be welcome. On generally how moving all
of my code into a package (from the unspecified 'default' package)
will effect various aspects of the WO/EOF frameworks and my use of
them.
The above are the only issues I recall.
Chuck
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.