Help with Understanding Sub Types

Posts   
 
    
briankb
User
Posts: 51
Joined: 03-Jun-2007
# Posted on: 13-May-2008 07:19:14   

a simple set of tables I'm working with now are:

Tickets -TicketID -UserID -CategoryID -StatusID

TicketMessages -TicketMessageID -TicketID -Message

TicketCategories -TicketCategoryID -TicketCategoryParentID (links back to this table on TicketCategoryID) -Name

[Example Rows] TicketCategory.Name=Registration (ID=1) TicketCategory.Name=Purchase (ID=2) TicketCategory.Name=Purchase . Refund (ID = 3 or 2.3) TicketCategory.Name=Purchase . Duplicate Charge (ID = 4 or 2.4)

TicketStatus -TicketStatusID -Name _ [Example Rows] TicketStatus.Name=Unread TicketStatus.Name=Resolved TicketStatus.Name=PendingSupervisor TicketStatus.Name=PendingCustomer_

I can see some use in setting up sub-types for TicketCategories and TicketStatus. But my understanding of sub-types is just beginning.

Should I even worry about sub-types with these tables? Could it help with TicketCategories which is self referencing?

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 13-May-2008 09:34:40   

I don't see a need for subTyping (Inheritance).

To grasp the idea, please read the following manual's section: Concepts -> Entity inheritance and relational models

briankb
User
Posts: 51
Joined: 03-Jun-2007
# Posted on: 13-May-2008 10:39:30   

I actually did read the concepts and a few other online resources. From what I understand you use subtypes to create sub sets of another entity with unique properties.

an example I read about was People is the supertype and it has subtypes of Female and Male, is that right?

So I thought it would apply to the Ticket Category and Ticket Status which relate to Tickets.

Thanks for your input. I'll try to find a few more resources before thinking about this again.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 13-May-2008 10:50:56   

People is the supertype and it has subtypes of Female and Male

Actually Male and Female is a value of a Gender property of the People entity. Unless Males will have different attributes than females, and each would play a different role in your system, in this case you might create subTypes from the People entity.

eg. Males can be sperm donors but females can't. And you need to create this relation specific to males, in this case inheritance might help.