Book a Demo

Author Topic: Why does EA enforce a root node to have a second level of "views"?  (Read 16495 times)

YogaMatt

  • EA User
  • **
  • Posts: 111
  • Karma: +8/-0
    • View Profile
Does anybody know ...

Why does EA enforce a root node to have a second level of "views" before you can add a package to the third level?
Or, put another way, why can't packages be placed directly under nodes? What's the essential difference between packages and views in the browser?

Thanks in advance.

PeterHeintz

  • EA Practitioner
  • ***
  • Posts: 1001
  • Karma: +59/-18
    • View Profile
Re: Why does EA enforce a root node to have a second level of "views"?
« Reply #1 on: May 25, 2016, 09:35:18 pm »
This is a question that I asked myself as well and it means form e I have to do some things I just do to satisfy EA. I assume the more historical than really needed.
Best regards,

Peter Heintz

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Why does EA enforce a root node to have a second level of "views"?
« Reply #2 on: May 26, 2016, 02:16:02 am »
This is pure legacy. It has been discussed here to give that up (and it would probably be easy), but Sparx is very conservative when it comes to such kind of useless stuff.

q.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Why does EA enforce a root node to have a second level of "views"?
« Reply #3 on: May 27, 2016, 12:14:55 am »
What's the essential difference between packages and views in the browser?
I dug through this a while back. Here's what I came up with. Use this information at your own risk.

A regular package is represented by both a t_package row and a t_object row. They appear to have the same ea_guid, but Sparxians have warned us before that that is subject to change without notice. However, the t_object.PDATA1 column will match t_package.Package_ID.

A View package has the same representation in the database, except there is additional information in t_package.PackageFlags, namely isModel=1;VICON=n;, where n is 0-5, specifying the view icon shown in the project browser.

A Root Node is a little different still. It only has a t_package row, not a corresponding t_object one. Its t_package.PackageFlags is set to isModel=1;, but it has no view icon. t_package.Parent_ID is 0.

EA prevents you from moving root nodes and views to other levels in the package hierarchy, and from moving a regular package to the root or view levels. You can work around this using the API (by setting Package.ParentID), but only for moving between the view and package levels, not to/from the root level.

This explains why views, but not root nodes, behave as regular packages in that they can be shown in diagrams and be the source or target of connectors: it's because root nodes are not t_objects, just t_packages, and only t_objects can be can be used that way in the EA data model.

Hope this confuses you further helps,


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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Why does EA enforce a root node to have a second level of "views"?
« Reply #4 on: May 27, 2016, 05:24:23 am »
Basically because of and as a result of the previously stated effects, EA treats roots and view differently in the code. Still, it would not be difficult to unify this via stereotypes. But Sparx IS conservative. Rumors have it, they made the model for conserving the mummies of the Pharaos. - Just kidding. Their boss is actually a re-incarnation of a mummy  ;D

q.

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Why does EA enforce a root node to have a second level of "views"?
« Reply #5 on: May 27, 2016, 07:07:09 am »
Basically because of and as a result of the previously stated effects, EA treats roots and view differently in the code. Still, it would not be difficult to unify this via stereotypes. But Sparx IS conservative. Rumors have it, they made the model for conserving the mummies of the Pharaos. - Just kidding. Their boss is actually a re-incarnation of a mummy  ;D

<ob pedantry>The mummy is the part that doesn't get reincarnated.</pedantry>

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Why does EA enforce a root node to have a second level of "views"?
« Reply #6 on: May 27, 2016, 08:25:46 am »
I actually meant that movie, you know? Where that mummy comes to live again. Can't recall the title.

q.

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Why does EA enforce a root node to have a second level of "views"?
« Reply #7 on: May 27, 2016, 09:56:30 am »
I actually meant that movie, you know? Where that mummy comes to live again. Can't recall the title.

Throw Momma from the Train.   :P

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Why does EA enforce a root node to have a second level of "views"?
« Reply #8 on: May 27, 2016, 10:06:30 am »
I actually meant that movie, you know? Where that mummy comes to live again. Can't recall the title.

Throw Momma from the Train.   :P
For the benefit of those NOT from the southern hemisphere, Kiwi's have a weird sense of humour (even by Aussie standards).

Still, it IS Friday!

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

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Why does EA enforce a root node to have a second level of "views"?
« Reply #9 on: May 27, 2016, 10:10:26 am »
For the benefit of those NOT from the southern hemisphere, Kiwi's have a weird sense of humour (even by Aussie standards).

One of the basics of comedy is the unexpected answer.  It does help that help that our official languages are all biased towards the figurative rather than the literal.   

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Why does EA enforce a root node to have a second level of "views"?
« Reply #10 on: May 27, 2016, 06:22:34 pm »
I actually meant that movie, you know? Where that mummy comes to live again. Can't recall the title.
Throw Momma from the Train.   :P
Surely that's Throw Momma from the Train II ?

In the first she gets thrown off, in the sequel, to quote Sir Elton, the bitch is back.  ;D
My theories are always correct, just apply them to the right reality.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Why does EA enforce a root node to have a second level of "views"?
« Reply #12 on: May 30, 2016, 09:54:58 am »
[SNIP]
For the benefit of those NOT from the southern hemisphere, Kiwi's have a weird sense of humour (even by Aussie standards).
Sunday, saw the new Kiwi movie:  "The hunt for the wilderpeople".  (Wilderpeople as in Wildebeest)  A fine example of Kiwi humour!  Laugh out loud stuff.

Great movie for a weekend!  Highly recommended!

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

YogaMatt

  • EA User
  • **
  • Posts: 111
  • Karma: +8/-0
    • View Profile
Re: Why does EA enforce a root node to have a second level of "views"?
« Reply #13 on: July 21, 2016, 09:08:03 pm »
What's the essential difference between packages and views in the browser?
I dug through this a while back. Here's what I came up with. Use this information at your own risk.

A regular package is represented by both a t_package row and a t_object row. They appear to have the same ea_guid, but Sparxians have warned us before that that is subject to change without notice. However, the t_object.PDATA1 column will match t_package.Package_ID.

A View package has the same representation in the database, except there is additional information in t_package.PackageFlags, namely isModel=1;VICON=n;, where n is 0-5, specifying the view icon shown in the project browser.

A Root Node is a little different still. It only has a t_package row, not a corresponding t_object one. Its t_package.PackageFlags is set to isModel=1;, but it has no view icon. t_package.Parent_ID is 0.

EA prevents you from moving root nodes and views to other levels in the package hierarchy, and from moving a regular package to the root or view levels. You can work around this using the API (by setting Package.ParentID), but only for moving between the view and package levels, not to/from the root level.

This explains why views, but not root nodes, behave as regular packages in that they can be shown in diagrams and be the source or target of connectors: it's because root nodes are not t_objects, just t_packages, and only t_objects can be can be used that way in the EA data model.

Hope this confuses you further helps,


/Uffe

I enjoyed everyone else's banter, but thanks to Uffe I have a path to automate project template instantiation.