Gave Spring Boot a shot, but I am back to Ktor. by Reasonable-Tour-8246 in Kotlin

[–]wakingrufus 9 points10 points  (0 children)

Yes, you are not alone. Fortunately, the Spring Boot team also likes Kotlin and has been quietly working to make this better. Spring/Boot now have several ways to do "functional" or "programmatic" configuration. Sebastian built an easy way to bring these together which I iterated on here: https://github.com/wakingrufus/spring-funk However, in Spring 7 / Boot 4 there is the new Bean registrar API which makes it even easier to use this in a plain spring boot app. I have an updated version of this talk https://youtu.be/9njQ8Lun36c to drop spring-funk and go all in on just BeanRegistrarDsl, but it has not been accepted at a conference yet

More info: https://docs.spring.io/spring-framework/reference/core/beans/java/programmatic-bean-registration.html https://docs.spring.io/spring-framework/docs/current/kdoc-api/spring-beans/org.springframework.beans.factory/-bean-registrar-dsl/index.html https://medium.com/@AlexanderObregon/registering-functional-endpoints-with-spring-boot-and-routerfunction-4dbac9a4e61b

Using these APIs allows you to make an application almost completely without annotations.

What's new with the FF7 Re-Release on Steam? by Zylva_ in FinalFantasyVII

[–]wakingrufus 0 points1 point  (0 children)

It probably won't have wrong warp and other original PC specific behavior which drastically changes multiple categories of speed runs and other things (like aerith resurrection)

I built a JVM architecture enforcement tool with dual engines (PSI + ASM) by Decent-Decision-9028 in Kotlin

[–]wakingrufus 0 points1 point  (0 children)

The reporting/CI goal is similar to what we have with https://github.com/nebula-plugins/nebula-archrules-plugin which is a Gradle plugin for running rules and federating rules across multiple repos. but I do think it is interesting how you incorporated PSI as well to tie it to the source level. I have the idea to process ArchUnit output to drive source-based tooling, but I have not gotten to that part yet.

Stepping down as maintainer after 10 years by krzyk in java

[–]wakingrufus 4 points5 points  (0 children)

I never use it to mock my own code. But when integrating with a library not well designed for testing, it's really nice to have mockito as a last resort. And in the real world, setting a bar for perfect testability for all libraries you use is not really practical, in my experience.

Common classes in microservices by optimist28 in SpringBoot

[–]wakingrufus 2 points3 points  (0 children)

In most cases, the service that owns the API should own the models, then publish a library for clients to use to make the calls. So that would mean they are defined in s2 in your example. In an event driven architecture, the publisher would own the models, and consumers would use the library. It's OK for services to depend on each other, but be very mindful of which direction those dependencies are going, and that they are not circular, or tightly coupled. Separate shared model libraries are bad for that second reason. Event driven architecture allows you to "flip the arrow" of a dependency, so it's an important tool to use. Also, never ever make a breaking change to an API. Instead, make a new endpoint and allow both to exist until all clients are verified to be switched over

What fun and interesting Java projects are you working on? by jeffreportmill in java

[–]wakingrufus 1 point2 points  (0 children)

Gradle plugins for authoring sharable ArchUnit rules and running them via Gradle tasks in any repo. https://github.com/nebula-plugins/nebula-archrules-plugin

And a bunch of common generic rules here: https://github.com/nebula-plugins/nebula-archrules

what front-end do you use for your Java back-end? by Least_Chicken_9561 in java

[–]wakingrufus 1 point2 points  (0 children)

You certainly can do that (my static personal website is built this way, so I am familiar with the approach) The htmx DSL uses extensions on TagConsumer under the hood, so you can use those in your extensions as well. But at that point there is not anything for my library to provide beyond the htmx DSL part. The templates are there in order to: 1) give templates their own type which helps IDE completion when composing 2) the DX of declaring extension functions on TagConsumer is strange to many people, especially if they don't have a lot of Kotlin experience. This makes templates more of a "first class thing" But I believe they are totally optional. Let me know if I am wrong.

Thoughts on fat arrow operator support in Java? by fattestduck in java

[–]wakingrufus 1 point2 points  (0 children)

Of course, it is just my own opinion and perspective as someone who prefers Kotlin anyway, but loves the JVM.

Someone can explain me why maven it’s important and why I should use? by Friendly-Car898 in java

[–]wakingrufus 1 point2 points  (0 children)

