Pros and cons of using packages in Oracle

前端 未结 4 1870
予麋鹿
予麋鹿 2021-01-29 01:16

I am fairly new to using packages. My team is deciding on whether or not to use packages in our applications. We have 4 applications that are using in-line sql currently. We are

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-29 01:53

    So you want to start a debate about the advantages versus the disadvantages of using a package? Ok, then I would leave the disadvantages part on you if you could share with us. I will just share with you tye advantages, not in my own words, since it would be a repetition of what Thomas Kyte already said here:

    • break the dependency chain (no cascading invalidations when you install a new package body -- if you have procedures that call procedures -- compiling one will invalidate your database)

    • support encapsulation -- I will be allowed to write MODULAR, easy to understand code -- rather then MONOLITHIC, non-understandable procedures

    • increase my namespace measurably. package names have to be unique in a schema, but I can have many procedures across packages with the same name without colliding

    • support overloading

    • support session variables when you need them

    • promote overall good coding techniques, stuff that lets you write code that is modular, understandable, logically grouped together....

    If you are a programmer - you would see the benefits of packages over a proliferation of standalone procedures in a heartbeat.

提交回复
热议问题