Un aperçu de symfony
symfony est un framework orienté objet PHP5 basé sur le modèle MVC. symfony permet la séparation des règles métiers, la logique serveur et les vues de présentation d'une application web. Ce framework contient aussi de nombreux outils et classes qui permettent de réduire le temps de développement d'une application web complexe.
Qu'est ce qu'un framework ?
Un framework ajoute des mécanismes nouveaux au dessus d'un langage de programmation, et ces mécanismes gèrent automatiquement des éléments de développement [en: developement patterns] utilisés pour un objectif particulier. Un framework ajoute aussi de la structure au code, et pousse le développeur à écrire un code de meilleur qualité, plus lisible et plus maintenable. Un framework rends aussi la programmation plus simple, car il assemble des opérations complexes dans des actions simples [en: it packages complex operations into simple statements].
Un framework est habituellement développé dans le même langage que celui qu'il étend. Un framework PHP5 est un ensemble de fichier écrits en PHP5
A framework will add layering to an application. In general, they divide applications in three layers:
- The presentation logic handles the interactions between the user and the software
- The data source logic carries the access to a database or other data providers
- The domain logic, or business logic, is the remaining piece. It involves calculation made on inputs, manipulation of data from the presentation, and dispatching of data source logic according to the commands received from the presentation.
Web application frameworks intend to facilitate the development of... web applications (websites, Intranets, etc.). Building a basic dynamic website can be easily achieved with existing programming languages, and PHP is known for its simplicity and broadly adopted for that purpose. With PHP alone, you can already query a database, manage session cookies, access files in the server, etc. But when it comes to building a more complex website, where business logic increases the volume of code to maintain, the need of a web application framework arises.
Qu'est ce que symfony ?
Symfony is a complete framework designed to help and speedup the development of web applications.
It is based on the following concepts:
- compatible with as many environments as possible
- easy to install and configure
- simple to learn
- enterprise ready
- convention rather than configuration, supporting fallback calls
- simple in most cases, but still flexible enough to adapt to complex cases
- most common web features included
- compliant with most of the web "best practices" and web "design patterns"
- very readable code with easy maintenance
- open source
The main concept underlying the symfony framework is that the most common tasks are done automatically so that the developer can focus entirely on the specifics of an application. There is no need to reinvent the wheel every time a new web application is built.
To fulfill these requirements, symfony was written entirely in PHP5. It has been thoroughly tested in various real world projects, and is actually in use for high demand e-business websites. It is compatible with most of the available databases, among which:
- and any other database if a Creole driver exists for it
The symfony object model relies on three distinct layers:
- a database abstraction
- an object-relational mapping
- a Model-View-Controller model for the front and back-office
Common features of web projects are made easy since Symfony natively automates them:
- templating with helpers
- form validation
- cache management
- shopping cart management
- smart URLs
- email sending
- AJAX interactions
In addition, to fulfill the requirements of enterprises having their own coding guidelines and project management rules, symfony can be entirely reconfigured using YAML configuration files. It provides by default, several development environments, and is bundled with tools to easily achieve the following operations:
- content management
- live configuration changes
- unit testing
- applicative testing
Symfony uses some code fragments of other open source projects:
- Creole, for the database abstraction layer
- Propel, for the object-relational mapping layer
- Mojavi, for the Model-View-Controller model layer
Est ce que symfony est fait pour moi ?
Whether you are a PHP5 expert or a beginner in web application programming doesn't matter. The main factor that should direct your decision is the size of your project.
If you want to develop a simple website with five to ten pages, having limited access to a database and no obligation for performance, availability or documentation, then you should stick with PHP alone. You wouldn't take much advantage of the features of a web application framework, and using object orientation or a MVC model would only slow down your development. Symfony is not optimized to run efficiently on a shared server with only CGI support.
And of course, if you are a professional web developer, you already know all the benefits of web application frameworks, and you need one which is mature, well documented, and with a large community. Search no more, for symfony is your solution.