Book a Demo

Author Topic: Drag a view level package to another level in the tree  (Read 11363 times)

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Drag a view level package to another level in the tree
« on: February 10, 2016, 07:07:02 am »
Can anyone suggest a good reason why one cannot drag a view level package to another (higher) level in the tree,
e.g. if I decide to refactor my model!
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Drag a view level package to another level in the tree
« Reply #1 on: February 10, 2016, 08:01:37 am »
The good reason is named heritage. I can imagine that G.S. once thought it would be a good idea to have some distinguished view (rather than a package) on top level. In the very beginning I also thought this would be neat. Until I realized that it's simply - a wrong concept. The view should be abolished. A stereotype can do much better.

q.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Drag a view level package to another level in the tree
« Reply #2 on: February 10, 2016, 08:17:40 pm »
The good bad reason is named heritage.
FTFY. :)

I have not once since 2007 ('06?) run into a situation where I myself, or any of my employers or clients, have thought "oh Gosh, this restriction on the second level in the package hierarchy is really useful. Wow. What a selling point."
I have, on the other hand, run into any number of situations where I've wanted to move a package to or from this magical second level but have been unable to. It also trips up new users, raising the adoption threshold just that little bit.

I can accept that the top level warrants some (some!) special handling. OK fine. But one step down it makes no sense whatsoever. As qwerty says, there are historical reasons, but EA has long since passed the point where it made sense for Sparx to supply any suggestions for structuring your project -- usage is simply too varied.

I might also add as a side note that there is (in 11.1) no corresponding error message when trying to drag a non-view package into a root node. It just fails silently.

Now the good thing is that it shouldn't be that hard to fix. Views are not a separate class in the API, nor are they stored in a special table in the database. They're simply packages, and as such are stored in t_object and t_package, with the fact that they're views stored in t_package.PackageFlags along with the view icon ("isModel=1;VICON=2;").

The flags can be set in the API, and some hacking proves that they're ignored when they don't make sense. So if you set the flags as for a view on a non-view package, that doesn't affect how it is displayed in the project browser, nor does it allow you to move it to the view level of the hierarchy. Similarly, removing the flags for a view only causes it to be displayed with the default icon ("simple"), it doesn't allow you to move it into another package.

So there's some special handling going on in the project browser which checks the actual location of a package before deciding whether to display a view-style icon, and before deciding whether to allow the package to be moved to/from the view level.

Which means it should be easy enough to track down and fix. In order to minimize impact, I suggest the following:
  • Dragging a view into a package: remove isModel flag, keep VICON flag.
  • Dragging a non-view package into a root node: add isModel flag, retain old VICON flag if one exists, otherwise set VICON=1.
How's that sound?


/Uffe
My theories are always correct, just apply them to the right reality.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Drag a view level package to another level in the tree
« Reply #3 on: February 10, 2016, 08:26:36 pm »
I agree with all of the above.
If I could choose we would eliminate the concept of view and just use regular packages.
Having the ability to choose an icon for a package might be useful however for any package.

So lets keep the icon stuff, but allow that for any package, and throw away the restrictions for views.

Geert

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Drag a view level package to another level in the tree
« Reply #4 on: February 10, 2016, 09:09:20 pm »
So lets keep the icon stuff, but allow that for any package, and throw away the restrictions for views.
Works for me. But the default must then be to display the regular package icon, not the "simple" view icon which is the default today.

My thinking with the suggestion to keep the view level as a visual concept but remove the restrictions on moving packages was that it would have a smaller impact on things like help files and sales materials. Smaller changes being cheaper, I figured it would increase the likelihood of getting this done.

/U
My theories are always correct, just apply them to the right reality.

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Drag a view level package to another level in the tree
« Reply #5 on: February 11, 2016, 06:53:14 am »
Reported (feature request) for EA 12
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Drag a view level package to another level in the tree
« Reply #6 on: April 08, 2019, 06:37:57 am »
Not fixed, version 14.1
« Last Edit: April 09, 2019, 07:10:18 am by skiwi »
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Drag a view level package to another level in the tree
« Reply #7 on: April 08, 2019, 06:42:42 am »
Any ideas how I can do this?
Is it OK to export "view level packages", these delete (scary thought) them, then import into new location?
tia
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Drag a view level package to another level in the tree
« Reply #8 on: April 08, 2019, 01:29:15 pm »
Any ideas how I can do this?
Is it OK to export "view level packages", these delete (scary thought) them, then import into new location?
tia
No, you'll likely loose cross package dependencies if you do so.

Geert