How can I use drupal_static() to save an element in an associative array?
You can use drupal_static to store an array of object.

You can then define a method, lets call it 'getmyobj', to get your data like this :

function getmyobj($obj_name) {
  $objects = &amp;drupal_static(__FUNCTION__);

  if (! isset ($objects[$obj_name])) {
    // Here you load your obejct
    $objects[$obj_name] = method_to_load_your_object($obj_name);
  }
  return $objects[$obj_name];
}


Then you will be able to get you object with the above code :

$obj_a = getmyobj('object_a');