Click here to Skip to main content
15,884,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

My question from yesterday was a bit confusing so I decided to reprhase the problem.
We want to desing a connector database.

A connector is composed of its housing which has in general 1...N cavities, and in each cavity can be a terminal.
The cavities can differ (in practice one connector can have max 4 different cavities).
Each cavity is compatible with some set/sets of terminals.
There can be 1 - N terminals in one set of terminals.

We want to desing the database so we are able to match any cavity of given connector with all possible terminals/ terminal sets.

Example:
Find all Compatible Terminals for pin1/cavity1 of Connector XYZ.

or

Find all Connectors using terminal XYZ

I've designed following tables:

table Housing:
ID_Hous (Primary Key)
Manufacturer
SUPPLIER_PART_NUMBER
SUPPLIER
MATERIAL
NOTE
PITCH
etc.

So we are able to match each pin with a terminal, I've defined a tabel called PIN_LAYOUT:
ID_Hous (Primary key)
PIN (Primary key)
SET_ID (Primary key)

table of Terminal Sets:
SET_ID (Primary key)

Each terminal belongs to some set, BELONGS_TO_SET table:
SET_ID
TERMINAL_ID

and table of terminals:
TERMINAL_ID (Primary key)
SUPPLIER_PART_NUMBER
CURRENT_LOAD
MATERIAL
SURFACE_FINISH


My concerns are related to the PIN_LAYOUT table. Because of lack of experiences with DB design, I'm affraid of the composite key, but I've no Idea, how to keep the possibilities described in example above and to "simplify" the DB.

Also what would you suggest? Should I keep the TERMINAL_SET table? because I can throw away the TERMINAL_SET and BELONGS_TO_SET tables and pair the Terminals directly in PIN_LAYOUT I guess with a cavity_id, which would be some automatically generated number.

Picture of the relations[^]
Posted
Updated 23-Feb-15 23:34pm
v3
Comments
Maciej Los 23-Feb-15 2:09am    
"But the Cavity itself has no ID" - really? So, what this: "table Cavities ID_Cavity (Primary key)" means?
HellMaster[cz] 23-Feb-15 3:11am    
That's an ID created by myself as a placeholder. But in general I think it's not a good way to design the database this way.
Let's assume someone (the admin) will insert a new connector. He defines there are two cavities with unique ID's. After few month's the admin has to insert another connector, which has compatible terminals as the previous one (most probably same cavities). So he has to match the Terminal with the cavity ID, but because the cavity is stored just as a number, nobody will memorize it.

And my second concern is, when the admin has to add special names/keys just to distinguis the cavity, but this information won't be used by anyone, then it's a bit waste and of course its annoying for the user to write down all the parameters during insertion for nothing.
Maciej Los 23-Feb-15 4:06am    
Not sure i understand you well, but...
Relational database is used for such of functionality. No one need to memorize anything (id's especially). You use id's only to uniqueally identify each record. In GUI, you should display the name of cavity, house, etc. I'd suggest to read about RDBMS.
HellMaster[cz] 23-Feb-15 4:29am    
And here comes the problem. The cavity has no name. It's just a hole. Maximaly there are dimensions of the hole (it can be round - diameter, or square etc.), but you can have same dimensions for different cavities. There can be a slight difference in the cavity and the terminals are not compatible anymore.

Example without cavities:

Connector_A -> terminal_A
Connector_A -> terminal_B
Connector_A -> terminal_C

But I don't have the info, which terminal corresponds to which hole and also how many holes there are for the given terminal type (or set). Thus I would like to include a relation to say, there are two different holes, hole A 5x, hole B 5x. Terminal set A is compatible with hole B, terminal set B is compatible with set A. Not sure, if its a bit more clear.

When the user inserts the connector, he needs to say, I'm inserting a connector with two different cavities. But he is not aware of some cavity ID.

So how to link connector and terminals and keep the information how many terminals from given set can be used with that connector (because the connector has limited number of holes/cavities for it).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900