| // |
| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, |
| // software distributed under the License is distributed on an |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| // KIND, either express or implied. See the License for the |
| // specific language governing permissions and limitations |
| // under the License. |
| // |
| |
| = DevFaqWhatIsAModule |
| :jbake-type: wiki |
| :jbake-tags: wiki, devfaq, needsreview |
| :jbake-status: published |
| :keywords: Apache NetBeans wiki DevFaqWhatIsAModule |
| :description: Apache NetBeans wiki DevFaqWhatIsAModule |
| :toc: left |
| :toc-title: |
| :syntax: true |
| |
| === What is a module? |
| |
| NetBeans is a _modular_ application. That means it is composed of pieces, which are discovered at runtime. Some of those pieces may even be downloaded and installed or uninstalled at runtime. |
| |
| A module is a library. It is a Java JAR (Java ARchive) file which contains some classes. |
| |
| NetBeans is a Java application. It has a very small core runtime which knows how to find the modules that make up the application (the launcher passes a list of directories - these are commonly called link:DevFaqWhatIsACluster.asciidoc[clusters] - which contain module JAR files and some XML metadata about them). |
| |
| All real functionality of the NetBeans IDE or any NetBeans-based application is implemented as modules. |
| |
| A module JAR contains some additional entries in its META-INF/MANIFEST.MF file, which tell NetBeans about the module - its name, its version, etc. |
| |
| One distinction about NetBeans modules, as opposed to just working with JAR files on your classpath is that the NetBeans runtime link:DevFaqModuleDependencies.asciidoc[enforces dependency management] between modules - to call code in another module from yours, your module must _declare a dependency_ on the other module. |
| |
| Another significant distinction is that a module can specify which (if any) packages it makes visible to modules that depend on it - so it is possible to have Java packages in a module's JAR file which are visible only to other classes within that JAR file. That, in effect, extends Java's class visibility-scoping rules (public, protected, private, package-private) to include _public only within this JAR file_. |
| |
| === Apache Migration Information |
| |
| The content in this page was kindly donated by Oracle Corp. to the |
| Apache Software Foundation. |
| |
| This page was exported from link:http://wiki.netbeans.org/DevFaqWhatIsAModule[http://wiki.netbeans.org/DevFaqWhatIsAModule] , |
| that was last modified by NetBeans user Tboudreau |
| on 2010-02-12T20:09:23Z. |
| |
| |
| *NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed. |