Drupal commerce shipping - based on country and the product category

Recently we built a custom commerce shipping module for an online Guitar shop. The shipping cost was required to be based on the country selected in the shipping address and also on the size of the goods i.e. category of the product. A provision is also made to set a default price for a country/category for which shipping cost is not set in the database.

Example shipping method was used as the base to create the custom module.