5 Replies Latest reply on Dec 29, 2014 11:42 AM by americanhorizon

    What is a "dependency" in modules?

    americanhorizon

      I'm following the official documentation. I've undertood that modules are group of classes and i can add a dependency between them... But what means exactly dependency? It's the same thing when i import libraries into a class?

        • 1. Re: What is a "dependency" in modules?
          jaikiran

          It just means that one module depends (requires) the resources defined/contained in some other module.

          • 2. Re: What is a "dependency" in modules?
            valsaraj007

            You can add a module dependency in dependencies section of the module.xml file of a module.

             

            Eg:

            Added the following dependency to org.picketbox module in another module:

            <dependencies>

                 <module name="org.picketbox"/>

            </dependencies>

            • 3. Re: What is a "dependency" in modules?
              americanhorizon

              jaikiran pai ha scritto:

               

              It just means that one module depends (requires) the resources defined/contained in some other module.

              and what is the difference with importing libraries directly into the class?

              • 4. Re: What is a "dependency" in modules?
                jaikiran

                Luca Coraggio wrote:

                 

                jaikiran pai ha scritto:

                 

                It just means that one module depends (requires) the resources defined/contained in some other module.

                and what is the difference with importing libraries directly into the class?

                Are you talking of import statements in Java classes? Those are compile time dependencies that you are setting up. How and from where those dependencies get picked up at runtime is decided by your runtime environment. In case of AS7/WildFly that runtime environment for classloading is managed by JBoss Modules project and that's where the module.xml definitions for modules come into picture and that's where you specify the (runtime) dependencies.

                • 5. Re: What is a "dependency" in modules?
                  americanhorizon

                  Suppose that i've a class mailManager.java

                  and another class called subriscption.java. Inside this i import mailManager.java, when i deploy both on AS7 i should write the directory path in which they are positioned ? This is the dependecy that we are talking about?