I am having a hard time trying to figure out if the following design pattern is acceptable. I have the following requirements (and some other more) for a relational model:
1) It must be able to represent applications (such as AppA
, AppB
, AppC
), each one with it's own set of attributes.
2) Every applications can communicate through different channels like Internet
(E-Mail, Twitter, Facebook), Phone
(SMS, MMS, etc.) so that there's a many-to-many relationship between programs and channels.
3) There is a set of pre-defined identifiers (addresses, phone-numbers, login accounts) which can be shared by many programs, so that, again, there's a many-to-many relationship between programs and identifiers.
4) The same identifier can send several types of messages, and so can the programs (again, many-to-many), but I need to be able to restrict usage of identifiers for communications type on a per-application basis.
Basically, what I did was to create four tables, Program
, Channel
, Ident
and CommunicationType
to store information about each of these and, instead of creating junction tables for (Program, Channel)
, (Program, Identifier)
, and so on which would just complicate the design, I created a single table consisting of the primary keys of these four tables with a unique constraint on (Program, Channel, Ident, CommunicationType)
. Now, each record of this table is linked to a given communication.
Of course, this solves my problem in a pretty easy way, but now I am questioning myself whether this is acceptable at all of if it defeats the principles of normalization. Can anyone please give me an opinion?