Wednesday 14 September 2011

Symfony web application framework


Symfony is a web application framework written in PHP which follows the model-view-controller (MVC) paradigm. Released under the MIT license, Symfony is free software. Symfony aims to speed up the creation and maintenance of web applications and to replace repetitive coding tasks. It requires a few prerequisites for installation: Unix, Linux, Mac OS or Microsoft Windows with a web server and PHP 5 installed. It is currently compatible with the following object-relational mappings: Propel and Doctrine.
Symfony has low performance overheads when dealing with an environment that supports a PHP accelerator. Symfony is aimed at building robust applications in an enterprise context, and aims to give developers full control over the configuration: from the directory structure to the foreign libraries, almost everything can be customized. To match enterprise development guidelines, Symfony is bundled with additional tools to help developers test, debug and document projects.
Symfony makes use of many common and well understood design patterns, such as Model-View-Controller. Symfony was heavily inspired by other Web Application Frameworks such as Ruby On Rails, Django and Spring.

Symfony – Model view controller software architecture:
Model–view–controller (MVC) is a software architecture, currently considered an architectural pattern used in software engineering. The pattern isolates "domain logic" (the application logic for the user) from the user interface, permitting independent development, testing and maintenance of each.
Though MVC comes in different flavors, control flow is generally as follows:
  • The user interacts with the user interface in some way (for example, by pressing a mouse button).
  • The controller handles the input event from the user interface, often via a registered handler or callback, and converts the event into an appropriate user action, understandable for the model.
  • The controller notifies the model of the user action, possibly resulting in a change in the model's state.
  • A view queries the model in order to generate an appropriate user interface (for example the view lists the shopping cart's contents). The view gets its own data from the model. In some implementations, the controller may issue a general instruction to the view to render itself. In others, the view is automatically notified by the model of changes in state (Observer) that require a screen update.
  • The user interface waits for further user interactions, which restarts the control flow cycle.

Some implementations such as the W3C XForms also use the concept of a dependency graph to automate the updating of views when data in the model changes.

The goal of MVC is, by decoupling models and views, to reduce the complexity in architectural design and to increase flexibility and maintainability of code. MVC has also been used to simplify the design of Autonomic and Self-Managed systems. The model manages the behavior and data of the application domain, responds to requests for information about its state, and responds to instructions to change state. In event-driven systems, the model notifies observers when the information changes so that they can react.

The view renders the model into a form suitable for interaction, typically a user interface element. Multiple views can exist for a single model for different purposes. A viewport typically has a one to one correspondence with a display surface and knows how to render to it. The controller receives user input and initiates a response by making calls on model objects. A controller accepts input from the user and instructs the model and viewport to perform actions based on that input.
symfony development | symfony web development | symfony developers