Maggie Nelson

databases and code goodness

  • Author: maggie
  • Published: Mar 24th, 2009
  • Category: entry
  • Comments: 9

The Example Conundrum

Tags: , , , , ,

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?

Tags: , , , , ,

9 Responses to “The Example Conundrum”


  1. Andrew
    on Mar 24th, 2009
    @ 1:12 pm

    OmniGraffle dropshadows? tsk tsk


  2. Matthew Purdon
    on Mar 24th, 2009
    @ 3:18 pm

    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. EllisGL
    on Mar 24th, 2009
    @ 3:29 pm

    Sort of reminds me of the coversation over at: http://www.dreamincode.net/forums/index.php?act=ST&f=14&t=79915


  4. maggie
    on Mar 24th, 2009
    @ 3:40 pm

    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!


  5. Matthew Turland
    on Mar 24th, 2009
    @ 5:09 pm

    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.


  6. Herman Radtke
    on Mar 24th, 2009
    @ 7:32 pm

    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.


  7. Rinie
    on Mar 25th, 2009
    @ 2:11 am

    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…


  8. LornaJane
    on Mar 25th, 2009
    @ 4:30 am

    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 :)


  9. Daniel Convissor
    on Apr 1st, 2009
    @ 2:13 pm

    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.

© 2010 Maggie Nelson. All Rights Reserved.

This blog is powered by the Wordpress platform and beach rentals.