Book a Demo

Author Topic: Setting a custom namespace  (Read 15452 times)

Rob999

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Setting a custom namespace
« on: October 06, 2015, 06:57:59 am »
We have a lot of classes already generated and the package structure does not fit the namespace requirement.  Is there a way to override the namespace (and the namespace used in Imports and Inherits) at the package or class level?  We have some reservations on creating the required packages and moving an entire tree of classes to correct the problem.  We're using VB.net, but I imagine this would be the same as C# or Java.  Thanks

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Setting a custom namespace
« Reply #1 on: October 06, 2015, 08:46:22 am »
No, EA uses the package structure.

Since this is the UML Process forum... In UML a Package is a Namespace.
« Last Edit: October 06, 2015, 08:48:50 am by simonm »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Setting a custom namespace
« Reply #2 on: October 06, 2015, 10:48:50 am »
Quote
No, EA uses the package structure.

Since this is the UML Process forum... In UML a Package is a Namespace.
Indeed, but EA conflates Folders with Packages...

In any browser, each folder CAN'T be a namespace - indeed, EA requires you to nominate the Namespace Root.

So Every package is a Folder, but NOT every folder is a package...

It would be good if EAUI would recognise this fact and support it properly.

Paolo
« Last Edit: October 06, 2015, 10:49:46 am by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Setting a custom namespace
« Reply #3 on: October 07, 2015, 08:31:34 am »
Quote
Indeed, but EA conflates Folders with Packages...
I think you're confusing EA with UML. As I said, UML specifies that a Package is a namespace.

EA does provide more flexibility with namespaces for code generation than UML provides. 'Namespace root' means suppress namespace for this package and all parents. 'suppress namespace' was also added while you were away. It allows the namespace for a single package to be omitted from code. In your terminology it's effectively making it a folder.

However I judged that neither of those points would help Rob999.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Setting a custom namespace
« Reply #4 on: October 07, 2015, 11:02:01 am »
Quote
Quote
Indeed, but EA conflates Folders with Packages...
I think you're confusing EA with UML. As I said, UML specifies that a Package is a namespace.

EA does provide more flexibility with namespaces for code generation than UML provides. 'Namespace root' means suppress namespace for this package and all parents. 'suppress namespace' was also added while you were away. It allows the namespace for a single package to be omitted from code. In your terminology it's effectively making it a folder.

However I judged that neither of those points would help Rob999.
Fair enough...  I also agree that suppress namespace is useful.  I haven't used it yet, but will do in the near future.  I think I first asked for it 7 or so years ago.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!