Packages layout

Issue #32 closed
Marco Bresciani created an issue

With respect to packages, instead of

package a.b.c.d {
package a.b.c.d.e {
package a.b.c.d.e.f {
class C

}
}
}

shouldn’t it be better to have

package a.b.c.d {
package e {
package f {
class C

}
}
}

Not sure, though.

Comments (9)

  1. Marco Bresciani reporter

    Also, considering the normal working mode of Sketch It!, probably having only one “package” containing all things inside that package whould be better, instead of repeating the packaging for each class. And, probably, classes that are not part of this package but are referred in the diagram, should have their own package highlighted as well… not sure, though.

  2. Marco Bresciani reporter

    Having thse classes: a.b.c.d.A, a.b.c.d.e.f.C, a.b.c.d.e.f.D a probably nicer representation could be

    @startuml
    package a.b.c.d {
      class A
      package e.f {
        class C
        class D
      }
    }
    @enduml
    

    that has a simpler and cleaner representation.

  3. Marco Bresciani reporter

    It works better on version 0.06.00. I’ll anyway add a further optimization. Something like:

    namespace a.b.c.d.e {
    namespace f {
    namespace g {
    class A {
    }
    }
    }
    }

    namespace a.b.c.d.e {
    namespace f {
    namespace g {
    class B {
    }
    }
    }
    }

    should better be rendered as

    namespace a.b.c.d.e {
    namespace f {
    namespace g {
    class A {
    }
    class B {
    }
    }
    }
    }

    to save some space and have a (possibly) clearer view.

    (I’m boring, I know) 🙂

  4. Philippe MESMEUR repo owner

    Hello Marco,

    you are right, the layout you propose would be clearer.

    Unfortunately, generating such a layout would complexity my code (and potentially would add new bugs) but would not bring any value to the displayed diagram.

    So I prefer to keep it like it is… at least for the moment

    Best regards

    Philippe

  5. Andy Costanza

    Hi, with your solution, the diagram doesn’t show class A:

    the correct way is to include all classes in the sames namespace like this:

    i think you need to reopen this issue 😉

  6. Juan Manuel Rodriguez

    I’m having the same issue as Andy, can someone review this please? Is there any work around?

    Thank you!

  7. Log in to comment