Recent Comments

7 bundles for highly effective software development

photo

At the Dutch Symfony Meetup on 4th of September (that was generously hosted by my employer LeaseWeb) I have been giving a talk about LeaseWeb’s open-sourced Symfony2 bundles. The slides are available!

1. Software consistency in large teams

Bundle: LswDefaultRoutingBundle – v1.0.1
Github URL: https://github.com/LeaseWeb/LswDefaultRoutingBundle
Description: Symfony2 bundle that provides default routing, relative routing and default templating.

Things like “conventions” and the compliance of those could be measurements for software quality. But having conventions means that you can actually choose not to follow them, which would lead to lower software quality, so why would one allow it? One of these cases is the Symfony routing system. The routes need to be individually specified in the routing configuration using annotations (special comment blocks) in the Controller code of the application or in an YML (or XML) file that resides either on application level or on bundle level.

Well, as you see this written down you might ask yourself: Why do you allow the programmer to have all these choices. Fellow programmers will answer: these are features of the routing system. It is awesome, because it supports all ways I might want to specify my routes. People who look at software quality and cost of maintenance may disagree: having to look at all these places to find a defined route in a software package might make adding a feature or doing a bug-fix more expensive. Also it is prone to typos to have to specify every route individually.

In Symfony1, one could choose to create a default route to avoid having to specify every route individually. In Symfony2 this option is no longer available and the DefaultRoutingBundle has exactly that mission: “bring back default routing functionality to Symfony2″. The aim is to do that in such a way it respects all features and tools the Symfony2 routing system has.

Apart from routing one can also argue that software development gets cheaper when bundles are reused in different software teams. Not only because development times are lower, but also because maintenance can be combined and it provides a way sharing lessons learned between teams.

2. Debugging API based applications

Bundle: LswApiCallerBundle – v1.0.1
Github URL: https://github.com/LeaseWeb/LswApiCallerBundle
Description: Symfony2 bundle that adds cURL API call functionality with full Web Debug Toolbar integration.

In modern web development, the use of web based API’s is omni-present. Connecting to these API’s is not hard at all, but debugging your Symfony application when these API’s fail can be a nightmare. This bundle provides insights  into: call parameters, call responses, time taken per call, total call time, number of calls and errors during calls. This information can be accessed from the Web Debug Toolbar of Symfony in the same way you can access this information for debugging SQL queries made on the database.

The API caller bundle understands different data formats (like XML, JSON and HTML), but can also display responses as plain text. To help developers create healthy (fast) applications the bundle shows the total amount of milliseconds spent to do API calls. It also shows the amount of API calls that are made from a single page. It will these show numbers in green, yellow and red to warn developers to not make too many API calls.

3. Caching for high traffic web applications

Bundle: LswMemcacheBundle – v1.1.0
Github URL: https://github.com/LeaseWeb/LswMemcacheBundle
Description: Symfony2 bundle for Memcache Doctrine caching and session storage in the Web Debug Toolbar.

When building a real high traffic web page you need Memcache. Memcache is a caching server that is very popular for high traffic websites. Especially when you have a web-farm it will become a necessity to use Memcache. You can use your database server(s) as cache server(s) by running Memcache on them.

This bundle provides debugging capabilities, multi-server support and a feature that is rarely used, but very valuable in extreme caching cases: Anti-Dog-Pile support. It also supports MemCached v2, so it is very future proof.

4. High performance and industry standard translations

Bundle: LswGettextTranslationBundle – v1.0.1
Github URL: https://github.com/LeaseWeb/LswGettextTranslationBundle
Description: Symfony2 bundle that adds native (faster) gettext translation support and is easy to use.

Translating agencies are used to work with gettext (worlds most popular translation engine for open source software). Adding translation support to any application is not only complex, it is also a lot of work. A large part of the complexity is in the work-flow. How do you handle updates to the software? How to extract untranslated texts and how to send them to the translators for all supported languages. What formats do they accept? How do you separate the software over different agencies and important: can you reuse part of the translations, like with bundles?

Then there is a performance problem. How expensive is it to render a multi-lingual page? Does it not slow down the application too much? All these questions are answered with this bundle. Since most people will run Linux web-servers with native gettext support we’ve chosen that to get maximum performance. And to optimize translation reuse the choice was made to use one translation file per bundle (per language). The bundle provides commands to extract language files from source-code and the tool “poedit” can be used to enter the missing translations.

5. Better testing support for staging environments

Bundle: LswVersionInformationBundle – v1.0.1
Github URL: https://github.com/LeaseWeb/LswVersionInformationBundle
Description: Symfony2 bundle that adds output of SVN and Git “status” commands to the Web Debug Toolbar.

One of the things you want to know when testing an application is what you version of the software you are testing. In our projects we have chosen Subversion (and recently Git) as our SCM to keep track of versions. Within these systems we use branches and tags to identify versions. But only the programmers who create those tags and the system administrators that deploy these versions know what version is running. This bundle has the mission to “make visible to the testers of the application what version of the software they are testing”. One of the more advanced things the bundle does is that is shows a list of dirty files (if any).

6. Consistent updates for high quality staging

Bundle: LswAutomaticUpdateBundle – v1.0.1
Github URL: https://github.com/LeaseWeb/LswAutomaticUpdateBundle
Description: Symfony2 bundle that enables automatic updates of the application from the Web Debug Toolbar.

This will show in the web debug toolbar which of your (composer) packages are not running stable versions. It also shows when the “composer update” was last run, so that you can see whether or not software maintenance was executed. It also provides (an experimental) feature to update your environment from the web debug toolbar.

7. Symfony1 to symfony2 migration

Bundle: LswRemoteTemplateBundle – v1.0.1
Github URL: https://github.com/LeaseWeb/LswRemoteTemplateBundle
Description: Symfony2 bundle that allows you to load your (view) template from a remote site.

When you want to migrate from Symfony1 to Symfony2 you should probably try to avoid a “big bang” migration. It would be too risky and too much work. Probably managers will not let you work on the migration that could take months, will not bring much new functionality and causes high risk for regression. This bundle allows you to load the template from your symfony1 application while actually sharing your session between both Symfony1 and Symfony2. This way you can gradually migrate from Symfony1 to Symfony2 one Controller or even one view at a time.

One Response to “7 bundles for highly effective software development”

  • Maurits van der Schee:

    If you are a LeaseWeb employee and you are interested in a digital edition of the book Matthias Noback launched during the Meetup, let me know. LeaseWeb employees can apply for a discount on the book!

Leave a Reply