views:

29

answers:

3

I'm working on a personal project problem. It's a donation management model. I need to link donations to entities. For example, the original set of entities that donate are Families, Companies, and Individuals. I want to link donations to these entities and interrelate entities to each other. Is there an example of designing this model where entities could expand and relationships don't get impacted?

A: 

You need to create an entity for donations, contacts, types in the least. A basic idea:

types { id, TypeName } for families, companies, individuals
contacts { id, first name, last name , typeid, add1, addr2 .....}
donations { id, contactID, amount, other fields....}
websch01ar
what happens when 'types' expands. I need something loosely coupled
Chris
If there is a new classification of type, you merely add a new record to the Types table. So lets say a Civic organization like an Alumni Association. You would then have Family, Business, Individual and Alumni Association in the Types table.
websch01ar
A: 

alt text

Damir Sudarevic
A: 

You could always store the data in one table as structures and then have lookup tables for metadata, like the last time a donor was contacted, and add new data structures at will alt text

Don
I don't think I'm ready to believe in the 'metadata' route
Chris
If you change your mind, take a look at Android's source code. This is how the address book is built but with some additional columns
Don