Search code examples
ormobject-persistence

What's the difference between an ORM and a Persistence framework?


I'm reading up on OOP design patterns and framework design and find myself a bit unshure about the difference between the terms ORM and Persistence framework. Is an ORM a type of PF? What are the different features you can expect of the two?


Solution

  • I would define ORM as a system to map any data to the object/class structure. That data may come from a system that is aimed to be for persist data, but not mandatory. Imagine a JSON mapper that reads data from a network service into an object.

    A persistence framework mostly uses ORM to interface to user code and covers the problematic to make the storage of objects as secure and reliable as possible.

    ORM is more generic term than persistence. ORM may live without Persistence but not vicecersa.