Server side technologies Symfony Web Technologies – Prof. Dr. Ulrik Schroeder – WS 2010/11 1 The slides are licensed under a Creative Commons Attribution 3.0 License Robert Heim, Alexander Friesen, Diego Santos
Jun 16, 2015
Server side technologiesSymfony
Web Technologies – Prof. Dr. Ulrik Schroeder – WS 2010/111The slides are licensed under a
Creative Commons Attribution 3.0 License
Robert Heim, Alexander Friesen, Diego Santos
Web-Project's Problems
Web Technologies2
Web-Project's Problems
Web Technologies3
● Security● Complexity, i.e.:
● different output formats (HTML5, XML, JSON, RSS feeds, ...)● Quality Control
● Portability (OS, Databases, ...)● Maintainability
Facing the Server Side
Web Technologies4
Solution: Frameworks =Standards, Best Practices, … !
● Templating● Abstraction (i.e. Security, Database, Sessions, …)● Codegeneration● Proven, tested code● “Plugin” functionality
Symfony
Web Technologies5
● PHP Framework● Founded by Fabien Potencier (2005)● Best Practices● (as seen in Ruby on Rails, Zend, etc.)● Low hosting requirements (PHP, Apache)● Totally Free & Open Source● Rich documentation and big community (10.000+)
Who uses Symfony?
Web Technologies6
Who uses Symfony?
Web Technologies7
MVC Pattern
Web Technologies8
Symfony Approach - Overview
Web Technologies9
● Application Model (MODEL)● Object Relational Mapper
● Modules● Templates (VIEW)● Actions (CONTROLLER)
● Customizing
Application Model
Web Technologies10
● Define the Model(YAML-Format)
Application Model
Web Technologies11
● Symfony related Glue Code
● Database schema
Generating:
Modules (!= Models)
Web Technologies12
Templates:
Controller:
+ executeIndex(...)+ executeNew(...)+ executeShow(...)+ ...
Modules (!= Models)
Web Technologies13
Templates:
Controller:
+ executeIndex(...)+ executeNew(...)+ executeShow(...)+ ...
Module generation
Web Technologies14
● Model → standard operations:Create, Read, Update, Delete (CRUD)
● Generate● Controller: communicating to DB, validation, inject data in templates, ...● Templates: list of objects, forms, …
● Adjust / customize! (but Don't Repeat Yourself (DRY))→ Refactor!
Customization
Web Technologies15
● Configuration files● OOP (extending, overwrite, etc.)● Hook Points● Plugins (1000+)
● User Management● Tagging● Commenting● … whole applications ...
What else?
Web Technologies16
● URL Rewriting/Routing● Fixtures (example data for init-task)● Backend generation● Internationalization (i18n), localizing (i10n)● Convert App to Plugin● Easy Deployment● And much more!
→ www.symfony-project.org
Pro's and Con's
Web Technologies17
● Pro's:● Fast development (generation)● Standards● Scaleability● Many Web-Developers know PHP
● Con's:● Have to learn the framework● Plugins not always stable● PHP (refactoring may be a pain in big projects)
Live Coding
Web Technologies18