Both the approaches are accurate. It really depends on the availability of the information about the battery.
If you have a real battery which is already being used in some application. It is very probable that you can easily obtain the data in form of State of Charge, Temperature etc. via some kind of logging.
In such a case where you already have a battery at you disposal, it might be easier to use the table based approach.
If a physical battery is not available,then you might have some battery under consideration for that particular application. You can easily obtain the parameters required fron an equivalent circuit from the datasheet or whitepapers.