4 Replies Latest reply on Mar 9, 2009 12:32 PM by egravel_fl

    Namespace definition explosion issue

    egravel_fl
      I'm working on a project that seems very well organized but is causing development pains since it blows the definition of namespace out of proportions! Side note, the project uses the Mate framework.

      The structure is has the following top package folders:

      /domain
      /event
      /eventmap
      /manager
      /service
      /view


      Under each of these are module folders. Example:

      /view/account
      /view/contact


      So in a view that might be built of various other views, I had to define a xmlns for each different package? Is this right? Is there no way to avoid this such as using default namespace?
        • 1. Re: Namespace definition explosion issue
          Level 7

          "egravel_fl" <webforumsuser@macromedia.com> wrote in message
          news:gop0i5$sf8$1@forums.macromedia.com...
          > I'm working on a project that seems very well organized but is causing
          > development pains since it blows the definition of namespace out of
          > proportions! Side note, the project uses the Mate framework.
          >
          > The structure is has the following top package folders:
          >
          > /domain
          > /event
          > /eventmap
          > /manager
          > /service
          > /view
          >
          >
          > Under each of these are module folders. Example:
          >
          > /view/account
          > /view/contact
          >
          >
          > So in a view that might be built of various other views, I had to define a
          > xmlns for each different package? Is this right? Is there no way to
          > avoid
          > this such as using default namespace?

          Pull all of these out into a library project and then put the resulting swc
          in your libs folder...no namespace needed!


          • 2. Re: Namespace definition explosion issue
            egravel_fl Level 1
            And that's the only solution? The problem I see (I think) with this is that the class I'd be putting in this library are the ones having to reference others in the library.
            • 3. Re: Namespace definition explosion issue
              Level 7

              "egravel_fl" <webforumsuser@macromedia.com> wrote in message
              news:gp3a6d$pnc$1@forums.macromedia.com...
              > And that's the only solution? The problem I see (I think) with this is
              > that the class I'd be putting in this library are the ones having to
              > reference others in the library.

              That's the only solution that occurred right off the top of my head without
              researching.

              I know that in AS3 that classes in the same package don't have to import
              each other. Not sure if this is the same for MXML. You might be able to
              experiment with this and make use of it if it is also true for MXML.

              Also, if you just start typing your class name, Builder will automatically
              create a ns definition for you,which may help somewhat.


              • 4. Re: Namespace definition explosion issue
                egravel_fl Level 1
                It is the same. I could place all eventmaps, views, etc in the same package folder and create a namespace such as xmlns:maps="com.company.packages.eventmaps.*". Problem is I'm most likely going to have 100s of classes in these folders. I would rather organize them by introducing another level of folder for module seperation.