On Github xavierbriand / Presentation_SOA
Senior Web Application Developer
ExperiencePoint Inc
(please excuse my accent)
SensioLabs trainings/coaching"The best way to learn is to experience."
21 employees academics and corporations Change Management Innovation (Design Thinking)(1+½)+(4+3) simulations
Frontend App Backend App (simulation + Flash app) x5 Low load, high available (2lb fallback + 3 server + 2 db server fallback + backup infra)tightly coupled applications
no dependency management
no tests
deprecated technologies
1 dev symptoms
2 environments
SVN
manage the existant while migrating, no big switch to convert everything can simply deploy one app if model changed No way to know which application use which part of the other application Physical environment (platform) == framework environment SVN, hard to branch, hard to merge => dev don’t branch Flash AMF (support issues), hard to debug; symfony1.0, no php 5.4
Goal: efficient dev environment
VM
Modern SCM
Modern Frameworks
Tasks automation
logo: WizardCat
$ make build
Composer As easy as adding a package.json file as easy as: composer install Fetch code source from outside (scscmgnostic) Set dependencies on your php version and packages Satis for private repository{ "name" : "ep/ec", "license" : "proprietary", "autoload" : { "psr-0": { "": "src/" } }, "require": { "php" : ">=5.3.3", "symfony/symfony" : "~2.4", "doctrine/orm" : "~2.2,>=2.2.3", "ep/backend-sdk-bundle" : "dev-master", "ep/old-stuff" : "dev-trunk" }, "require-dev": { "phpunit/phpunit": "3.7.*" } }
$ php composer.phar ______ / ____/___ ____ ___ ____ ____ ________ _____ / / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/ / /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ / \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/ /_/ Available commands: install Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json. require Adds required packages to your composer.json and installs them search Search for packages self-update Updates composer.phar to the latest version. status Show a list of locally modified packages update Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file. validate Validates a composer.json
composer (Platform packages)
incenteev/composer-parameter-handler
$ make build
Application should be unaware of physical environment details, but should provide requirements. composer help to define those requirements Dependency injection container and bundle extension make the work pretty easy for sf2 Use those good practices for sf1$ make prepare analysis
check style complexity duplication tests + code coverage trendDivide and gather (DRY)
Keep things small + KISS
Design by contract
Leverage your architecture
Where there code duplication there is an opportunity to gather this code and create a new module\ Small concern == small responsability => easier to dev/test/deploy Design by contract Black box, expose interfaces. Benefits: Easy to manage, defined boundaries, independant Constraints: interface versioningRemove Flash... No! Ok but:
AMF => plain HTTP via browser
Business Logic => Backend
Frontend UI => Flash
> POST /games/ + content < 201 Created < Location /games/1
> GET /games/1 < 200 Ok < < <game> < <!-- ... --> < <links rel=”actionX” src=”...”></links> < <links rel=”actionY” src=”...”></links> < </game>
David Zuelke "Designing HTTP Interfaces and RESTful Web Services"
The HATEOAS constraint serves to decouple client and server in a way that allows the server to evolve functionality independently, browse a collection with previous/next linksBackendAppSdkBundle
OAuth2ClientBundle
ApiBundle
AssetsBundle
joind.in/9999 (four 9)