Is there a better way to create an alternative URL Alias Pattern? Say for example my alias pattern for one node is set up as:

style-[node:field_style]/[node:title]


There may be a case that node:field_style is blank so I would like to use another field and a slightly different url alias pattern:

type-[node:field_type]/[node:title]


I am thinking about just using hook_pathauto_pattern_alter() but wondering if there is a better way?
I'd create a token for that specific data; I'm not sure it's necessarily better (or worse) than using the alter hook, but it has the advantage of being reusable elsewhere in the site.

A simple (untested) example:

function MYMODULE_token_info_alter(&amp;$data) {
  $data['tokens']['node']['field_type_or_title'] = array(
    'name' =&gt; t('Field type or title'),
    'description' =&gt; t('Value from field_type if available, node title otherwise.'),
  );
}

function MYMODULE_tokens($type, $tokens, array $data = array(), array $options = array()) {
  $sanitize = !empty($options['sanitize']);
  $replacements = array();

  if ($type == 'node' &amp;&amp; !empty($data['node'])) {
    $node = $data['node'];

    if (isset($tokens['field_type_or_title'])) {
      if ($items = field_get_items('node', $node, 'field_type')) {
        $replacements[$tokens['field_type_or_title']] = $sanitize ? filter_xss($items[0]['value']) : $items[0]['value'];
      }
      else {
        $replacements[$tokens['field_type_or_title']] = $sanitize ? filter_xss($node-&gt;title) : $node-&gt;title;
      }

    }
  } 
  return $replacements;
}