Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

Commit

Permalink
Add more information on modularization
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-beetz committed Aug 9, 2018
1 parent cf11784 commit eb9e1fd
Show file tree
Hide file tree
Showing 5 changed files with 216 additions and 14 deletions.
1 change: 1 addition & 0 deletions abbreviations/abbreviations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ \section*{Abbreviations}
\acro{ANT}{Another Neat Tool}
\acro{API}{Application Programming Interface}
\acro{BOM}{Bill Of Materials}
\acro{CI}{Continuous Integration}
\acro{CLI}{Command Line Interface}
\acro{DAG}{Directed Acyclic Graph}
\acro{DI}{Dependency Injection}
Expand Down
Binary file added images/jr_mods.pdf
Binary file not shown.
146 changes: 146 additions & 0 deletions images/jr_mods.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions images/jr_mods.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
\documentclass[crop,tikz]{standalone}
\usetikzlibrary{positioning,arrows,fit,calc}
\pgfdeclarelayer{bg}
\pgfsetlayers{bg,main}
\tikzset{
>=stealth'
}
\begin{document}
\begin{tikzpicture}[
node distance = 2mm,
every node/.style = {
font = \sffamily
},
module/.style = {
draw,
text width = 3cm,
align = center,
}
]

\node[module] (jabref) {org.jabref};
\node[module, below = 35mm of jabref] (model) {org.jabref.model};
\node[module, below left = 15mm and 5mm of jabref] (logic) {org.jabref.logic};
\node[module, below left = 15mm and -20mm of logic, dashed] (test) {jabref-testutils};

\draw[->] (jabref) -- (logic);
\draw[->] (jabref) -- (model);
\draw[->] (logic) -- (model);
\draw[->, dashed] (logic) -- (test);

\end{tikzpicture}

\end{document}
50 changes: 36 additions & 14 deletions thesis.md
Original file line number Diff line number Diff line change
Expand Up @@ -1247,13 +1247,12 @@ the user feedback.

# Modularizing JabRef {#sec:modularization}

**To do: only runnable with restrictions**

After JabRef was running with Java 9, the next goal was to modularize the
application in order to reinforce the architectural rules as shown in
[@sec:jabref], but also to extract useful libraries for other applications. In
the past there already efforts to extract libraries from JabRef using the build
tool Gradle's support for modules^[[https://github.com/JabRef/jabref/pull/3704](https://github.com/JabRef/jabref/pull/3704)].
After JabRef was running with Java 9 and all dependencies, that had updates
supporting Java 9 available, were updated, the next goal was to modularize the
application in order to reinforce the architectural rules as shown in
[@sec:jabref], but also to extract useful libraries for other applications.
In the past there were already efforts to extract libraries from JabRef using
the build tool Gradle's support for modules^[[https://github.com/JabRef/jabref/pull/3704](https://github.com/JabRef/jabref/pull/3704)].
Using this approach JabRef would not produce one monolithic +JAR artifact, but
several smaller +JAR artifacts depending on each other. The problems that +JPMS
addresses (see [@sec:j9_adv]), however, would not be addressed using this
Expand All @@ -1275,13 +1274,36 @@ at hand. Once the new module compiles without errors, the packages that should
be exported could be declared. Lastly, the application with the extracted module
was ran to ensure the functionality of the application.

**To do: components? modules?**

The modularization was performed with a bottom-up approach. First the components
with no dependencies on other components were extracted, then the components
with only dependencies on already modularized components were extracted and so
forth. This was done to avoid circular dependencies, which are disallowed by
+JPMS [@Mac2017].
The modularization was performed with a bottom-up approach.
First the Module component was extracted to a seperate module, as it has no
dependencies on any other components.
Then the Logic component was extracted as module, as it only depends on the
Model component.
This was done to avoid circular dependencies, which are disallowed by +JPMS
[@Mac2017].
Due to time constraints of this thesis and the strong coupling of the
components, the Preferences, +GUI and +CLI components could not be extracted to
seperate modules, but were left as one module.

![JabRef modules](images/jr_mods.svg){#fig:jr_mods}

[@fig:jr_mods] shows the three modules `org.jabref` containg the GUI, CLI and
Preferences components, `org.jabref.logic` and `org.jabref.model` containing the
Logic and Model component respectively.
Additionally, the module `jabref-testutil` was extracted.
However, this module was not encapsulated with +JPMS, but is only implemented as
an additional Gradle module, that is required by the Logic module for running
unit tests.
This module contains some annotations disabling certain unit tests to be ran on
the +CI (Continuous Integration) server, that automatically executes all tests
when changes are made, or to group unit tests into categories.
This module could be used in other modules.
The choice not to encapsulate this module with +JPMS was made, because of the
way Gradle handles unit tests.
A module is patched via command line switches (see [@sec:j9_mig]) to include the
unit test classes.
However, this module does not read the `jabref-testutil` module, so there is
no way that this module can access the classes defined in it.

## Handling Illegal Dependencies

Expand Down

0 comments on commit eb9e1fd

Please sign in to comment.