Episode 55: Object-Relational Mapping
Podcast: Play in new window | Download
Tired of the same old database grind? Why not try an Object Relational Mapper.
News/Follow-ups
- 00:38 – Jade likes his tablet again, thanks to Windows 7
Geek Tool
- 04:25 – The perfect Valentines geek tool, Heart Warmer
Webapps
- 07:11 – Ketchup – Super simple meeting agenda creator
- 08:15 - MinuteBase – Collaborate on meeting notes
Topic
- 16:19 – Object-relational mapping
- What is it?
- Typical non-ORM work flow
- Pros
- Less code, just manipulating the objects
- OOP you are working with objects already
- Data language is in your language, don’t need to learn new syntax
- Inheritance
- Distributed database security
- Benefit of the knowledge of everyone writing the ORM
- Database integration abstraction
- Switch database back-ends with little hassle (depending on ORM)
- Cons
- Object-Relational Mapping is the Vietnam of Computer Science
- Poorly designed databases
- Because you are working strictly with the database, databases usually aren’t optimized
- Overhead
- ORMs have a lot overhead that can affect performance
- Examples
- Ruby
- Python
- PHP
February 27th, 2010 at 8:29 am
We use ORMs for every new project. The pros far outweigh the cons. We use a bottom up approach so we design the database first. The only time I wouldn’t possibly use one is when working with a legacy database. There are a lot of poorly designed databases out there.
Two more ORMs.
Java – Hibernate
.Net – nHibernate
February 27th, 2010 at 9:46 am
So you design the database, then wrap the ORM around it. That is a good way to keep your databases optimized and sane. I didn’t really think about that
February 27th, 2010 at 11:25 am
Exactly. We use Seam Framework and this is the preferred approach. Once the database is in place we run a generator that looks at the database and creates all of the entities, wiring, and views. It is much like scaffolding in Rails. You have a working CRUD app at this point to work with.