Splitting package among different jars

Discussion in 'Java' started by Sam Takoy, Jun 18, 2010.

  1. Sam Takoy

    Sam Takoy Guest

    Hi,

    Can splitting packages among different jars ever cause a problem?

    And, in this regard, could there be a difference between plain java and
    more elaborate environments, such as tomcat (with custom loaders, etc.)

    Many thanks in advance,

    Sam
    Sam Takoy, Jun 18, 2010
    #1
    1. Advertising

  2. Sam Takoy <> wrote:
    > Can splitting packages among different jars ever cause a problem?


    It can and will, iff you deal with "sealed" packages.

    See: http://mindprod.com/jgloss/jar.html#SEALING
    and: http://java.sun.com/docs/books/tutorial/deployment/jar/sealman.html

    > And, in this regard, could there be a difference between plain java and
    > more elaborate environments, such as tomcat (with custom loaders, etc.)


    If the custom classloaders decide to "seal" the packages they load,
    then it's the same as above. (regardless of any jar-file manifests)
    I wouldn't really expect that to happen, though.

    Other than that all, I think it should be fine.
    Andreas Leitgeb, Jun 18, 2010
    #2
    1. Advertising

  3. Sam Takoy

    Lew Guest

    Sam Takoy wrote:
    >> Can splitting packages among different jars ever cause a problem?


    Andreas Leitgeb wrote:
    > It can and will, iff you deal with "sealed" packages.
    > ...
    > http://java.sun.com/docs/books/tutorial/deployment/jar/sealman.html


    Sam Takoy wrote:
    >> And, in this regard, could there be a difference between plain java [sic] and
    >> more elaborate environments, such as tomcat [sic] (with custom loaders, etc.)


    Andreas Leitgeb wrote:
    > If the custom classloaders decide to "seal" the packages they load,
    > then it's the same as above. (regardless of any jar-file manifests)
    > I wouldn't really expect that to happen, though.
    >
    > Other than that all, I think it should be fine.


    It could potentially make life harder to make sure all JARs are present where
    needed, but other than that it's actually quite standard, for example to
    segregate test classes from production classes.

    --
    Lew
    Lew, Jun 18, 2010
    #3
  4. Sam Takoy

    Arne Vajhøj Guest

    On 18-06-2010 02:50, Sam Takoy wrote:
    > Can splitting packages among different jars ever cause a problem?
    >
    > And, in this regard, could there be a difference between plain java and
    > more elaborate environments, such as tomcat (with custom loaders, etc.)


    Normally it should not cause a problem.

    But I guess it could happen. If the jar files are used
    by different classloaders, then there could be a problem.

    In general I would say that if classes are so coupled that
    they deserve to be in the same package then they are also
    so coupled that they should be in the same jar file.

    Arne
    Arne Vajhøj, Jun 18, 2010
    #4
  5. Sam Takoy

    Roedy Green Guest

    On Fri, 18 Jun 2010 02:50:38 -0400, Sam Takoy <>
    wrote, quoted or indirectly quoted someone who said :

    >Can splitting packages among different jars ever cause a problem?


    Why are you doing this? Are you trying to put rarely used classes
    into a lazily loaded jar?
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com

    There is no harm in being sometimes wrong especially if one is promptly found out.
    ~ John Maynard Keynes (born: 1883-06-05 died: 1946-04-21 at age: 62)
    Roedy Green, Jun 19, 2010
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ike
    Replies:
    6
    Views:
    1,030
    Andrew Thompson
    Sep 24, 2004
  2. Replies:
    5
    Views:
    8,993
  3. JavaEnquirer
    Replies:
    2
    Views:
    496
    JavaEnquirer
    Feb 22, 2006
  4. John Ericson
    Replies:
    0
    Views:
    417
    John Ericson
    Jul 19, 2003
  5. Ulf Meinhardt
    Replies:
    2
    Views:
    1,382
Loading...

Share This Page