Object-relational mapping (ORM) is a technique for mapping between object-oriented systems and relational databases.

learn more… | top users | synonyms

1
vote
1answer
258 views

Are separate business objects needed when persistent data can be stored in a usable format?

I have a system where data is stored in a persistent store and read by a server application. Some of this data is only ever seen by the server, but some of it is passed through unaltered to clients. ...
14
votes
2answers
5k views

Does it make sense to use ORM in Android development?

Does it make sense to use an ORM in Android development or is the framework optimized for a tighter coupling between the UI and the DB layer? Background: I've just started with Android development, ...
2
votes
2answers
244 views

ORM and component-based architecture

I have joined an ongoing project, where the team calls their architecture "component-based". The lowest level is one big database. The data access (via ORM) and business layers are combined in various ...
1
vote
2answers
191 views

ORM has schema to generate classes, does the reverse exist? [closed]

In Entity-Framework, you can create a DB schema, and then generate your ORM classes. Is there any software that does this in reverse? For example you create a few classes that have relationships, ...
4
votes
1answer
377 views

What is Rainbow (not the CMS)

I was reading this excellent blog article regarding speeding up the badge page and in the last comment the author waffles (a.k.a Sam Saffron) mentions these tools: dapper and a bunch of custom ...
9
votes
2answers
479 views

Non-blocking ORM issues

I asked a question on SO, and found that there are no non-blocking ORMs for my favorite web framework. By non-blocking I mean an ORM with callback support for asynchronous retrieval. The ORM would be ...
11
votes
5answers
681 views

For an ORM supporting data validation, should constraints be enforced in the database as well?

I have always applied constraints at the database level in addition to my (ActiveRecord) models. But I've been wondering if this is really required? A little background I recently had to unit test a ...
0
votes
2answers
280 views

Will TSQL become useless because of new ORMs? [closed]

By introducing LINQ to SQL, I found myself and my .NET developer colleagues gradually moving from TSQL to C# to create queries on the database. Entity Framework made that shift almost permanent. Now ...
2
votes
4answers
320 views

Should OO design, or database design, drive the coding of my @Entity classes?

I have two classes that I want related to each other in an JEE application using JPA2. In an OO world, I would say that a Chatroom has an attribute List messages. In the relational world composition ...
-2
votes
3answers
984 views

Is there really Object-relational impedance mismatch?

It is always stated that it is hard to store applications objects in relational databases - the object-relational impedance mismatch - and that is why Document databases are better. However, is there ...
2
votes
1answer
624 views

Basic design of a data access layer using the DataMapper pattern

I'm trying to understand the DataMapper pattern by implementing it myself for one of my domain objects. So far, I have: class MyDomainObject <attributes> <business logic methods> ...
3
votes
4answers
672 views

In Search of Automatic ORM with REST interface

I have this wish that so far Google hasn't been able to fulfill. I want to find a package (ideally in PHP, because I know PHP, but I guess that's not a hard requirement) that you point at a database, ...
2
votes
3answers
1k views

Thick models Vs. Business Logic, Where do you draw the distinction?

Today I got into a heated debate with another developer at my organization about where and how to add methods to database mapped classes. We use sqlalchemy, and a major part of the existing code base ...
2
votes
2answers
207 views

Does SRP with ORM provoke SOA?

Sorry about the many abbreviations in the title... My observation is that applications built with an object-relational mapping like Hibernate tend to follow a service-oriented architecture instead of ...
16
votes
5answers
909 views

Do ORMs enable the creation of rich domain models?

After using Hibernate on most of my projects for about 8 years, I've landed on a company that discourages its use and wants applications to only interact with the DB through stored procedures. After ...
8
votes
5answers
4k views

When not to use ORM and prefer stored procedures?

I am using PetaPoco micro-ORM. It is indeed very easy and secure to work with databases using ORM tools, but the only thing I hate is extra code. I used to put most of the code in the database itself ...
3
votes
1answer
69 views

Is there any scenario where it's useful to keep mutable properties cached in domain objects for anything else than informational purposes?

