addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1launch-new-window--smalllight-bulblinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Melbourne Symfony Developers Message Board › Symfony2 Code Jam Session 2

Symfony2 Code Jam Session 2

Cameron M.
user 13494565
Group Organizer
Melbourne, AU
Post #: 2
Last night we held our second monthly Symfony2 coding "jam session" as an opportunity for developers to come along and work through a mini-app built in Symfony2.

Our coding jam sessions are about getting stuck into some code to start getting familiar with different aspects of Symfony2. It is done in a small team environment to give us the opportunity to work as a group getting through the coding challenge. It gives everyone a chance to have some dedicated time put aside to getting in and cracking with the code, learning and playing around, which sometimes we find difficult to do!

At our last coding jam, we walked through a symfony2-developed-mini-app showing different components of the framework in action, such as configuration, bundles, controllers, view/twig, ORM etc. This covered ground fast, and allowed people to have some code to walk away with and pull apart. For the next series, we focused on an aspect of MVC - the model.

Last nights session was focusing on Doctrine2. Doctrine2 is the main ORM engine used in Symfony2, and is where most of us will spend time while developing our models. We focused on testing our code through using phpunit, which allows us to test our assumptions about how code works, and makes it easier for us to verify that your code and doctrine2 are playing well together.

Before hand, attendees were provided a EntityTestCase class (available on GtiHub) and a boiler plate project structure that allowed developers to quickly get up and running writing tests and developing models.

The EntityTestCase provided some basic elements, leveraging a SQLLite database, that would assist developers when developing test cases:
- getEntityManager
- getQueryCount/resetQueryCount
- loadSchemas
- loadFixture
- deleteDatabase
- addLifecycleEventListener/addLifecycleEv­entSubscriber
You can obtain this test case online at:­

Developers attending the night would simply extend our supplied EntityTestCase for tests, and write entities into their src entities package.

Our agenda for last night was to cover over developing the classic product + category entity relationship, which was further enhanced by leveraging the "sluggable" and category "nested sets" implementations contained in Doctrine Extensions. An ambitious goal given the time availability, and some of our developers were writing more tests than they had ever written in their life.

The format of the event differed to our last jam session. At our last session, Cameron presented a project, that he rebuilt in the context of the night before hand. Developing the code from the first check-in, he committed the development in stages of logical enhancements. On the night, developers started at the first check-out, and followed through the commits. Cameron then explained all of what was being achieved while developers had a play enhancing the code towards the next check-in.

This unique format allowed the team stay together, giving them a reference to all the necessary coding changes to get them along, and if they got stuck at a page with errors they could simply check-out the next revision and keep moving with the presentation.

Last night, we changed our format to be a lot more "team developed" focus. The end goal of what tests needed to be implemented and an overview of the entity behaviour was described.

Cameron then presented to the group what the necessary steps and process was to implement, explaining the infrastructure of how Doctrine works (relationships with Entity, Entity Manager, Repository, Unit of Work, Queries/DQL/Query Builder, Annotation Readers, Lifecycle Listeners, etc). While this process was going on, Sam armed a laptop connected to a big screen in-front of the developers and went along implementing the challenge at a pace to suit the group.

By the end of the night we hadn't quite implemented all the aspects of what we had hoped to get towards, but the team as a whole advanced to a level they felt comfortable with. Everyone left with new found understanding of how to develop entities in Doctrine2, and had boiler plate code for developing their own models and testing using phpunit.

We have had a lot of interest in our coding jams, and are expanding the capacity of the sessions. We were booked out in capacity last night, and next month has already booked out in advance of the session.

We will be making some new announcements over the next couple of months about new innovative formats to meet up and get playing with Symfony2. The community is striving to boost awareness of how significant this framework is for PHP as a language and the community of PHP developers that already exist. We have held a community planning session (notes are online) that has set our ambitious goals, and we have lots of people already getting involved to assist with us getting Melbourne recognised for its great PHP development community.

For those of you who attended the night, we look forward to seeing you at future events. Your feedback and advice for how we can maximise this community are greatly appreciated, and we would love for you to spread the word for us to grow and expand this community.

For new people, please join the community to hear about future events that are coming up. We are a friendly community that respects everyones level and choices of frameworks. We hope to share and show you why we are so excited about this framework, and how it can assist you advance and grow as a developer.

Cameron M.
user 13494565
Group Organizer
Melbourne, AU
Post #: 3
I forgot, we took some photos from the night:­
James C.
Perth, AU
Post #: 5
Great write up Cam.

The code jam was not only great fun, but it was also very informative.

I learnt a lot about Doctrine 2, and how it differs from Doctrine 1.

Thanks to you and Sam for a great evening!
Powered by mvnForum

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy