en un clic
archunit-rules
// ArchUnit architecture rules enforced in Xeres including common module rules (logging, utility classes), app module rules (no field injection, RsService naming), and UI module rules (WindowController naming).
// ArchUnit architecture rules enforced in Xeres including common module rules (logging, utility classes), app module rules (no field injection, RsService naming), and UI module rules (WindowController naming).
Cryptography patterns for Xeres including PGP operations, key generation, and hash functions with best practices.
DTO and mapper patterns for Xeres using Java records, canonical constructors with validation, and static mapper utility classes.
Flyway SQL migration patterns for Xeres including naming conventions, H2 database patterns, enum types, foreign keys, and best practices.
Gradle build configuration for Xeres including build commands, version management, module structure, and key plugins.
Code style, naming conventions, license headers, and patterns for Xeres Java project. Covers Allman braces, utility classes, package structure, and field injection rules.
JavaFX patterns for Xeres including controller structure with FXML views, WindowController lifecycle, WindowManager usage, and JavaFX-Spring integration.
| name | archunit-rules |
| description | ArchUnit architecture rules enforced in Xeres including common module rules (logging, utility classes), app module rules (no field injection, RsService naming), and UI module rules (WindowController naming). |
Architecture rules are enforced via ArchUnit tests in common/src/test/ and common/src/testFixtures/.
./gradlew test --tests "*CodingRulesTest"
CommonCodingRulesTest)java.util.logging allowedprivate static final Logger log; // Correct
Logger logger; // Wrong
public final class FooUtils
{ // Correct
private FooUtils()
{
throw new UnsupportedOperationException("Utility class");
}
}
Must have public static final int LENGTH:
public class ProfileIdentifier extends Identifier
{
public static final int LENGTH = 32;
}
AppCodingRulesTest)// Allowed
private final ProfileService profileService;
public Service(ProfileService profileService)
{ ...}
// Forbidden
@Autowired
private ProfileService profileService;
Service subclasses must end with RsService:
public class AvatarRsService extends RsService
{
} // Correct
public class AvatarService extends RsService
{
} // Wrong
Must have public or protected no-arg constructor:
@Entity
public class Profile
{
protected Profile() { } // Required
}
clone() method implementedtoString() methodapp module cannot access ui module packages:
noClasses().
that().
resideInPackage("io.xeres.app..")
.
should().
accessClassesThat().
resideInPackage("io.xeres.ui..")
UiCodingRulesTest)public class SettingsWindowController
{
} // Correct
public class SettingsController
{
} // Wrong
Use ChooserUtils instead:
// Forbidden
fileChooser.setInitialDirectory(path);
// Use instead
ChooserUtils.
setInitialDirectory(fileChooser, path);
Same rule as app module.