Usually in a domain model, you'll have objects, and those objects will have properties that are mutable and properties that are immutable - for instance, a instance id/name will be immutable, while ...
1
vote
2answers
268 views

Pro's/Con's to database table layout as it relates to maintenance & extensibility

Basic pseudo class layout below... class Location(): # Class containing information about a location. id address_one class CustomerLocation(Location): customer_id account_rep class ...
5
votes
2answers
290 views

Immutable design with an ORM: How are sessions managed?

If I were to make a site with a mutable language like C# and use NHibernate, I would normally approach sessions with the idea of making them as create only when needed and dispose at request end. ...
5
votes
2answers
2k views

How can I design a model layer without ORM, and when should I use it?

I'm a PHP developer who started with CodeIgniter. In it, designing models was easy: it seemed like each method defined in models was the equivalent of static methods in a normal, objected-oriented ...
3
votes
1answer
154 views

Who's responsible for a master / slave switch?

We are introducing a master / slave replication schema in our web application. At certain scenarios we would prefer to explicitly direct reads to a slave and writes to the master, which to me is an ...
0
votes
4answers
305 views

To which layer does this code belong?

When I say "Revisional Data Model", I mean a data model where information is never lost: Deletes never destroy any rows, and updates always cause an insert somewhere else to preserve a row's previous ...
4
votes
8answers
1k views

Why are SQL databases still used with ORM?

ORMs and persistence ignorance make perfect sense: if I am programming in a language, then I want to use the language's native implementation of objects and data structures to drive my program. I ...
5
votes
3answers
3k views

DDD with ORM where should the business logic go?

I have used an MDA (model driven architecture) tool in the past where we modeled via UML and this generated the business entities (our domain model) and the ORM (mapping etc) amongst other things. A ...
3
votes
2answers
907 views

Organizing your Data Access Layer

I am using Entity Framework as my ORM in an ASP.Net application. I have my database already created so ended up generating the entity model from it. What is a good way to organize files/classes in the ...
2
votes
2answers
193 views

ResourceSerializable: an alternate to ORM and ActiveRecord

A few opinionated reasons I don't like the traditional ORM and ActiveRecord patterns: They work only with a database. Sometimes I'm dealing with objects from an API and other objects from a ...
16
votes
3answers
2k views

What are some of the benefits of a “Micro-ORM”?

I've been looking into the so-called "Micro ORMs" like Dapper and (to a lesser extent as it relies on .NET 4.0) Massive as these might be easier to implement at work than a full-blown ORM since our ...
29
votes
8answers
9k views

Is ORM an Anti-Pattern? [closed]

I had a very stimulating and interessting discussion with a colleague about ORM and its pros and cons. In my opinion, an ORM is useful only in the rarest cases. At least in my experience. But I don't ...
2
votes
1answer
119 views

Big table with referential integrity or field typification?

I'm using an ORM (Propel) and PHP to create Objects and store them in a database. So, I'm facing a recurrent problem and I'm pretty sure this happened to someone before. My data model looks something ...
13
votes
8answers
762 views

Should you abandon an ORM framework when you need to implement a bulk operation?

Here's a common situation: You need to implement a bulk operation in an application that uses an ORM framework. After the first pass, you've noticed significant performance problems. Here's my ...
3
votes
1answer
319 views

ORM Tools and advantages of circular references in entities

Let me demonstrate a simple example, Class Organization ID type Number, Name type String, HAS A -> Collection Class Facility ID type Number, Name type String, ...
6
votes
1answer
412 views

Do ORM POCOs replace domain entities?

This is somewhat similar to this question but more broad. In general, with ORMs like EF 4.1 supporting POCOs, does it now make sense to have your domain entities be the objects that are persisted to ...
5
votes
2answers
324 views

How to define the seams between the domain layer and a database full of stored procedures?

We have a legacy database full of stored procedures. These stored procedures are somewhat CRUD-categorized but upon inspection of some procedures, they are not "simple" as they might update, delete, ...
6
votes
4answers
475 views

What are the options when Sql generated by ORM needs tuning?

