Home » SQL & PL/SQL » SQL & PL/SQL » Information Hiding in pl/sql
Information Hiding in pl/sql [message #199073] Fri, 20 October 2006 00:30 Go to next message
selvakumar_82
Messages: 138
Registered: October 2005
Location: chennai
Senior Member
Hi Friends,

I read that, one of the main features of the package is information hide (i.e we cant see the code ,which is available in package body.... right)

Anyone can explain the concept with some example...

thanx and regards
Selva
Re: Information Hiding in pl/sql [message #199075 is a reply to message #199073] Fri, 20 October 2006 00:50 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
You 'hide' the internals from the outside world. The idea is that the outside world only sees the package specification.

Suppose you have a package EMAIL. In it you have a public procedure SEND_MAIL. The outside world sees this procedure, because you declare it in your package specification.
In your package body, you have (besides the code for SEND_MAIL) also a procedure that checks whether the provided email-address is a valid address. This procedure CHECK_ADDRESS is called from the procedure SEND_MAIL and is not in the package specification.
This procedure is said to be hidden from the outside world; there is no way you can call it from anywhere else then from within the package.
Re: Information Hiding in pl/sql [message #199526 is a reply to message #199075] Wed, 25 October 2006 00:36 Go to previous messageGo to next message
selvakumar_82
Messages: 138
Registered: October 2005
Location: chennai
Senior Member
ok, thanx

So Check_address procedure is (data encapsulation) information hiding

Re: Information Hiding in pl/sql [message #199551 is a reply to message #199526] Wed, 25 October 2006 01:42 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
OP
We can't see the code ...
Although your question addresses packages, there is another way to conceal code: use Oracle's WRAP utility. Check this Database Journal article.
Re: Information Hiding in pl/sql [message #199677 is a reply to message #199551] Wed, 25 October 2006 14:36 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
I doubt if wrapping your code is generally called 'information hiding' though...
Wink
Previous Topic: Import records from Access or Excel
Next Topic: How to update a table with millions of rows
Goto Forum:
  


Current Time: Fri Dec 09 06:18:55 CST 2016

Total time taken to generate the page: 0.17524 seconds