Project

General

Profile

Revisiting includes for 2 3 - DONE » History » Version 2

Henning Blohm, 31.08.2013 12:35

1 1 Henning Blohm
h1. Revisiting includes for 2.3
2
3
Related issues: #1492, #1481, #1491, #869
4
5
Discussion on how includes work today and how they should work to make sense for development with include based systems on a broader scope than what is used today.
6
7
h2. How Includes work Today
8
9
There are to different cases: Include of a Java component and include of a files component.
10
11
h3. Include of a files component
12
13
In that case, the files component is expected to have a @src@, @bin/lib@, @bin/classes@ structure (like an API-only Java component). All resources are simply copied to the including Java component. There is no expection of compilability outside of the including component and there is no transitivity or anything else involved during resolution of the included resources.
14
15
This case is clear and simple and actually up to the original intention: Include of libraries with dangling imports like Spring's context support.
16
17
h3. Include of a Java component
18
19
In that case, the included Java component is loaded (that is, in case it has sources, those will be compiled, and in case it has includes, those will be resolved). After it is loaded, it's API binaries (@bin/lib@, @bin.api/lib@, @bin/classes@, @bin.api/classes@) will be copied to the including component.
20
21
Hence it is transitive. 
22
23 2 Henning Blohm
h2. Developing with Includes
24
25
h3. Use of adapter libraries via includes
26
27
The most prominent cases for this is Spring context support and Spring aspectJ support. These are the two prototypical cases of using a library that was build to either adapt one to many use cases (context support) or to adapt a class loading scope (spring aspectj).
28
29
In the first case, that is for Spring context support, a library that intrinsically has many unsatisfied imports will be used to provide utility types for some of many potential use cases. Instead of having 20 different adapter libraries, Spring chose to bundle all adapter types into one. Using the library via a reference would mean to either adapt its own references based on use cases (harming re-use consistency) or to add all adaptation targets to the re-use repo (equally bad).
30
31
In the second case, that is the Spring AspectJ case, the library associates a class loading scope with a Spring application context via its presence in the scope. That is, only inclusion implements its use-case in a modular environment.
32
33
h3. Plugins based on Includes
34
35
As many drawbacks as this has in a modular environment, many plugin environments assume runtime inclusion of all extenders into one scope. 
36
37
Assume the most basic case, that some codebase A can be extended by Plugins P1, ..., Pn and that assumes that P1, ..., Pn are found in the same class loading scope at runtime. At compile time, plugins require A.
38
39
We are looking for a setup that allows to conveniently develop plugins but at runtime executes A and all Pi in the same scope.
40
41
*Approach:*