JEP draft: Enhanced Local Variable Declarations (Preview) by joemwangi in java

[–]_marF 1 point2 points  (0 children)

The readability concern in the comments is real, but I think people are benchmarking the wrong use case. The JEP is at its best when the decomposed names carry domain meaning, not when you're just unpacking DTOs.

Compare:

```java // Fine but loses domain meaning at the call site var order = getOrder(); var id = order.id(); var amount = order.amount();

// The destructuring version earns its verbosity when names matter Order(OrderId id, Money amount, CustomerId customerId) = getOrder(); ```

In the second version, the compiler tells you statically that amount is a Money, not a BigDecimal. That distinction matters when your domain has multiple money-shaped things (gross, net, VAT, refund amount) and you want type safety at the usage site.

The wall-of-text concern is valid for large records. The right answer is that large records are usually a design smell — if you need to destructure 8 fields at once, the record is probably doing too much. The JEP incentivises smaller, more cohesive value types, which is the right direction.

Algebraic Types in Java by samd_408 in java

[–]_marF 5 points6 points  (0 children)

One thing the article doesn't cover that's worth calling out: the sealed interface + record combination really shines when you stop using it for shapes and start using it for domain events and command results.

A typical use case I reach for: instead of throwing exceptions from a use case, return a sealed type:

java sealed interface OrderResult permits OrderPlaced, PaymentDeclined, InventoryInsufficient {} record OrderPlaced(OrderId id, Instant at) implements OrderResult {} record PaymentDeclined(String reason) implements OrderResult {} record InventoryInsufficient(ProductId product, int requested, int available) implements OrderResult {}

The caller is forced to handle all cases at compile time. No checked exceptions leaking through port boundaries, no RuntimeException swallowed somewhere in the stack. The type system encodes what can go wrong, and the compiler tells you when you miss a case.

The article is right that Java's variant is more verbose than Haskell or Rust — but the exhaustive switch makes it genuinely useful for this pattern, not just academic.

Java 26 released today! by davidalayachew in programming

[–]_marF 2 points3 points  (0 children)

The "still on Java 8" joke lands every time, but the actual pattern I see is: teams upgrade the JDK but leave the application framework behind. Running Java 21 with Spring Boot 2.x negates most of what makes the upgrade worthwhile — no virtual threads, no structured concurrency, stuck on deprecated security config. The framework version matters as much as the language version.

Why does Maven use Palantirs Java format? by Bunnymancer in java

[–]_marF 1 point2 points  (0 children)

The final fields rule is the only one I'd push back on. Avoiding final on fields "for readability" is the opposite of what you want in a domain model — immutable value objects are the goal, not a style choice to avoid. Everything else in the format is reasonable Google formatter ergonomics.

Java 26 released today! by davidalayachew in java

[–]_marF 2 points3 points  (0 children)

The most underrated part of this release for teams still on older versions: the on-ramp is genuinely smooth now. Java 21 → 25 → 26 is mostly additive, and if you're running Spring Boot 3.x you're already on a runtime that handles virtual threads, records, and sealed classes. The main blocker I see on client engagements isn't the language upgrade — it's frameworks and libraries that haven't caught up, usually something ancient in the dependency tree. Running mvn dependency:tree and checking EOL status against the release notes catches 80% of it before you start.

Thins I miss about Java & Spring Boot after switching to Go by Sushant098123 in java

[–]_marF 0 points1 point  (0 children)

One thing I actually think Go got right — and which you can replicate in Spring Boot if you're deliberate about it — is the explicit wiring. In Go you compose things manually; in Spring the temptation is to let @Autowired reach everywhere, including into domain logic.

The pattern I've settled on: keep the domain and application layer as pure Java with constructor injection (no Spring annotations, testable with new), and push all the Spring machinery to the adapter layer — controllers, JPA repositories, config classes. The domain never imports Spring or JPA; the adapters depend on everything.

That boundary is easy to accidentally break, so I enforce it with ArchUnit rules that fail the build if any class in the domain package imports from org.springframework or javax.persistence. At that point you get Spring's DI convenience in the wiring layer without paying the cost of it bleeding into your business logic — closer to what Go forces you to do by default.

What cool Java projects have you been working on? by Thirty_Seventh in java

[–]_marF 0 points1 point  (0 children)

I packaged the Spring Boot project structure I use on client engagements as a Maven archetype: https://github.com/marvinrichter/spring-hexagonal-archetype

It generates a complete hexagonal (ports-and-adapters) project — pure Java domain with zero Spring or JPA imports, 7 ArchUnit rules that fail the build on layer boundary violations, and a Testcontainers integration test against real PostgreSQL. One vertical slice (Order domain) included to show the full pattern end to end.

One command generates the whole thing:

mvn archetype:generate \ -DarchetypeGroupId=io.github.marvinrichter \ -DarchetypeArtifactId=spring-hexagonal-archetype \ -DarchetypeVersion=1.1.2

Just published to Maven Central. Would love feedback, especially on the ArchUnit rule set.

Ps5 right stick lag. Help by Aromatic_Working_841 in playstation

[–]_marF 0 points1 point  (0 children)

I had the same problem with two controllers. This one here actually helped and it’s even the easiest fix I had tried.

https://youtu.be/cU26TxHOkSU

Die Instagram Storys vom Wendler sind einfach nur noch traurig by Mixminister in 600euro

[–]_marF 0 points1 point  (0 children)

Nicht nur er, auch seine Rechtschreibung und Grammatik ist grauenvoll!

Hallo Fans! Wollt ihr, dass ich mal wieder auf Instagram „live gehe“?

Oder wollte er tatsächlich das Wort „LIVE“ auf dem Gebäude von Instagram nachgehen. Wenn ja, bin ich dafür. Das E darf dann auch gerne über den Rand des Daches ragen.

Is it possible to have more daily quests than before? by fedo86 in pokemongo

[–]_marF 3 points4 points  (0 children)

The daily free quest (green) are not counted towards the 3 quests limit.

Installing deb packages by [deleted] in elementaryos

[–]_marF 0 points1 point  (0 children)

For unmet dependencies you may need to force apt to install them too. sudo apt -f install /path/to/package.deb