views:

30

answers:

3

How we can define the term "deploy a package"?

Is correct to say that to deploy a package means to make a procedure in which we create, put into a file system location and make them visible to the compiler an VM with options like -classpath CLASSPATH etc????

+1  A: 

I would separate "build" from "deploy". Building would take source code and construct a deployable artefact. In this case we have some .java files, we compile them to .class files and (usually) put them in a JAR. The JAR is the thing that we deploy. In JEE we might go a step further and put several JARs (and WARs ...) into an EAR and deploy that.

So deploying is making the deployable artefact executable in a runtime environment, in this case making the JAR visible to a chosen JVM. Quite possbly you might have many runtime environments, many customers, many machines. You build once, deploy many times.

In practice we often find that there's a little bit more to doing the deployment than just getting the JAR onto a Classpath. You often find you need to:

  1. Remove previous versions of the JAR, possibly keeping then ready for to be reinstated if something bad happens.
  2. Make other resources available, eg. databases
  3. Do some environment specific configuration
  4. Validate the deployment by running some kind of tests
  5. Restart dependent components
  6. Keep an audit trail ofthe deployment

In non-trivial cases it's often very useful to automate steps such as these using scripts.

djna
+2  A: 

How we can define the term "deploy a package"?

It depends on that kind of package you are talking about and what kind of deployment you are talking about.

For example, you probably wouldn't talk about deploying a Java package, because a Java package is not normally a sensible "unit of deployment". (Normally you would deploy a Java application or webapp, or possibly a Java library. And in the context of Maven, you would deploy an "artifact".)

If you are not talking about a Java package, what kind of package are you talking about?

Is correct to say that to deploy a package means to make a procedure in which we create, put into a file system location and make them visible to the compiler an VM with options like -classpath CLASSPATH etc????

That doesn't sound like a conventional definition of deployment to me. For a start, there is no standard file system location to deploy (for example) JAR files to.

Stephen C
ok but generally can we assert that deploy means like is said in Wikipedia definition:"Software deployment is all of the activities that make a software system available for use"and so a package deployment means make them available for compiler/JVM or for others in a JAR archive?
xdevel2000
A JAR file might be a self contained unit of deployment, the manifest might indicate the main to run. A JAR file might contain a reused component to be deployed so that applications can use it. There doesn't need to be a standard place for the JAR to go, just an agreed place in the particular deployment target.
djna
@djna - that is true, but then we are deploying a (particular kind of) JAR file, not a Java package.
Stephen C
@xdevel2000 - the problem is that 1) package != JAR, and 2) there is no standard place to make [JAR files] available that compilers / JVMs are going to look at / in, and no versioning mechanism to make the process managable. (Hint: how do we avoid the equivalent of DLL hell?) So this definition of "package deployment" is moot.
Stephen C