My friend Bill points out that ObjectSpaces has been delayed until Longhorn. I could be wrong, but I sense the initial enthusiasm for ObjectSpaces is waning. So now I’m pondering:
Do we need O/R mappers anymore? Did we ever?
At the risk of sounding like someone who thinks SOA will solve all of the world’s problems, I want to spend some time testing the following hypothesis:
Does a service-oriented architecture diminish the need for an O/R mapper?
SOA changes not only the way we build our back-end services, but also the way we build our front-ends. In a recent conversation with Rocky Lhotka, he made the point that in an SOA, the client and the service are really separate applications – separated by a trust boundary. He also pointed out that invoking a service is a lot like invoking a stored procedure: 1) construct a request by filling in some parameters, 2) invoke a named operation, and 3) handle the response.
Clemens has posted recently about something he calls data services. In short, he makes the case for accessing your data through a service.
Continuing these thoughts, I’m now asking, “Can a service be akin to a smarter stored procedure?” If you look at it this way, you can write your ‘stored procedures’ in C# without Yukon
In an SOA, the client has its own layers (presentation, business, data) as does the service. But the client’s data layer does not necessarily connect to a database, It might just connect to a service. This gets to my reasons for asking whether we need O/R mappers:
· The client’s business layer no longer needs to map to a relational database. Instead, it needs to map to service requests and responses.
· If the service itself is a ‘smarter stored procedure’, does it need a rich domain model? If not, it doesn’t need to map this domain model to a relational model.
I’m writing more questions than answers in this post, but here’s one more:
· If we really needed O/R mappers, wouldn’t we already have them? Yes, I know a number of vendors already sell O/R mappers, but if they were so vital, wouldn’t they be built into the fabric of every platform by now? I mean, saving objects into a relational database is something we’ve been doing for a long time. If O/R mappers were really the answer, wouldn’t this be a solved problem by now?