For my property management admin application I want to assign charges of different types to the properties being managed (e.g. service charge, utilities bill, maintenance costs etc.). So each property on an estate will have many charges associated with it.
In my original spec I have a table for properties/flats and an table for charges that records a foreign key from the property table in order to associate a charge with a property.
New to drupal I implemented this by creating a content type for properties and a content type for charges with a entity reference field to record which property node is related to which charge node. Next I will look into building a form that allows me to fill fields from more than one node at a time and some code to grab the correct property and autofill the entity reference field when adding a new charge by selecting say. 'add charge' from a page that lists properties.
Now I have doubts. I could also create a field collection with all the fields required for a charge (type, amount, date, comment) and allow unlimited values for this field collection. As this field collection is stored as an entity, doesn't this do the same thing as above without having to use the entity reference field and so avoiding some of the coding? Also, if I wanted to add a charge to many apartments at the same time, wouldn't it be simpler using a field collection?
I am too new to drupal to understand the difference. I now it is related to what I want to do with the data after it is stored (it should be available for use in calculated fields, to be listed with data from other nodes, searched for by charge type, for instance) but I don't know how to know which is better without building it twice!