What is best practice for modules to create new node types in Drupal 7?
In Drupal 6, I have a module that uses hook_schema to define a new mymodule_node table on installation.
This table does nothing more than define the additional fields for my new node type, keyed by nid. I then use hook_load to load these fields in whenever a node of that nodetype is loaded, together with hook_update, hook_delete, hook_insert etc. to keep this table in sync with alterations to the underlying node. This is the same approach I used in D5 and works very well.
However, looking at the node_example in the "Examples for Developers" module, I notice that the approach now taken there is to use the Fields API to define the new node type in hook_install(), creating fields and then attaching them directly to a new node type using field_create_field, field_create_instance, etc. hook_schema is not used at all, and no new tables are created relating to the node type. Furthermore, all the view formatting has changed to define the widgets associated with each field etc.
Just wondered, what are the benefits of switching to use the Fields approach rather than hook_schema for storing custom node type information?
The node_example.module file has a comment
"We no longer need an external database table to store this content types information."