What is the Drupal's way of wrapping fields inside a field? It seems that many Drupal gurus disfavor using Field Collection module to wrap fields inside a field. They say it's not the Drupal's way of doing it.

In my current scenario, I need a single field with before &amp; after image subfields. I also need a recipe ingredients field, with ingredient name, unit size (using taxonomy reference) and serving amount subfields.

What is the preferred Drupal's way of doing such a thing? Should you have to code an entirely custom module for each field type?

Update

It seems that the ideal approach is to use a custom field type. Optionally you can use Drupal modules to group fields, such as Composed Field and Multifield, and not-so-favored, architecturally cumbersome, Field Collection. Another solution is to create a content-type for each group of fields and use Entity Reference to reference the field to it.

Ideally I'd like to see an example of a custom field type which implements a text and an image field, or something similar.
You can try https://drupal.org/project/composed_field


  The Field collection uses a different approach for creating composed fields. Here are the main differences between this module and the "Field Collection":
  The host field created by "Field Collection" is in fact an entity that gets attached to the fieldable entities (nodes, taxonomy, comment, commerce products, etc). So, although you attach a Field Collection through the Field UI, what is being attached is not a field but an entity.
  
  Once you get your new entity (host field) attached to your fieldable entity (node, comment, taxonomy, commerce product, etc) then you have to attach the fields ( what would be the subfields ) into the host field ( Field Collection entity).
  
  Each subfield is actually a field on its own, that is, from the database point of view, each subfield is a single field.
  
  "Composed Field" on the other hand attaches a field (host field), not an entity, to your fieldable entities (node, comment, taxonomy, commerce product, etc) through the Field UI. At the end of the day, even if you set a field with say 4 subfields, you will end up having only one field and a single value saved into the database.
  
  Unless you have a very specific use case need "Composed Field" should do what you need with less effort and less resources. 


One more module availabel to achive the similar task is https://drupal.org/project/multifield but it is currently in unstable status


  This project seeks to provide a true compound field solution for Drupal 7. As much as I love Field collection, it still has to save actual entities, and can cause performance problems due to having to load all the referenced field collection entities on node, or parent entity load.