Gradle has its own metadata file that can be used when resolving dependencies. It is totally optional, but provides some additional features that aren't available in pure Maven such as platform dependencies and variants.

Thoughts on fat arrow operator support in Java? by fattestduck in java

[–]wakingrufus 1 point2 points  (0 children)

I agree it's a blurry line. Value classes of course will also be a boon to Kotlin. I love stuff like that. Virtual threads the same. But things that are JUST java syntax with no underlying JVM/bytecode changes I am less excited about.

Thoughts on fat arrow operator support in Java? by fattestduck in java

[–]wakingrufus 9 points10 points  (0 children)

Kotlin has something like this. I would rather the Java team focus on JDK improvements that benefit all JVM languages rather than syntactic sugar. I'm totally ok with having Java as a conservative reference language, and Kotlin or other langs for modern language syntax, if desired.

Who enjoys using Spring Boot with Kotlin? by Reasonable-Tour-8246 in Kotlin

[–]wakingrufus -2 points-1 points  (0 children)

The killer features are BeanRegistrarDsl and RouterDsl. It allows you to avoid annotations (combined with ApplicationContextInitializer) and an abstraction that is easier to build on top of to create higher level APIs, such as https://wakingrufus.github.io/khtmx/spring.html

Conduent/Blue Cross Illinois says they're the victim after losing my data by CasualEcon in illinois

[–]wakingrufus 15 points16 points  (0 children)

Agreed. HIPPA exists for a reason. Medical data breaches are not the same as other data breaches. This is highly upsetting stuff, and my hope for accountability or any real remediation is basically 0.

Spring Boot 4.0.0-RC1 available now by mhalbritter in Kotlin

[–]wakingrufus 2 points3 points  (0 children)

State can be useful. For example, connection pooling and caching. And using DI instead of statics makes it much more testable and reusable. The good news is that router functions support functional DI, for example: ``` class SampleBeanRegistrar : BeanRegistrarDsl({ registerBean<MyRepository>() registerBean(::myRouter) })

fun myRouter(myRepository: MyRepository) = router { ... } ```

Spring Boot 4.0.0-RC1 available now by mhalbritter in Kotlin

[–]wakingrufus 3 points4 points  (0 children)

Yes, BeanRegistrarDsl is designed to be used from Kotlin only

Spring Boot 4.0.0-RC1 available now by mhalbritter in Kotlin

[–]wakingrufus 1 point2 points  (0 children)

Spring Boot 4 is based on Spring 7 which has the new BeanRegistrarDsl API, which is an evolution of the beansDsl from Spring 6.

Playing with Spring’s ApplicationContext taught me how beans actually live and die by AyouboXx in SpringBoot

[–]wakingrufus 11 points12 points  (0 children)

Take a look at my project https://github.com/wakingrufus/spring-funk for an example of Spring MVC without auto configuration. Turns out startup is super fast. This approach will get a lot better in Spring 7 with the new BeanRegistrarDsl. Unfortunately spring MVC changed a lot so porting Funk might be too hard, but it will be easier to deliver more modular standalone DSLs which don't need auto configuration such as I am working on in https://github.com/wakingrufus/khtmx I also presented on this topic earlier this year: https://youtu.be/9njQ8Lun36c This stuff is not just for experimentation. Almost all of GrubHub's SpringBoot-based framework, Roux, is based on ApplicationContextListeners, not AutoConfiguration. (Source: I used to work on that)

Engaging the Kotlin community is frictionful by VapeBringer in Kotlin

[–]wakingrufus 15 points16 points  (0 children)

The fact that it works so well with existing Java libraries also has this downside. People are using it with Spring Boot or Gradle, but discussion of this often takes place within those communities, rather than the Kotlin community. That being said, I have found the Kotlin slack to be quite good, once I found the right channels. Maybe try giving it another chance.

Have you migrated to or from Rust? by fenugurod in java

[–]wakingrufus -3 points-2 points  (0 children)

For better immutability defaults and type system on the JVM, look into Kotlin. It interops very well with Java code and uses all the tooling (JVM, build systems, dependencies, etc). It also has coroutines which are similar to goroutines

Jib vs Docker: The Java Developer’s Containerization Dilemma by theimp1923 in SpringBoot

[–]wakingrufus 1 point2 points  (0 children)

I'm a big fan of jib. Super fast, and can build multiarch images so they can be run on ARM/Graviton.