How do I load an external class into the Controller? I'm playing with module building in Drupal 8, but can't really figure out how to include a custom class which does not extend any other. The class' only purpose is to reduce the amount of code I have in a controller. 

However, I get the error: 


  Fatal error: Class 'Drupal\first\FirstClass' not found in /var/www/drupal/modules/first/src/Controller/DefaultController.php on line 30


How do I let DefaultController.php know where to find FirstClass.php? Should I just do an include_once()? 

Routing file: 

first.default_controller_hello:
  path: 'first/hello/{name}'
  defaults:
    _content: '\Drupal\first\Controller\DefaultController::hello'
    _title: 'first Title'
  requirements:
    _permission: 'access content'


Controller function:

namespace Drupal\first\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\first\FirstClass;

class DefaultController extends ControllerBase {

  /**
   * hello
   * @return string
   */
  public function hello($name)
  {
    $a = new \Drupal\first\FirstClass();
    dsm($a);    
    return "Hello ".$name." !" . $a-&gt;getV();
  }
}


Outside Class:

&lt;?php 
namespace Drupal\first;

class FirstClass {


    public static function getV() {
        return 'well it works?';
    }
}
Drupal 8 uses a autoloader standard called PSR-4: http://www.php-fig.org/psr/psr-4/

Practically means your namespaces should result in the following directory structure

first
  - src
  --- FirstClass.php
  --- Controller
  ----- DefaultController.php
  - first.info.yml