IDEA: Nested Packages in Java

Discussion in 'Java' started by Davin Pearson, Oct 8, 2005.

  1. I have written an article explaining a
    flaw in the design of Java packages
    and a design pattern that gets
    around this limitation...

    Click on the following link to read my article:

    http://www.geocities.com/davinpearson/research/2005/npij.html

    So what do all the Java programmers out there
    think of my proposal...
    Davin Pearson, Oct 8, 2005
    #1
    1. Advertising

  2. Davin Pearson

    Roedy Green Guest

    On 7 Oct 2005 23:32:50 -0700, "Davin Pearson"
    <> wrote or quoted :

    >http://www.geocities.com/davinpearson/research/2005/npij.html


    I think all you are saying is that you want to treat hierarchical
    package names as being related by the hierarchical structure rather
    than treated as totally independent as now.

    You could do it so that leaves can see branches. I don't think you
    should allow branches to see leaves. So basically you are relaxing
    the package scope to allow subpackages to view their mother packages
    as if they were directly part of them.

    ..

    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
    Roedy Green, Oct 8, 2005
    #2
    1. Advertising

  3. Davin Pearson

    Tim Tyler Guest

    Davin Pearson <> wrote or quoted:

    > I have written an article explaining a
    > flaw in the design of Java packages
    > and a design pattern that gets
    > around this limitation...
    >
    > Click on the following link to read my article:
    >
    > http://www.geocities.com/davinpearson/research/2005/npij.html
    >
    > So what do all the Java programmers out there
    > think of my proposal...


    One of the last times we discussed Java's fake package heirarchy,
    (on the "more granularity in class scoping" thread here back in 2003)
    I doubted whether it would ever happen for Java.

    That was a while ago now - and usually change gets more difficult
    as you age.

    The whole idea of packages and classes being different seems tied
    in with Java's convention of mapping classes to files and packages
    to directories.

    However, it's a bit of a silly distinction from just about any other
    perspective.

    The result is two ways of making objects nest within each other -
    when all that is really needed is one way.

    IMO, future languages should not inherit Java's package/class split.

    Instead they should only have objects - and they should have
    much more flexible permission modifiers, to allow or restrict access
    to ancestors, offspring, siblings and perhaps other kin and named
    friends.
    --
    __________
    |im |yler http://timtyler.org/ Remove lock to reply.
    Tim Tyler, Oct 9, 2005
    #3
  4. Davin Pearson

    Guest

    Davin Pearson skrev:

    > I have written an article explaining a
    > flaw in the design of Java packages
    > and a design pattern that gets
    > around this limitation...
    >
    > Click on the following link to read my article:
    >
    > http://www.geocities.com/davinpearson/research/2005/npij.html
    >
    > So what do all the Java programmers out there
    > think of my proposal...


    Hi,

    I'm still working through the code example, but on first reading, I
    can't help but notice the quote: "Importantly, we are looking at
    package visibility applied to fields (methods and properties) but not
    to classes."

    Why not examine class visibility similarly? Then Java could be, " ...
    re-engineered so that it no longer has this limitation," on
    class-level, either.

    For what it's worth, and precisely because of the containment
    hierarchy, I think alpha.beta classes should be able to see alpha
    classes, but not the other way round.

    See: www.EdmundKirwan.com/servlet/fractal/frac-page50.html

    ..ed

    --
    www.EdmundKirwan.com - Home of The Fractal Class Composition.
    , Oct 10, 2005
    #4
    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. Paul  Smith
    Replies:
    0
    Views:
    723
    Paul Smith
    Nov 18, 2003
  2. Replies:
    10
    Views:
    1,222
    Big K
    Feb 2, 2005
  3. Dr Mephesto

    App idea, Any idea on implementation?

    Dr Mephesto, Feb 4, 2008, in forum: Python
    Replies:
    3
    Views:
    702
    Dennis Lee Bieber
    Feb 5, 2008
  4. David Lyon
    Replies:
    19
    Views:
    561
    David Lyon
    Apr 24, 2009
  5. Ian
    Replies:
    3
    Views:
    159
Loading...

Share This Page