--
You received this message because you are subscribed to the Google Groups "google-guice-dev" group.
To post to this group, send email to google-g...@googlegroups.com.
To unsubscribe from this group, send email to google-guice-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-guice-dev?hl=en.
I made a suggestion on this mailing list some time ago entitled "Move
internal utility code to separate package?" to which the response was
somewhat lukewarm, and included some measure of "not until a major release".
Given that you're now heading into a major release, I'd really like
someone to give me the answer I'm looking for, namely either "Yes, it's
worth you working up a patch for this" or "No, we're not doing it."
Max.
=========== Original email copied below ===========
I've recently been attempting to understand how Guice works. My initial
impression on looking at com.google.inject.internal is "Wow, what a lot
of classes, this is quite daunting!".
On further inspection, it turns out that about a third are general
utility common code. I would like to propose that such classes move to
com.google.inject.internal.util (or similar) to render the package
containing the core internal logic of Guice less crowded.
My initial list of candidates to move is:
AbstractIterator.java
AbstractMapEntry.java
AsynchronousComputationException.java
Classes.java
Collections2.java
ComputationException.java
CustomConcurrentHashMap.java
ExpirationTimer.java
FinalizablePhantomReference.java
FinalizableReference.java
FinalizableReferenceQueue.java
FinalizableSoftReference.java
FinalizableWeakReference.java
Finalizer.java
Function.java
Hashing.java
ImmutableCollection.java
ImmutableEntry.java
ImmutableList.java
ImmutableMap.java
ImmutableSet.java
Iterables.java
Iterators.java
Join.java
LineNumbers.java
Lists.java
MapMaker.java
Maps.java
NullOutputException.java
ObjectArrays.java
Objects.java
Preconditions.java
Sets.java
SourceProvider.java
StackTraceElements.java
Stopwatch.java
Strings.java
ToStringBuilder.java
UnmodifiableIterator.java
The vast majority of these can be moved with nothing more than package
and import statement changes. The exceptions are:
* Classes and Stopwatch would have to change from package-private to
public - I'd classify that as an acceptable compromize for more readable
code, given that all of the others mentioned above are already public
anyway.
* Finalizer and FinalizableReferenceQueue have string literal and
javadoc references to classnames that need fixing up.
You would expect that there would be no dependencies from the utility
package to the rest of Guice. With the above moves, this is nearly the
case: the exception is that StackTraceElements and LineNumbers refer to
some methods in MoreTypes. Proper separation could be attained by
separating MoreTypes into the parts that deal with Guice TypeLiterals
and the parts which deal with pure JDK classes.
Please let me know what you think of this idea, so that I know whether
it's worth me working up an actual patch.
Two classes (Classes and Stopwatch) need to become public. I agree this
is suboptimal, but given Java lacks any kind of hierarchical or "friend"
package access, it's inevitable that if you want to have a utility
package, it will have to be public. I consider that having .internal. in
a package name is a stern warning to any developer foolish enough to try
depending on it.
> If it's doable without these things becoming public, I think our best
> bet is to try and solidify a 3.0 and *then* make the change, similar to
> how 2.0 got pushed last time and then the internals were refactored.
Could do, I guess, but I don't really agree that this makes sense. It
makes most sense to do this in a major version number release. *This*
release is already going to be one, but the next one might otherwise
turn out to be 3.1.
Unlike the post-2.0 refactor, the change I'm proposing is very simple,
just renaming things with pretty much zero functional change, so should
be quick to do, and safe.
Having it happen before the release would ease the work of anyone who
wants to backport fixes from trunk onto the current release.
Max.
> <mailto:google-g...@googlegroups.com>.
> To unsubscribe from this group, send email to
> google-guice-d...@googlegroups.com
> <mailto:google-guice-dev%2Bunsu...@googlegroups.com>.
How close do you think the guice-persist extension is to a stable release? (I tried setting it up in my Eclipse instance the other day, but it couldn't compile due to missing some jar files.) If you're able to write (or can find someone who can write) a failing test for the servlet extension, I can take a stab at fixing it... without a test, though, I'd be flailing around in the dark.
I would very much like to see just-in-time providers in Guice 3.0
http://groups.google.com/group/google-guice-dev/browse_thread/thread/30f5acafb96744ae
--
Doesn't _have_ to be done before the release but would be nice:
* get some Maven2 pom.xml files sorted, and ideally into trunk this time.
I'd be happy to work on that and suggest we simply aim to have minimal
POMs suitable for submitting the built jars to the maven repository -
punt on any thoughts of making the POMs good enough to assist in
generating Eclipse or other IDE projects for now.
Oh, and also:
* Can we include a guice-grapher jar in the 3.0 release?
Max.
I don't think just before a release is the right time to be
contemplating changing the build system from Ant to Maven.
I propose that we should stick with distribution-only poms through 3.0,
and reassess matters after the release.
The first thing we should do is to merge the 2.0-maven branch to trunk
(should be a trivial job for a committer), which just adds the
distribution poms which were actually used for the 2.0 release.
Then, I'd be very happy to write a patch bringing them up to date for 3.0.
> On Fri, Jul 2, 2010 at 1:43 PM, Sam Berlin <sbe...@gmail.com
> <mailto:sbe...@gmail.com>> wrote:
>
> I believe there is a pom.xml in guice trunk, but boy is it old...
> (referencing 1.0-RC2). As much as I hate dealing with maven, a lot
> of people do use it.. so a working pom that can be submitted to a
> repository would be great. If you're able to clean it up & make it
> stable, that would help with submitting it.
>
> I know nothing about the grapher extensions, so can't really speak
> for it... anyone else know the state of it?
It works.
For reasons which were never explained, it was not included in the Guice
2.0 release in jar form.
Max.