This discussion is archived
5 Replies Latest reply: Jan 28, 2013 6:23 AM by 937454 RSS

Development without packages

937454 Newbie
Currently Being Moderated
Hi,

We started developing an application from scratch.
Initially we dint have the big picture. So we developed individual procedures and functons as we progressed with our development.
Now 6 months into this project, we realize, we need to logically group these procedures into packages.
Is this natural with all development projects, or did we make a mistake in not initially creating packages.
I am asking this question, as we see a lot of rework in grouping the procedures into packages.
Please advice.

Thanks.
  • 1. Re: Development without packages
    Mark Williams-Oracle Employee ACE
    Currently Being Moderated
    Whilst an older thread now, this discussion of Procedure vs Package on AskTom is still relevant.

    Regards,

    Mark
  • 2. Re: Development without packages
    Frank Kulash Guru
    Currently Being Moderated
    Hi.
    934451 wrote:
    ... Initially we dint have the big picture. So we developed individual procedures and functons as we progressed with our development.
    Now 6 months into this project, we realize, we need to logically group these procedures into packages.
    Is this natural with all development projects, or did we make a mistake in not initially creating packages.
    It's a pretty common mistake, but it is a mistake.
    I am asking this question, as we see a lot of rework in grouping the procedures into packages.
    Sorry, I don't know of any easy way to fix the problem.

    Here's one way to spread out the transition, in case that helps:
    Say you have a procedure called proc_a, and you want to put this procedure into package_x. Copy proc_a into package_x, and when you have finished testing it, change the stand-alone procedure proc_a so that all it does is call package_x.proc_a. This way, you can start benefiting by having proc_a in the package before you have corrected all the calls to the old stand-alone proc_a. Of course, nothing is forcing you to change all those existing calls, and that's part of the reason why this is not a very satisfactory approach.
  • 3. Re: Development without packages
    Mark Malakanov (user11181920) Expert
    Currently Being Moderated
    Among all benefits that packages bring into development environment there is one drawback though.
    The whole package body will be rebuilt if you need to modify only one procedure. That may cause some inconveniences if multiple developers work on same package. So you have to organize work of developers the way they do not interrupt each other and do not override code of each other. For example only one developer should be a "master" for a one package. S/he will apply all changes to this package.
    In this case it is better to use some source control system to merge work of multiple developers when they all work on same package. And only "master" will get the final code and apply it to Oracle.
  • 4. Re: Development without packages
    rp0428 Guru
    Currently Being Moderated
    >
    We started developing an application from scratch.
    Initially we dint have the big picture. So we developed individual procedures and functons as we progressed with our development.
    Now 6 months into this project, we realize, we need to logically group these procedures into packages.
    Is this natural with all development projects, or did we make a mistake in not initially creating packages.
    >
    That is a natural phase of development. Applications are always going through changes and additions. You can't predict everything when you start a new project.

    A main design principle is to do things in a way that maintains as many future options as possible. That makes the inevitable 'refactoring' as painless as possible.

    The main way this is done is to focus on the 'interface' (the 'what') to the procedures/functions and separate that interface from the body (which represents the 'how'.
    >
    I am asking this question, as we see a lot of rework in grouping the procedures into packages.
    >
    You need to explain that a bit more.

    Why would there be any rework to take a procedure named 'myProc' and put it into a package named 'myPack'? You now just use myPack.myProc to refer to it.
  • 5. Re: Development without packages
    937454 Newbie
    Currently Being Moderated
    Thank you all for your inputs. It is a good learning experience.
    Why would there be any rework to take a procedure named 'myProc' and put it into a package named 'myPack'? You now just use myPack.myProc to refer to it. 
    I do see it is not soo much of a re-work, I would re-phrase it as more of tweaking of code, both at the front-end and back-end.
    But wanted to understand, if we could improve the way we develop our code.
    Thank you!!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points