Mit Java 8, Jigsaw und JSR 294 soll über die Java-Plattform ein vereinheitlichtes Modularisierungskonzept eingeführt und die seit 2005 apostrophierte "post-jar-File-Ära" eingeläutet werden.
Etablierte Konzepte und Vorgehensweisen zur Modularisierung wie OSGi und JEE werden in der Session den Ideen von Java 8 gegenübergestellt und der architektonische Aspekt in der technologischen Debatte hinterfragt.
David Bosschaert: http://osgithoughts.blogspot.com/2011/05/java-se-8-modularity-requirements.html\n\nSome argued that the module source definition should be in a .java file and because it's in a .java file there should be a compiled .class file in the resulting Jar file. However, I think that the structure of a module definition screams for a specific DSL that might be quite different from ordinary Java. Especially the extensibility requirement makes a DSL much more natural than a traditional .java source file. I think the module definition should be in  META-INF/module.jmod or something like that. Then it becomes natural to migrate that file as-is to the resulting jar. In a sense the existing MANIFEST.MF does cover most of the requirements. Sure, it has some issues (esp. the 76 chars-per-line limit) but it's clear, simple and extensible - and - it is readable by humans in the Jar file.\n
\n
\n
A:\nHaving a distinct compiled form would complicate or eliminate usage scenarios in which people or tools update module metadata independently of compilation tools. \nIt avoids the need to specify a compiled form, which gives implementors more freedom to choose efficient internal private forms, but only if they are unobservable (e.g., constructed in the process of caching). \n\nB:\nIt is more efficient to read in a structured binary than to parse source-form Java module declarations. When combined with new ways of packaging compiled files it may even open up opportunities for further efficiencies. \nIf it’s decided that the names of module declaration files should end with the string “.java”, then why should there be an exception to the convention that “.java” files always compile into “.class” files? Creating such an exception would violate the principle of least surprise, presenting one more stumbling block to developers trying to adopt the module system. \nA compiled form helps to ensure validity, since it’s more difficult to modify a file incorrectly when doing so requires the use of a tool. This will help to reduce failures in all phases, and especially at deployment time. \n
\n
== Require Bundle aus OSGi\n
\n
\n
\n
\n
\n
\n
\n
David Bosschaert: http://osgithoughts.blogspot.com/2011/05/java-se-8-modularity-requirements.html\nI don't see why this requirement is needed and I actually think it's bad because it doesn't encourage extending the module definitions. Again, the MANIFEST.MF is a good example where this was not done (standard headers are mixed with custom headers) and it has proven to be extremely useful.Let's come up with a module definition syntax that encourages extensions and where those extensions happily co-exist with the JavaSE definitions.\n\nGlyn Normington gnormington at vmware.com :\nHi Mark I'm pleased to see the explicit acknowledgement of some basic OSGi interoperation requirements in the requirements document ([1]). I agree with David Bosschaert ([2]), that it would make sense for OSGi to support the Java SE 8 module format and, for modules which can serve equally well as OSGi bundles, I'd like to avoid dual-maintenance of module metadata and OSGi manifest. I'd like to be able to "decorate" the standard metadata. However, the requirement "The syntax must place all extended metadata after all standard metadata, with a clear delineation between them." precludes inline decorations. The result would be duplication and clunkiness. I propose that this requirement be changed so that standard metadata could be decorated inline (the decorations would be ignored by the Java SE module system). What do you think? \n
David Loyd – Red Hat: http://in.relation.to/Bloggers/ModulesInJDK8AndProjectJigsawRequirementsReviewPart1#H-FundamentalsTargetConstraintsOnModules \nThe fundamentals paragraph items all indicate a strong sense that the Jigsaw project is on the right general track. However I found a couple sections noteworthy:\nResolution in all phases — Build-time, install-time, and run-time module resolution and linking must all be supported. UNIX has all three models and they are all still in use 40 years later.coupled with the following paragraph:\nFidelity across all phases — The set of modules seen by a library or application must be computed by the same algorithm at build time, install time, and run time.and this one:\nVersioning — The module system must support common version-string schemes [...]. It must be possible to specify a range of allowable versions when declaring a module dependence.\n\nThese seemingly reasonable statements hide a particularly tricky little goblin; namely, build reproducibility. At build-time, an artifact (to use the Maven term) is identified in part by its version. And that identity has a specific meaning. If I check out version 1.2.3 of jboss-cobwobble from source control and build it, I should get an artifact which is equivalent to one which anyone else who checks out and builds the same version of the same project gets.\nHowever, that means that such builds cannot use version ranges. By definition this creates a way for two parties building the same project to get different output, thus blurring the meaning of what a version is. In the first paragraph, Mark emphasises the similarities to the shared library model and recommends that similar practices be followed to that paradigm, however there is a key difference in that when one builds against a shared library the linkage is much less invasive. A change to a compiled library used by a project does not generally affect the compilation results of that project, whereas in Java this is much easier to do, since class files are a much richer format than a shared object symbol table.\nTherefore it is very important to allow (better yet, require) builds to use specific dependency versions when building, and allow version ranges only at install and run time, where version ranges are a much better fit.\n\nBsp: you can add a more specific method, which would change how the same code is compiled the next time it is compiled; you can change the return type of a method to make it covariant, causing linking to occur to the new bridge method instead of the original; I'm sure there are quite a few generics changes you can do which cause compilation against a bridge method. Etc, etc.\n
David Loyd – Red Hat: http://in.relation.to/Bloggers/ModulesInJDK8AndProjectJigsawRequirementsReviewPart1#H-FundamentalsTargetConstraintsOnModules \nThe fundamentals paragraph items all indicate a strong sense that the Jigsaw project is on the right general track. However I found a couple sections noteworthy:\nResolution in all phases — Build-time, install-time, and run-time module resolution and linking must all be supported. UNIX has all three models and they are all still in use 40 years later.coupled with the following paragraph:\nFidelity across all phases — The set of modules seen by a library or application must be computed by the same algorithm at build time, install time, and run time.and this one:\nVersioning — The module system must support common version-string schemes [...]. It must be possible to specify a range of allowable versions when declaring a module dependence.\n\nThese seemingly reasonable statements hide a particularly tricky little goblin; namely, build reproducibility. At build-time, an artifact (to use the Maven term) is identified in part by its version. And that identity has a specific meaning. If I check out version 1.2.3 of jboss-cobwobble from source control and build it, I should get an artifact which is equivalent to one which anyone else who checks out and builds the same version of the same project gets.\nHowever, that means that such builds cannot use version ranges. By definition this creates a way for two parties building the same project to get different output, thus blurring the meaning of what a version is. In the first paragraph, Mark emphasises the similarities to the shared library model and recommends that similar practices be followed to that paradigm, however there is a key difference in that when one builds against a shared library the linkage is much less invasive. A change to a compiled library used by a project does not generally affect the compilation results of that project, whereas in Java this is much easier to do, since class files are a much richer format than a shared object symbol table.\nTherefore it is very important to allow (better yet, require) builds to use specific dependency versions when building, and allow version ranges only at install and run time, where version ranges are a much better fit.\n\nBsp: you can add a more specific method, which would change how the same code is compiled the next time it is compiled; you can change the return type of a method to make it covariant, causing linking to occur to the new bridge method instead of the original; I'm sure there are quite a few generics changes you can do which cause compilation against a bridge method. Etc, etc.\n
David Loyd – Red Hat: http://in.relation.to/Bloggers/ModulesInJDK8AndProjectJigsawRequirementsReviewPart1#H-FundamentalsTargetConstraintsOnModules \nThe fundamentals paragraph items all indicate a strong sense that the Jigsaw project is on the right general track. However I found a couple sections noteworthy:\nResolution in all phases — Build-time, install-time, and run-time module resolution and linking must all be supported. UNIX has all three models and they are all still in use 40 years later.coupled with the following paragraph:\nFidelity across all phases — The set of modules seen by a library or application must be computed by the same algorithm at build time, install time, and run time.and this one:\nVersioning — The module system must support common version-string schemes [...]. It must be possible to specify a range of allowable versions when declaring a module dependence.\n\nThese seemingly reasonable statements hide a particularly tricky little goblin; namely, build reproducibility. At build-time, an artifact (to use the Maven term) is identified in part by its version. And that identity has a specific meaning. If I check out version 1.2.3 of jboss-cobwobble from source control and build it, I should get an artifact which is equivalent to one which anyone else who checks out and builds the same version of the same project gets.\nHowever, that means that such builds cannot use version ranges. By definition this creates a way for two parties building the same project to get different output, thus blurring the meaning of what a version is. In the first paragraph, Mark emphasises the similarities to the shared library model and recommends that similar practices be followed to that paradigm, however there is a key difference in that when one builds against a shared library the linkage is much less invasive. A change to a compiled library used by a project does not generally affect the compilation results of that project, whereas in Java this is much easier to do, since class files are a much richer format than a shared object symbol table.\nTherefore it is very important to allow (better yet, require) builds to use specific dependency versions when building, and allow version ranges only at install and run time, where version ranges are a much better fit.\n\nBsp: you can add a more specific method, which would change how the same code is compiled the next time it is compiled; you can change the return type of a method to make it covariant, causing linking to occur to the new bridge method instead of the original; I'm sure there are quite a few generics changes you can do which cause compilation against a bridge method. Etc, etc.\n
Scott Stark \n\nhttp://community.jboss.org/wiki/ModulesInJava8\n\ndon't understand why multi-version support only applies when type collisions can be detected. \n\nWhy isn't this just required when dependencies demand it?\n
\n
\n
\n
Scott Stark http://community.jboss.org/wiki/ModulesInJava8\n\nmaven support is more of a usecase for pluggable loading\n\n
Scott Stark http://community.jboss.org/wiki/ModulesInJava8\n\n\nOSGi support also seems like a usecase for pluggable module resolution.\n\n
Scott Stark http://community.jboss.org/wiki/ModulesInJava8\n\nmanipuable module metadata; doesn't this imply not using java language syntax for metadata?\n
David Loyd – Red Hat: http://in.relation.to/Bloggers/ModulesInJDK8AndProjectJigsawRequirementsReviewPart1#H-FundamentalsTargetConstraintsOnModules \n\nI am very much against this notion. One module, one class loader, period, end of story. If you are splitting a single class loader among many modules, you haven't created modules, you've created one module with a class path of several JARs, of which some stuff may be missing and others not, and a hell of a lot of useless complexity, all for the privilege of saying sure, we modularized this. There is no isolation of any sort between them beyond your standard access controls provided by the Java language. Without a strong definition of a module as an encapsulating vehicle for a class loader, the whole idea is weakened - visibility is only sensibly enforced in terms of whole class loaders (yes, while it is probably possible to use a different unit of division like class, it will definitely have a negative performance impact).\nRather than thus weakening the definition of a module, I recommend that modules be allowed to be packaged in portions, which may be separately shipped and installed - perhaps a module/submodule concept could be introduced, where the contract of a submodule is clearly defined as sharing the parent module's class loader. In other words, the label should be clearly marked, so to speak. There is no reasonable expectation that a package may be split between modules, and doing so is definitely a violation of the Principle of Least WTF.\n\nScott Stark http://community.jboss.org/wiki/ModulesInJava8\nthis seems to be in conflict with the notion of target constraints. If I have a CDC module exporting java.util.*, why would I have another module that also applies to the CDC target platform also exporting java.util.*? (anders formuliert : Könnte man das CDC-Beispiel nicht mit Target Constraints lösen ???)\n\nPackage Subsets führt zu Split packages – ist in OSGi lösbar durch Require-Bundle führt zu Illegal Access Errors (Folien siehe JBoss)\nSee the OSGi core specification, section 3.12.3, for some more good reasons not to do it.\n\nA module system that encourages split packages will require tools that can manage modularity at the level of types rather than packages. How many types are there in an average Java package… twenty, thirty? That is how many times more difficult it will be to design and assemble coherent modules with Jigsaw.\n
== Require Bundle aus OSGi\n
\n
David Loyd – Red Hat: http://in.relation.to/Bloggers/ModulesInJDK8AndProjectJigsawRequirementsReviewPart1#H-FundamentalsTargetConstraintsOnModules \n\nI am very much against this notion. One module, one class loader, period, end of story. If you are splitting a single class loader among many modules, you haven't created modules, you've created one module with a class path of several JARs, of which some stuff may be missing and others not, and a hell of a lot of useless complexity, all for the privilege of saying sure, we modularized this. There is no isolation of any sort between them beyond your standard access controls provided by the Java language. Without a strong definition of a module as an encapsulating vehicle for a class loader, the whole idea is weakened - visibility is only sensibly enforced in terms of whole class loaders (yes, while it is probably possible to use a different unit of division like class, it will definitely have a negative performance impact).\nRather than thus weakening the definition of a module, I recommend that modules be allowed to be packaged in portions, which may be separately shipped and installed - perhaps a module/submodule concept could be introduced, where the contract of a submodule is clearly defined as sharing the parent module's class loader. In other words, the label should be clearly marked, so to speak. There is no reasonable expectation that a package may be split between modules, and doing so is definitely a violation of the Principle of Least WTF.\n\nScott Stark http://community.jboss.org/wiki/ModulesInJava8\nthis seems to be in conflict with the notion of target constraints. If I have a CDC module exporting java.util.*, why would I have another module that also applies to the CDC target platform also exporting java.util.*? (anders formuliert : Könnte man das CDC-Beispiel nicht mit Target Constraints lösen ???)\n\nPackage Subsets führt zu Split packages – ist in OSGi lösbar durch Require-Bundle führt zu Illegal Access Errors (Folien siehe JBoss)\nSee the OSGi core specification, section 3.12.3, for some more good reasons not to do it.\n\nA module system that encourages split packages will require tools that can manage modularity at the level of types rather than packages. How many types are there in an average Java package… twenty, thirty? That is how many times more difficult it will be to design and assemble coherent modules with Jigsaw.\n
\n
David Loyd – Red Hat: http://in.relation.to/Bloggers/ModulesInJDK8AndProjectJigsawRequirementsReviewPart1#H-FundamentalsTargetConstraintsOnModules \n\nIf the purpose of this is security, which I can very much get behind, then I think the only sensible approach is to constrain module loading to signed modules. Otherwise, if the goal is simply to create a mechanism by which administrators can annoy each other, then I guess this fits the bill; the restriction can be bypassed by changing the metadata, which means that it provides neither security nor convenience.\n\nScott Stark http://community.jboss.org/wiki/ModulesInJava8\n\nmodule/target constraints seems to be a secondary requirement\n\n\n Target Plattform?\n Sicherheit über änderbare Metadaten ?\n Lizenzmetadaten ?\n
David Loyd – Red Hat: http://in.relation.to/Bloggers/ModulesInJDK8AndProjectJigsawRequirementsReviewPart1#H-FundamentalsTargetConstraintsOnModules \n\nI am very much against this notion. One module, one class loader, period, end of story. If you are splitting a single class loader among many modules, you haven't created modules, you've created one module with a class path of several JARs, of which some stuff may be missing and others not, and a hell of a lot of useless complexity, all for the privilege of saying sure, we modularized this. There is no isolation of any sort between them beyond your standard access controls provided by the Java language. Without a strong definition of a module as an encapsulating vehicle for a class loader, the whole idea is weakened - visibility is only sensibly enforced in terms of whole class loaders (yes, while it is probably possible to use a different unit of division like class, it will definitely have a negative performance impact).\nRather than thus weakening the definition of a module, I recommend that modules be allowed to be packaged in portions, which may be separately shipped and installed - perhaps a module/submodule concept could be introduced, where the contract of a submodule is clearly defined as sharing the parent module's class loader. In other words, the label should be clearly marked, so to speak. There is no reasonable expectation that a package may be split between modules, and doing so is definitely a violation of the Principle of Least WTF.\n\nScott Stark http://community.jboss.org/wiki/ModulesInJava8\nthis seems to be in conflict with the notion of target constraints. If I have a CDC module exporting java.util.*, why would I have another module that also applies to the CDC target platform also exporting java.util.*? (anders formuliert : Könnte man das CDC-Beispiel nicht mit Target Constraints lösen ???)\n\nPackage Subsets führt zu Split packages – ist in OSGi lösbar durch Require-Bundle führt zu Illegal Access Errors (Folien siehe JBoss)\nSee the OSGi core specification, section 3.12.3, for some more good reasons not to do it.\n\nA module system that encourages split packages will require tools that can manage modularity at the level of types rather than packages. How many types are there in an average Java package… twenty, thirty? That is how many times more difficult it will be to design and assemble coherent modules with Jigsaw.\n
Enforcement, Hiding, Cost of Dependencies, Package Sharing, Versioningm Unexpected Consequences of API based Programming, ...\n
\n
@ 30m - 40m\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
package modules\n do class sharing\n do instance sharing\n no versions\n no visibility constraints\n no module lifecycle\n
package modules\n do class sharing\n do instance sharing\n no versions\n no visibility constraints\n no module lifecycle\n
package modules\n do class sharing\n do instance sharing\n no versions\n no visibility constraints\n no module lifecycle\n
Bei OSGi ist es andersrum. Oder war es zum Teil. Mit 4.2 bekommen wir doch Spring dm als fine grained RI, oder?\n\n compile time dependencies handled by compiler, IDE, classpath\n runtime dependency declared/ managed in context\n
Bei OSGi ist es andersrum. Oder war es zum Teil. Mit 4.2 bekommen wir doch Spring dm als fine grained RI, oder?\n because we have versions\n solve version problems at compile time\n no fancy-OSGi features at runtime\n
\n
\n - nicht auflösbare modul-versions-konflikte\n -> repackaging\n\n- Sichtbarkeit\n\n-> naming conventions ITextField\n-> naming conventions (nicht impl package von fremden modulen verwenden)\n\n- nur sehr einfache (proprietäre) Plugin-Architekturen umsetzbar\n-> Fairplay\n\n- Laufzeit rauf-runter-fahren von Modulen\n\n\n- Modularisierung kein standard -> tools, libs können nicht darauf aufbauen\n
Bei OSGi ist es andersrum. Oder war es zum Teil. Mit 4.2 bekommen wir doch Spring dm als fine grained RI, oder?\n
Bei OSGi ist es andersrum. Oder war es zum Teil. Mit 4.2 bekommen wir doch Spring dm als fine grained RI, oder?\n
\n
\n - nicht auflösbare modul-versions-konflikte\n -> repackaging\n\n- Sichtbarkeit\n\n-> naming conventions ITextField\n-> naming conventions (nicht impl package von fremden modulen verwenden)\n\n- nur sehr einfache (proprietäre) Plugin-Architekturen umsetzbar\n-> Fairplay\n\n- Laufzeit rauf-runter-fahren von Modulen\n\n\n- Modularisierung kein standard -> tools, libs können nicht darauf aufbauen\n