TAG | best practice
12
jQuery plugin best practices by example
No comments · Posted by Christian in The right tool
After months of no coding at all I found some time to write a bit of code again. As soon as I’m done with it I will probably blog about it but for now I want to share a cool best practice ressource for javascript in general and jQuery in particular.
3
Semicolons in a URI can mess up your Google Analytics figures
2 Comments · Posted by Christian in Good to know

One of our websites is really really old and not really up-to-date in terms of technology, best practices and SEO friendliness as it happens. A weird thing I noticed is that a particular type of page was tracked in Google Analytics correctly but with a different URL than it actually had. So I went to find out what happened..
20
Lessons learned when writing upgrade guides
No comments · Posted by Christian in Outside the box
The pre-releases of Symfony2 come faster and faster now. Each contains an update documentation that briefly describes the major changes and advises what to do when updating. Not too long ago I was in a similar situation. Me and a colleague were releasing an internal software toolkit based on symfony 1.4 and we wrote about 10 update guides.
As there are similarities I thought I’d share a bit of what we’ve learned.
18
Flush chunks if you’re importing huge sets of data using Doctrine 2
6 Comments · Posted by Christian in The real job
I just recently had an import job running that was pulling about 100.000 records from an XML source and pushing those into a database table. As the project this was for is a Symfony2 pet project of mine the technology used is Doctrine 2.0.
As Doctrine 2.0 has switched from the Active Record pattern to the Unit of Work pattern it is no longer necessary to fire one INSERT query per record saved. Instead you can create and persist as many objects as you wish and flush them to the database all at once.
There are however a few caveats you should know about.
8
Symfony2 and Doctrine – Does a level of freedom subtract from the level of usefulness of a framework?
16 Comments · Posted by Christian in Miscellaneous
Symfony2 offers a lot of things. The most prominent feature being the level of freedom it gives to the developers to structure their code as they need it.
When coding with Symfony2 and Doctrine 2.0 though I often get the feeling of not knowing what to do with this freedom and I already heard voices of fellow symfonians to wish a bit of that old magic and restriction of symfony 1 back. Bluntly put: if a framework doesn’t decide anything for you – where’s the benefit?
If you have a history of seeing a rant where none is indended you can stop reading here.
25
Semantic configuration for a Symfony2 Bundle that can be overridden by the application by using a dependency injection extension
3 Comments · Posted by Christian in The real job

When creating a new Bundle for Symfony2 I think it is quite common to desire a custom configuration space that provides a default configuration but allows the user to override or add values in his application.
In Symfony2 this configuration will probably also include the definition of services provided to the application or bundle code by the dependency injection container.
There is already a lot of information about this online but still I struggled to achieve what I wanted.
So I created an example bundle to demonstrate one possible solution.
best practice · Bundles · configuration · dependency injection · dependency injection extension · Symfony2
2
Applying best practices in software architecture decide between the real world and the ivory tower
No comments · Posted by Christian in Good to know
Being a software architect a lot of your work has to do with best practices.
It is best practices that you want to apply to all projects you work on. Of course it is. This sounds only natural.
But it is the definition of the term that decides whether your work will be applicable or not at all.
13
10 Steps I do to fix a bug in a symfony plugin
1 Comment · Posted by Christian in The real job
Since I developed a few symfony plugins I get bug reports. People use these plugins (people in the community or colleagues at work) and find issues.
Usually the answer is a misconfiguration but sometimes of course they found one of the bugs I involuntarily put in the code.
In these cases I have to get down at the code level and try to fix it. This is how I usually do it.
best practice · Debugging · Plugin · plugins · Refactoring · symfony · Unit Tests
24
[Question] How can you develop test driven when you don’t know where you’re going in the first place?
11 Comments · Posted by Christian in Question
I’ve got this one question puzzling me for quite some time now and I got to get it off my chest.
An just to make sure there are no misunderstandings: I am not about to question TDD!
I am merely asking for help to find my way to do it properly..
best practice · Functional Tests · Integrations Tests · Refactoring · TD · Test Driven Development · Tests · Unit Tests
22
How to use doctrine record filters efficiently
2 Comments · Posted by Christian in The right tool
Last week I mentioned that I used doctrines record filters to create virtual columns on a doctrine record and I was asked to explain it in some more detail.
So here I go.
best practice · Doctrine · PHP