I am starting working on a web project using django. While researching whether to use Sqlalchemy or raw sql when django orm is not sufficient which is also a question I asked here Raw Sql vs ...
6
votes
1answer
2k views

Raw Sql vs SqlAlchemy when Django ORM is not enough

In a django project, if a situation comes that Django ORM is not able to execute some complex queries then there are 2 options: Use Raw Sql queries Use SqlAlchemy I want to know if there are ...
4
votes
4answers
927 views

When is it necessary to use ORM tools?

I was raised in a part of web developmentland where the creation of websites is mostly synonymous with Wordpress, FTP, Joomla, and procedural code, instead of things like TDD, A/B testing, Doctrine, ...
6
votes
1answer
110 views

Data services methods naming

When you work with ORM which implement UnitOfWork pattern (NHibernate's Session, Entity Framework's ObjectContext, etc.), there are two types of data services methods: those which save/commit changes ...
46
votes
14answers
2k views

Is SQL important if I know ORM frameworks well? [closed]

I don't have any serious experience in SQL and I even hate to write SQL instead of LINQ. I am happy enough with ORMs. From the employers and sector view point, is it important to know SQL? Do I have ...
6
votes
4answers
3k views

What are some best practices for populating and using a test database?

So, I'm developing some database-driven RESTful Java web services, using Hibernate and MySQL. For testing purposes, I'm using the H2 in-memory database. H2 is nice and fast, so this has worked out ...
1
vote
1answer
646 views

What is the benefit of using sharp architecture?

I'm working in a project that use nhibernate as orm. Is there any benefit for me to use sharp architecture? what is these benefits?
21
votes
7answers
4k views

How to suggest using an ORM instead of stored procedures?

I work at a company that only uses stored procedures for all data access, which makes it very annoying to keep our local databases in sync as every commit we have to run new procs. I have used some ...
9
votes
6answers
886 views

What kind of Web development projects benefit from using ORM?

I'll start by saying that I've done 95% of my database work using SQL. Recently, I did some investigation of various ORMs, such as NHibernate and Doctrine. I can see the advantages of not needing to ...
16
votes
6answers
9k views

What are some arguments AGAINST using EntityFramework? [closed]

The application I am currently building has been using Stored procedures and hand-crafted class models to represent database objects. Some people have suggested using Entity Framework and I am ...
1
vote
2answers
1k views

Anemic Domain Model, Business Logic and DataMapper (PHP)

I've implemented a rudimentary ORM layer based on DataMapper (I don't want to use a full blown ORM like Propel/Doctrine - for anything beyond simple fetch/save ops I prefer to access the data directly ...
27
votes
6answers
10k views

Should I choose Doctrine 2 or Propel 1.5/1.6, and why? [closed]

I'd like to hear from those who have used Doctrine 2 (or later) and Propel 1.5 (or later). Most comparisons between these two object relational mappers are based on old versions -- Doctrine 1 versus ...
1
vote
3answers
396 views

PHP ORM style of querying

Ok so I have made an ORM library for PHP. It uses syntax like so: *(assume that $business_locations is an array)* Business::type(Business:TYPE_AUTOMOTIVE)-> ...
1
vote
2answers
243 views

How does an agile process deal with ORM?

This question was prompted by this answer, where I quote,"agile + ORM on a large constantly changing database is brutal". So, how can an agile process deal with a constantly changing database? I am ...
5
votes
7answers
991 views

Best arguments for/against introducing ORM technology into a companies dev process [closed]

I have started using ORM technology in the last few years. My first exposure was NHibernate. I then moved onto Linq 2 Sql, and Entity Framework. The issue I have however is, there are some ...
3
votes
5answers
925 views

Do you test your SQL/HQL/Criteria?

Do you test your SQL or SQL generated by your database framework? There are frameworks like DbUnit that allow you to create real in-memory database and execute real SQL. But its very hard to use(not ...
12
votes
3answers
648 views

Does ORM promote database de-normalisation?

Doctrine and Propel both make use of single and concrete table inheritance to map object relationships. The former sees all possible fields in the class tree mapped to a single table - whereas the ...