-
-
Notifications
You must be signed in to change notification settings - Fork 189
Project Architecture
This page attempts to help new developers start contributing to Plan.
It does not go over the build tool & commands for building as those are detailed in Project Setup.
Page version: 5.0 build 263 Commit
- Java
- Modules & Dependencies between modules
- Dagger & Dependency injection
- Structure outline of
common-module - About Platform APIs
- Web dev
- Technology stack
- Template-like html
- Static Resources
| Module | Role |
|---|---|
api |
Contains code for public API interface classes |
extensions |
Contains built-in extensions that use DataExtension API (in public API) |
common |
Main package for everything |
bukkit, bungee, sponge, velocity
|
Platform specific modules |
plugin |
Creates a single jar out of the modules |
Most of the time work is done in common module as platforms are abstracted away.
api -> extensions -> common -> bukkit, bungee, sponge, velocity -> plugin
From the build order, the dependencies between the modules should be apparent.
Dagger (https://dagger.dev/) is used extensively around the project. It was used as a remedy to reduce static usage. (See decisions here Refactor plugin to use static getters and Dependency Injection: Dagger)
@Singleton annotations are used to tell Dagger that only a single instance should exist per initialized Component (So that each PlanSystem only has one DatabaseSystem instead of returning a new one every time the database is needed.)
@Inject annotations are used in Constructors to tell Dagger to resolve the dependencies for constructing a new instance of this class.
Note that the Inject constructors allow Injecting an instance of the class the constructor is in to another object:
public class Foo {
@Inject
public Foo() {}
}
public class Bar {
@Inject
public Bar(Foo foo) {}
}
This is the main mechanism used for instantiating different system level objects, more about those below.
Under construction
