Why use link classes in oql instead of classes that contain links

Posted by Isaac on Programmers See other posts from Programmers or by Isaac
Published on 2013-11-08T08:28:25Z Indexed on 2013/11/08 10:18 UTC
Read the original article Hit count: 331

itop abstracts its very complex database design with an object query language (oql). For this there are classes definded, like 'Ticket' and 'Server'. Now a Ticket usually is linked to a Server. In my naive way I would give the Ticket class an attribute 'affected_server_list', where I could reference the affected servers. itop does it different: neither Servers nor Tickets know of each other. Instead there is a class 'linkTicketToServer', which provides the link between the two.

The first thing I noticed is that it makes oql queries more complex. So I wondered why they designed it this way.

One thing that occured to me is that it allows for more flexiblity, in that I can add links without modifying the original classes. Is this allready why one would implement it this way, or are there other reasons for this kind of design?

© Programmers or respective owner

Related posts about database-design

Related posts about class-design