# Overview To give you a full understanding of how Hyperf works, this document gives you technical details, but it's not an introductory tutorial or a reference document (we've also prepared these for you, of course). ## Write Routes Hyperf uses `nikic/fast-route` to provide routing capabilities, and you can easily write your route in `config/routes.php`. In addition, the framework also provides routing annotation [routing](). ```php // config/routes.php use Hyperf\HttpServer\Router\Router; Router::get('/', 'App\Controllers\IndexController@index'); ``` ## Handle Request ```php input('id', 1); return (string)$id; } } ``` ## Auto Inject When you use `make` and `get`, the framework automatically injects container's singleton objects. For example, we implement a UserService. The framework provides constructor injection and annotation injection. ```php container = $container; $this->dao = $container->get(UserDao::class); } public function get(int $id) { return $this->dao->first($id); } public function book(int $id) { return $this->book->first($id); } } ``` Let's rewrite the IndexController above to execute the UserService method. ```php container = $container; } public function index(RequestInterface $request) { $id = $request->input('id', 1); $service = $this->container->get(UserService::class); return $service->get($id)->toArray(); } } ``` ## Create objects Hyperf implements AOP aspect programming based on PHPParser. To support annotations, origin classes are rewritten, so create objects in the following way instead of simply new. Of course, this is only a suggestion, not a requirement. ```php container->get(UserService::class); $user = $class->get(1); var_dump($user->toArray); $form = make(UserForm::class,['data' => $data]); $form->save(); ```