vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I'm a newbie to Oracle. I walked onto a contract job where they are just switching to Oracle and I'd like to help them get started off in the right direction. Do packages really provide something valuable from a design perspective? I've seen some example code but the descriptions have been somewhat vague as any actual benefits from using packages. Thanks, Targus |
| |||
| ds_lewis@hotmail.com wrote: > I'm a newbie to Oracle. I walked onto a contract job where they are > just switching to Oracle and I'd like to help them get started off in > the right direction. > > Do packages really provide something valuable from a design > perspective? I've seen some example code but the descriptions have > been somewhat vague as any actual benefits from using packages. > > Thanks, > > Targus >From more than a decade of experience as a DBA supporting application developers the answer is yes, the proper use of Oracle packages greatly aids application development. Read the PL/SQL manual. Tom Kyte has two pretty good books on how to make efficient use of Oracle features. As a developer new to Oracle read the Applications Developer Guide - Fundaments If a DBA then read the Concepts manual followed by the DBA Administrators Guide, Backup and Recovery Concepts, PL/SQL manual, the Utilities manual, and the first few chapters of the SQL manual. Then you are ready to start work. HTH -- Mark D Powell -- |
| |||
| ds_lewis@hotmail.com wrote: > > Do packages really provide something valuable from a design > perspective? I've seen some example code but the descriptions have > been somewhat vague as any actual benefits from using packages. > I suppose it depends on your point of view, which you could probably determine by thinking about the following situation. If you have a PC, do you use folders or do you just keep everything on the C drive? If it is the latter you will probably not find packages very useful. They also are somewhat more efficient at handling loading code into memory, but not so that you would typically notice from a performance pesrpective. |
| |||
| ds_lewis@hotmail.com wrote: > I'm a newbie to Oracle. I walked onto a contract job where they are > just switching to Oracle and I'd like to help them get started off in > the right direction. > > Do packages really provide something valuable from a design > perspective? I've seen some example code but the descriptions have > been somewhat vague as any actual benefits from using packages. > > Thanks, > > Targus The biggest benefits to me are the following: 1) Data/method hiding. It allows you to hide data (variables) and methods (procedures/functions) that are only needed by something else in the same package. You don't have to expose them to the world if it doesn't make sense to do so. 2) You can recompile the body of the package, and not invalidate objects that depend on the package specifcation. The only time you invalidate dependent objects (requires recompilation) is when you recompile the specification. HTH, Steve |
| |||
| Steve Howard wrote: > ds_lewis@hotmail.com wrote: >> I'm a newbie to Oracle. I walked onto a contract job where they are >> just switching to Oracle and I'd like to help them get started off in >> the right direction. >> >> Do packages really provide something valuable from a design >> perspective? I've seen some example code but the descriptions have >> been somewhat vague as any actual benefits from using packages. >> >> Thanks, >> >> Targus > > The biggest benefits to me are the following: > > 1) Data/method hiding. It allows you to hide data (variables) and > methods (procedures/functions) that are only needed by something else > in the same package. You don't have to expose them to the world if it > doesn't make sense to do so. > > 2) You can recompile the body of the package, and not invalidate > objects that depend on the package specifcation. The only time you > invalidate dependent objects (requires recompilation) is when you > recompile the specification. > > HTH, > > Steve When I think of packages there are a lot of things I think of but the two items you list are the minor ones. When I think of the real value of packages it is: 1. All related code in a single object 2. All related code loaded into memory simultaneously 3. Session global variables and types 4. Single object compilation 5. Variables persist for term of session 6. Initialization section 7. Overloading 8. Fewer objects to manage and grant/revoke privileges -- Daniel A. Morgan University of Washington damorgan@x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.org |
| |||
| DA Morgan wrote: > Steve Howard wrote: > > ds_lewis@hotmail.com wrote: > >> I'm a newbie to Oracle. I walked onto a contract job where they are > >> just switching to Oracle and I'd like to help them get started off in > >> the right direction. > >> > >> Do packages really provide something valuable from a design > >> perspective? I've seen some example code but the descriptions have > >> been somewhat vague as any actual benefits from using packages. > >> > >> Thanks, > >> > >> Targus > > > > The biggest benefits to me are the following: > > > > 1) Data/method hiding. It allows you to hide data (variables) and > > methods (procedures/functions) that are only needed by something else > > in the same package. You don't have to expose them to the world if it > > doesn't make sense to do so. > > > > 2) You can recompile the body of the package, and not invalidate > > objects that depend on the package specifcation. The only time you > > invalidate dependent objects (requires recompilation) is when you > > recompile the specification. > > > > HTH, > > > > Steve > > When I think of packages there are a lot of things I think of but the > two items you list are the minor ones. When I think of the real value > of packages it is: > > 1. All related code in a single object > 2. All related code loaded into memory simultaneously > 3. Session global variables and types > 4. Single object compilation > 5. Variables persist for term of session > 6. Initialization section > 7. Overloading > 8. Fewer objects to manage and grant/revoke privileges > -- > Daniel A. Morgan > University of Washington > damorgan@x.washington.edu > (replace x with u to respond) > Puget Sound Oracle Users Group > www.psoug.org Very well put Daniel. When I think of package, in my minds eye view I also think of a "namespace", eg schemaname.packagename.methodname. As you point out, methodname in a package (namespace) can be overloaded, something you just can't do with a proc/function outside a package, and the same methodname can exist in multiple packages, also something you just can't do by creating a proc/function outside a package. So very much like a class hierarchy/namespace metaphor to me. Barry |
| ||||
| ds_lewis@hotmail.com wrote: > > I'm a newbie to Oracle. I walked onto a contract job where they are > just switching to Oracle and I'd like to help them get started off in > the right direction. > > Do packages really provide something valuable from a design > perspective? I've seen some example code but the descriptions have > been somewhat vague as any actual benefits from using packages. > > Thanks, > > Targus Without being too overly a marketer...my book has a coverage of this and many other things related to PLSQL usage. hth connor -- Connor McDonald Co-author: "Mastering Oracle PL/SQL - Practical Solutions" Co-author: "Oracle Insight - Tales of the OakTable" web: http://www.oracledba.co.uk web: http://www.oaktable.net email: connor_mcdonald@yahoo.com "Semper in excremento, sole profundum qui variat." ------------------------------------------------------------ |