Skip to Main Content
  • Questions
  • Object View To Manipulate Data In Tables

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Trong.

Asked: February 08, 2019 - 1:58 pm UTC

Last updated: March 06, 2019 - 4:50 pm UTC

Version: 12.0

Viewed 1000+ times

You Asked

Hi,
I have been using Object View, User Defined Types in Oracle for sometime.
I tried to follow the approach here.
https://docs.oracle.com/cd/A64702_01/doc/server.805/a58241/ch_ov.htm


I am wondering if we put all the data manipulation to triggers (Object Views) how will that scale and maintain?

Is it an obsolete idea at this point?

and Chris said...

You're using an example from the 8i docs?!

If you want to dig into these, I'd recommend reading something more up-to-date:

https://docs.oracle.com/en/database/oracle/oracle-database/18/adobj/applying-an-object-model-to-relational-data.html#GUID-5D527C3A-6B6F-4C8E-A3F5-93340737F8B0

Anyway, the reason to use object views is to map your relational tables to an object-oriented application's classes. So this is your ORM layer. Instead of some other tool.

This gives you full control over the SQL. Which can lead to better performance. If you build it right ;)

But if you use these for writes, you'll need to create instead-of triggers as you say. Which if you build it right, can scale well. But is super easy to make a mess of.

OO-based applications are widespread. So the concept of ORM mapping is here to stay. And object views are one way to do that.

I've not seen them in the wild though. And I'd rather build a series of PL/SQL APIs that send and receive objects instead of object views. Something I have seen done successfully.

That said, JSON is increasingly becoming the standard format for data exchange. So building APIs that transfer these documents is a better bet.

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Dapper as my choice at this point.

Trong Phan, February 12, 2019 - 6:19 pm UTC

Thanks for answering. I am currently trying to use Dapper lib to map the select statement to POCOs .Net.

Do you have any thought on that?
Thanks again,
Chris Saxon
February 13, 2019 - 11:18 am UTC

I'm not familiar with Dapper. So no, I don't have any particular thoughts on using it.

Hey, where is to Submit Question

Trong Phan, March 06, 2019 - 2:32 pm UTC

Hi,
By any chance, you can give me link to download Oracle Client 10.2.x for .net please?

Could not find any where.

And somehow I could not see the Submit Question anymore?

Thanks,
Chris Saxon
March 06, 2019 - 4:50 pm UTC

Any particular reason you need the 10.2 client? And what's that got to do with this question?

Anyway, you can get versions of the instant client all the way back to 10.2 by going to:

https://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html

We close the site for new questions when the backlog of unanswered questions is too large.

Connor explains more at:


More to Explore

SQL

The Oracle documentation contains a complete SQL reference.