Drupal 8 at a glance

Haha, Its good to see that Drupal 8 has being used namespaces, Object oriented and weird directory structure.

Alex Bronstein long time core developer and first time on blogger said has written an excellence piece offering a small introduction to change to Drupal 8 or people who are less

familiar with modern PHP and more familiar with traditional Drupal Code.

Drupal 8 API's is not stable yet, many developers are still focusing on making API Changes typically some of these changes will accidentally introduce bugs that we don't discover till later of this year.

Why Drupal 8 used Symphony : Symphony provides components that will allow them to build a great low-level architecture for Drupal 8: HttpFoundation, HttpKernel, Routing,

EventDispatcher, DependencyInjection, and ClassLoader. using symphony may be drupal team can resolve the performance issue.

HTTPFoundation: The HttpFoundation Component defines an object-oriented layer for the HTTP specification.

HTTPKernal: The HttpKernel Component provides a structured process for converting a Request into a Response by making use of the event dispatcher. It's flexible enough to create an advanced CMS system (Drupal).

Routing: The Routing Component maps an HTTP request to a set of configuration variables.

EventDispatcher: Consider the real-world example where you want to provide a plugin system for your project. A plugin should be able to add methods, or do something before or after a method is executed, without interfering with other plugins. This is not an easy problem to solve with single inheritance, and multiple inheritances (were it possible with PHP) has its own drawbacks.

The Symfony2 Event Dispatcher component implements the Mediator pattern in a simple and effective way to make all these things possible and to make your projects truly extensible.

Take a simple example from The HttpKernel Component. Once a Response object has been created, it may be useful to allow other elements in the system to modify it (e.g. add

some cache headers) before it's actually used. To make this possible, the Symfony2 kernel throws an event - kernel.response. Here's how it works:

A listener (PHP object) tells a central dispatcher object that it wants to listen to the kernel.response event;
At some point, the Symfony2 kernel tells the dispatcher object to dispatch the kernel.response event, passing it an Event object that has access to the Response object;
The dispatcher notifies (i.e. calls a method on) all listeners of the kernel.response event, allowing each of them to make modifications to the Response object.

DependencyInjection: The Dependency Injection component allows you to standardise and centralise the way objects are constructed in your application.

ClassLoader: The ClassLoader Component loads your project classes automatically if they follow some standard PHP conventions.

So above these major components of the symphony is being used by Drupal 8.