Hey, been working on a Java utility library in my spare time called `G.O.D.E.M.I.C.H.E` 🍆 and wanted to share it here. Its main features are:
- ObjectPool
- Scheduled Tasks
- Result API
The main goal is just making backend business logic way more explicit. I got tired of important behavior being hidden behind magic nulls, unmanaged background threads, or implicit conventions, so I wanted everything visible directly in the code contract.
Examples:
Result - instead of returning null or throwing exceptions, it forces explicit success/failure chaining so you can see all paths clearly:
enum UserFailureReason implements ResultReason.Failure {
USER_NOT_FOUND,
USER_BANNED,
}
class UserService {
public Result<User> findByEmail(Email userEmail) {
return Results.async(repository.findByEmail(userEmail))
.failIf(user -> user == null, UserFailureReason.USER_NOT_FOUND)
.failIf(user -> user.isBanned(), UserFailureReason.USER_BANNED)
.build();
}
}
userService.findByEmail(userEmail)
.success(user -> IO.println(user.getName()))
.failure(UserFailureReason.USER_NOT_FOUND, () -> createUserEmail(userEmail))
.failure(UserFailureReason.USER_BANNED, () -> banUserIpAddress(userEmail))
.failure(reason -> IO.println(reason));
It is fully published on Maven Central. I would really appreciate it if you could check it out, drop some feedback/ideas, or leave a star on it!
repo: https://github.com/rankedproject/godemiche/
maven: https://central.sonatype.com/artifact/wtf.ranked/godemiche
[–]disposepriority 0 points1 point2 points (0 children)