Maggie Nelson

The Example Conundrum

by maggie on Mar.24, 2009, under entry

While working on my presentation about ORMs in PHP for the upcoming php|tek conference in May, I’m finding it slightly challenging to pick a good example of data represented in the application and in the database, so that I could insert various ORMs in between these two ends.

The example should be flexible enough to fit within different ORMs. Think of a scale from ActiveRecord to something really complicated like Java’s Hibernate – that’s the scale for the ORMs. It also needs to be really intuitive, so that the audience of the talk can understand it without much explanation – I want to focus on the ORMs themselves, not something else.

At this point, I’m leaning toward an example representing a user on a social network site and his friends. Something along these lines (don’t beat me up, it’s a very rough draft):

object model:

orm_examples_objects

database model:

orm_examples_tables

I think it’s a good idea to keep this example specific to functionality common in web applications (the alternative is kittens, really). On the other hand, I don’t want the example to be overly complex, so that the audience focuses more on the topic of the presentation rather than the details of the example.

When you come to presentations, what do you look for in examples? Are you looking for something you can basically copy and paste and use in your code? Or are you more interested in high-level theory where examples take a back seat and are there just for flavor but not really to explain?

:, , , , ,
9 comments for this entry:
  1. Andrew

    OmniGraffle dropshadows? tsk tsk

  2. Matthew Purdon

    I think a good example is something that convinces you that your life will be better with the new way of doing things. If you have something that is complex you can show why the extra effort of learning the more difficult tool is worth it because the simpler examples have failed. Please try to incorporate object inheritance into your example though so that you can highlight the individual ORM solutions to the most difficult problem in ORM design.

  3. maggie

    Matt – Yup, that’s a good point. Inheritance in OOP is what’s really difficult to map to databases, especially ones that are very highly normalized. I’ll make this distinction more strict in my examples. Thanks!

  4. Matthew Turland

    Personally, I’m a visual thinker. I prefer practical real-life examples (bonus points if they add entertainment value to your presentation) with visuals to supplement your verbal descriptions, like the ERD you included in this post.

  5. Herman Radtke

    I have to say that I prefer high level theory over examples in presentations. The problem with most examples is that they are often over-simplified so the audience can quickly grasp what the example is showing. If there is something unclear, I can usually ask a question right away and clear up any confusion. Examples are better left to articles and blogs where explaining theory is often too obtuse.

  6. Rinie

    Can you als show the ORM’s strength and weaknesses if you start with the database first (using tables and views).
    I dislike examples that say: create a table. Why not just point it at one I already have…

  7. LornaJane

    Actually I would like to vote for kittens! Or indeed anything different and memorable that will make sense to my brain the way PHP’s “needle”, “haystack” variable names do – the sillier the better :)

  8. Daniel Convissor

    A combination of theory and example makes me happy.

    I learn best by example, so appreciate real world examples that one can copy, paste, (tweak as desired) and run. They can be simple or complex, but they have to work.

    Of course, bigger examples can be a bit much to grasp during a presentation. In this case, break things down into reasonable chunks of key/interesting components. Then provide everything as a tarball folks can download, install and hack on later.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Tags

RSS Planet PHP

  • An intriguing use of lambda functions
    I’ve been working hard on Goodsie.com lately trying to bring it to launch. It’s been great being in on a new PHP project from (near) the beginning, as it frees up a number of things. One of those, is the fact that I can be using PHP 5.3 and all the new features that come with PHP 5.3. While I’ve used my fair share of the short-cut ternary already (?:), the […]
    Eli White
  • Accelerando
    This is a very unusual blog post for the open source area of my website, since it contains a recommendation for a science fiction book. The reason I've put it here instead of the private section is on the one hand, that it will definitely reach more geek - and therefor probably scifi interested - people here. On the other hand, the book I'm writing […]
    Tobias Schlitt
  • First year of Qaiku, and a travel writing challenge
    Qaiku, the conversational microblogging service that launched a year ago had a refresh that launched today. While it hasn't yet convinced the twittering masses, it has already proven itself as a lot more thoughtful platform for the Finnish online community, and as a valuable workstreaming tool. The new version looks quite nice and fresh. Notice the priv […]
    Henri Bergius
  • Getting started with the Midgard content repository
    I'm doing a talk today in the Bossa Conference about using Midgard as a content repository for mobile applications. As part of my presentation I wrote some simple example code for using the Midgard APIs in Python, and thought they would be good to share to those not attending the event as well. The idea of a content repository is that instead of coming […]
    Henri Bergius
  • Neural Networks in PHP
    Neural Networks in PHP By Louis Stowasser Neural networks allow emulating the behavior of a brain in software applications. Neural Networks have always had a too steep learning curve to venture towards, especially in a Web environment. Neural Mesh is an open source, pure PHP code based Neural Network manager and framework that makes it easier to work with […]
    PHP Classes