-
Notifications
You must be signed in to change notification settings - Fork 22
Features System
Natan Vieira edited this page May 13, 2023
·
2 revisions
This documentation is in progress.
- Creating a Feature
- Implementation Instance
- Coding Conventions
There are naming rules for features to make them easily identifiable, locatable and non-publicly extendable:
- PascalCase to the name of the constant that represents the implementation instance of this feature, e.g.:
MyAwesomeFeature
. - Regarding the feature class rules:
- Visibility must be
public final
; - Constructor must be
private
or package-private; - Cannot have any public fields unless they are effectively immutable;
- Name must be suffixed with "Feature";
- Be located inside the
me.devnatan.inventoryframework.feature
package, e.g.: "MyAwesomeFeature";
- Visibility must be
-
Implementation instance constant of this feature must be
public
,static
andfinal
.
public final MyAwesomeFeature implements Feature<...> {
public static final Feature<...> MyAwesomeFeature = ...
private MyAwesomeFeature() {}
...
}