Send Netdot-devel mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://osl.uoregon.edu/mailman/listinfo/netdot-devel
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Netdot-devel digest..."


Today's Topics:

   1. Discussion about Entity, EntityType,      EntityRole tables
      (William Bulley)
   2. Re: Discussion about Entity, EntityType,  EntityRole tables
      (Carlos Vicente)
   3. Re: Discussion about Entity, EntityType,  EntityRole tables
      (William Bulley)
   4. Re: Discussion about Entity, EntityType,  EntityRole tables
      (Carlos Vicente)
   5. Re: Discussion about Entity, EntityType,  EntityRole tables
      (William Bulley)


----------------------------------------------------------------------

Message: 1
Date: Thu, 15 May 2014 12:53:03 -0400
From: William Bulley <[email protected]>
Subject: [Netdot-devel] Discussion about Entity, EntityType,
        EntityRole tables
To: Carlos Vicente <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

The Netdot v1.0.6 values in the "name" column of the "EntityType" table
suggest a more general pupose use for the "Entity" table in Netdot.

netdot=> select * from entitytype;
 id |                           info                                         |  
   name     
----+------------------------------------------------------------------------+--------------
  1 | Branches of our organization.                                          | 
Branch
  2 | Entities that receives products and or services from our organization. | 
Customer
  3 | Departments.                                                           | 
Department
  4 | Companies that manufacture network hardware.                           | 
Manufacturer
  5 | BGP Peers that exchange traffic with us.                               | 
Peer
  6 | Circuit providers.                                                     | 
Provider
  7 | Companies that sell hardware, software or services to us.              | 
Vendor

Here at UofM we have a need to populate the "Entity" table with not just
vendor/manufacturer information such as comes from the "etc/default_data"
file, but also data for departments, units, and customers.  Unfortunately,
having all these rows present in the one table ("Entity") makes for a bit
cumbersome display of user choices, or selections, without a simple method
to discriminate among the different types of entites in the "Entity" table.

The "EntityRole" join table seems tailor made for this purpose, yet its
use in Netdot (v1.0.6 in this case) is quite limited:

   Only three (3) files reference the "EntityRole" table:

      htdocs/contacts/entities.html
      lib/Netdot/Model/Product.pm
      lib/Netdot/Model/Device.pm

   And there are only four (4) instances in those three (3) files:

      htdocs/contacts/entities.html:
         EntityRole->insert({entity=>$entityid, type=>$r});

      lib/Netdot/Model/Product.pm:
         my $erole = EntityRole->find_or_create({entity=>$ent, type=>$etype});

      lib/Netdot/Model/Device.pm:
         if ( $erole = EntityRole->search(%eroletmp)->first ){
         EntityRole->insert(\%eroletmp);

We have an ongoing controversy here how best to address this situation.

One camp wants to add a new "type" column to the "Entity" table that
would hold the foreign key (sequence id value) of a row indicating the
type in the "EntityType" table of the given row in the "Entity" table.

The other camp believes using the existing "EntityRole" table for this
purpose is the way to go.  There's some confusion from the "EntityRole"
table's name, which is a bit misleading.

Is there any advice or guidance in this matter from members of the
netdot-devel mailing list?  Thanks in advance.

Regards,

web...

-- 
William Bulley                     Email: [email protected]

72 characters width template ----------------------------------------->|


------------------------------

Message: 2
Date: Thu, 15 May 2014 13:17:32 -0400
From: Carlos Vicente <[email protected]>
Subject: Re: [Netdot-devel] Discussion about Entity, EntityType,
        EntityRole tables
To: William Bulley <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252


On May 15, 2014, at 12:53 PM, William Bulley <[email protected]> wrote:

> The other camp believes using the existing "EntityRole" table for this
> purpose is the way to go.  There's some confusion from the "EntityRole"
> table's name, which is a bit misleading.

Why is it misleading? It?s a join table. An entity can have many roles, and a 
role can have many entities.

cv


------------------------------

Message: 3
Date: Thu, 15 May 2014 14:32:51 -0400
From: William Bulley <[email protected]>
Subject: Re: [Netdot-devel] Discussion about Entity, EntityType,
        EntityRole tables
To: Carlos Vicente <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

According to Carlos Vicente <[email protected]> on Thu, 05/15/14 at 13:17:
> 
> Why is it misleading? It's a join table.

Which I indicated in my post.   :-)

It is misleading to some here because you use the term "Role" in
conjunction with rows of the "Contact" table.  See also "Person".

And there are two statements:

   my $role = Contact->retrieve($role_id);

in the "htdocs/generic/contactlist.html" file.

> An entity can have many roles, and a role can have many entities.

Clearly since this is the purpose of a join table.  It is the "Role"
part of the table name that causes some confusion here.

But this is the least (most minor) part of my post.

The apparent limited use of the "EntityType" table is the main part
of my post.  I would like to make more use of it, but the question
of "how" has come up.  One approach is to use the join table, and the
other approach would be to add a "type" foreign key column to the
"Entity" table to help differentiate the rows of that table accoring
to their "EntityType" type.

Does anyone have any comments on the "meat" of my post?  Thanks again.

Regards,

web...

-- 
William Bulley                     Email: [email protected]

72 characters width template ----------------------------------------->|


------------------------------

Message: 4
Date: Thu, 15 May 2014 14:35:52 -0400
From: Carlos Vicente <[email protected]>
Subject: Re: [Netdot-devel] Discussion about Entity, EntityType,
        EntityRole tables
To: William Bulley <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252


On May 15, 2014, at 2:32 PM, William Bulley <[email protected]> wrote:

> The apparent limited use of the "EntityType" table is the main part
> of my post.  I would like to make more use of it, but the question
> of "how" has come up.  One approach is to use the join table, and the
> other approach would be to add a "type" foreign key column to the
> "Entity" table to help differentiate the rows of that table accoring
> to their "EntityType" type.

The ?type? foreign key connecting Entity to EntityType is what we had 
initially. It was changed to a many-to-many relationship to make it more 
flexible.

Let?s not go backwards.

cv


------------------------------

Message: 5
Date: Thu, 15 May 2014 14:40:26 -0400
From: William Bulley <[email protected]>
Subject: Re: [Netdot-devel] Discussion about Entity, EntityType,
        EntityRole tables
To: Carlos Vicente <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

According to Carlos Vicente <[email protected]> on Thu, 05/15/14 at 14:35:
> 
> The "type" foreign key connecting Entity to EntityType is what we
> had initially. It was changed to a many-to-many relationship to
> make it more flexible.
> 
> Let's not go backwards.

Thank you!!!   :-)

It is precisely that kind of Netdot history/philosophy that I lacked!

I completely agree about the "not going back" part.

Using the join table is the "right" way to proceed.  Thanks again.

Regards,

web...

-- 
William Bulley                     Email: [email protected]

72 characters width template ----------------------------------------->|


------------------------------

_______________________________________________
Netdot-devel mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-devel


End of Netdot-devel Digest, Vol 86, Issue 10
********************************************

Reply via email to