In the simple blog dapp (https://github.com/EOSIO/eosio-project-demux-example) the table (for posts) was defined in the contract but is not instantiated as a field.
What are the advantages/disadvantages using a contract field over creating the table in each action. Is one more efficient RAM/CPU/bandwith-wise for the user or the contract account?
Code for creating in each action:
void action(...)
{
post_table poststable(_self, _self);
posttable.find(...);
}
...
Code for field of contract:
explicit blog(account_name self) : contract(self) poststable(_self, _self) {}
post_table poststable;
void action(...)
{
posttable.find(...);
...