gemini-2.0-flash-exp| input-price: 0.1 output-price: 0.4 max-context-length: 128_000 (cost: $0.50) Β· Anfrage: 2025-03-07T08:12:46.559131
Generated by rs-summarizer Version unbekannt
Josh Long's Deep Dive into Spring and AI: Building a Dog Adoption Service
0:00:08 Introduction & Session Goal: The speaker, Josh Long, aims to guide the audience through building a dog adoption service using Spring, covering everything from basic setups to advanced features within 3 hours. He is happy to be back at the conference.
0:01:55 The Current Tech Moment: Tech and societal factors align to create opportunities, emphasizing the need to pay attention to this exciting period.
0:02:43 Josh's Credentials: The speaker is a Spring developer advocate, Kotlin/Google Developer Expert, and Java Champion.
0:02:51 Contact Channels: Mentions using "the bird website" (Twitter), email and his YouTube channel "Coffee Software" for further engagement.
0:04:01 Initial Project Ideas (and Rejection): Considers demonstrating with the Spring Pet Clinic sample app but decides it's too complex due to numerous variants. He then suggests a simpler domain: Adopting dogs.
0:04:35 The Speaker's Dog: Describes his dog Peanut's malevolent and territorial behavior.
0:07:49 Inspiration from a Real Dog Ad: Draws inspiration from an old newspaper article that was an ad for a very disobedient dog from a previous pandemic.
0:09:00 Project Setup: Starts a new Spring project using start.spring.io, opting for Java 21.
0:11:35 Java 8 Hate: Explicitly shuns Java 8 as "terrible" and "irrelevant".
0:11:51 Recommends Java 21 or Later: Encourages the use of at least Java 21 for "morally and technologically superior" performance.
0:13:08 Dependence Choices: Adds web, Spring Data JDBC, PostgreSQL, PGVector (PostgreSQL with vector store), Spring AI (Open AI), Spring Modulith and Oauth2 to the dependencies.
0:14:57 Demo SQL Setup: Connects to SQL database using Spring Boot Devtools and Spring configuration.
0:16:55 Core Spring Concepts Discussion: Begins a digression discussing dependency injection, polymorphism, and Spring's role in wiring components.
0:18:59 Traditional XML Configuration: Describes old XML configuration for defining Spring beans and DI relationships, no longer used.
0:19:25 Configuration Alternatives: Covers component scanning with annotations (@Component), and explicit Java-based configuration (@Configuration).
0:22:48 Bean Definition Post-Processors: Explains the role of BeanFactoryPostProcessor to inspect and modify bean definitions.
0:24:36 Bean Post-Processors: Describes the purpose of BeanPostProcessor to adapt, wrap, or interrogate beans at runtime.
0:27:58 Spring Boot Autoconfiguration: Introduces Spring Boot's autoconfiguration mechanism and the use of conditional annotations.
0:30:36 Spring Modulith Introduction: Leverages Spring Modulith to enhance code modularity, aiming to limit the "blast radius" of code changes, and how it enables better velocity.
0:31:10 Non-public by Default: Recommends that you code should not be public by default, to maximize encapsulation.
0:31:46 Controller-Service-Repository Anti-Pattern: Recommends designing by feature (functional slice), instead of technical domain (by role).
0:32:51 Dog Domain Entity: Creates a record named Dog with the properties ID, Name, and Description.
0:33:18 Benefits of Java Records and Sealed Types: States that he loves Java Records, and elaborates on how records, sealed types, pattern matching, and smart switch expressions support data-oriented programming in modern Java.
0:37:02 Explains Contract of Tuples: Contract here is that Tuples are typed data and there is no such thing as derived state (or setter methods) in the data object.
0:41:03 Java language team is calling data oriented programming. Cites Brian Goetz as Java's champion and architect of data orientated programming.
0:41:55 Repository Setup: Sets up a repository for the data entity and creates a "Dog Adoption" endpoint.
0:43:35 Request Body Mapping: Adds the RequestBody annotation to a param.
0:45:14 New 'Vet' (Dog Tor) Domain: Adds a secondary dog "vet service" as a collaboration, but soon after realizes how that introduces coupling.
0:47:46 Integration via Messaging using Spring Events: Moves the integration to a Spring event, publishing a new message instead to reduce coupling.
0:47:57 Martin Fowler's 'What do you mean by Event-Driven?': Mentions the 2017 article and states 4 different use cases for event driven archictecture: Event Notification (enough), event carried state transfer (with details), event sourcing (replaying data) and cqrs (not one data store to write).
0:50:05 Details about the author and their career in IT.
0:50:31 Side note about hiring a driver.
0:56:58 Spring framework application event publisher: The way he implements this now!
0:57:07 Spring One Key Moments: He does digression on historical facts and points in Spring's long timeline.
1:00:04 Spatial Decoupling (with Thread Sleep Demo): Declares an event, adds an event listener, and makes the code synchronous to the vet domain, but then realizes that's wrong!
1:01:32 Introducing Spring Modulith: Adds async annotation, and says there is a reason why the event is synchronous by default, and then uses Spring Modulith's applicationModuleListener annotation and republishes outstanding events to help decouple the integration and help make it eventual consistent!
1:03:25 Demo of Republish Event: Republish is run again on restart to ensure the system is eventual consistent!
1:05:07 Load Balancing Solution: Describes additional code you can add for a full application runner to decide which node should handle the request.
1:07:16 Benefits of Limiting Access with Public: Recommends that you code should not be public by default, to maximize encapsulation.
1:08:40 Controller-Service-Repository Anti-Pattern: Recommends designing by feature (functional slice), instead of technical domain (by role).
1:11:56 Event Externalize: Says an event can be sent using Rabbit MQ or Kafka by stating a destination (depending on technology).
1:13:02 Modulith is not just a package!: Highlights that the code now is a Modulith, not just a package, and this can be checked.
1:13:08 Modulith and the Appliction Module: Demonstrates application modules and tests that that verify the internal module is consistent!
1:13:22 Modulith Architecture Diagrams: C4 architecture diagram shows state of system! A nice way to stop code from diverging (aka bit-rot).
1:15:05 Demonstration of Non-Exposed types: Shows "code leak" of a validator from adoption package to tor package, which is bad!
1:16:03 15-Minute Bio Break: Session takes a 15-minute break, starting at 10:50.
1:19:16 AI Implementation: The speaker continues to solve data access problem using AI.
1:20:53 Uses Open API as the AI for this session: States you could use something local (like AMA), or something remote.
1:21:07 Polite AI Prompts: Be very nice to the AI or they could take over! It has to act a role.
1:22:49 Demo of Coding in Java: Does a code demo in which is a jingle about what we heard about from the AI.
1:25:35 Data Costs: Mentions the need to limit the data that's sent as much as possible because there is cost with sending data to an AI (tokens).
1:26:50 Mentioned 1,000,000 token models exist! These models help you summarize data and work in the system.
1:27:35 Micrometer!: There are metrics that are available to get back tokens. So it won't bankrupted your application.
1:27:52 Spring AI Pattern: Uses a data vector store to search the data!
1:27:54 Start Spring shows many integration available in their ecosystem: Mulis, Nuoj, pinecone, redi, etc. These can be stored anywhere!
1:29:17 Code used for spring and data!
1:29:35 Recommends code injection with vector database to make sure AI gets data!
1:29:46 Uses key column and value as data contract! String is the thing it uses most.
1:29:58 Embedding Model You can use the model you can select.
1:30:42 Retrieval Augmented Generation Pattern: Used by the code and the data for AI query (aka RAG pattern).
1:31:00 Chat bot uses system to respond correctly! A chat bot to give great answers.
1:34:05 Good opportunity for developers to understand to use them in business.
1:34:54 Test code:
1:36:47 Some errors occur during the compilation.
1:38:02 After reboot code is now working, shows it all works
1:41:11 How to make this an application for production! Time to introduce Oauth
1:41:32 How did it go to that level? Code needs secured system with ooth.
1:41:39 What happened to that part of the code?
1:41:48 Creates autho service with Spring!
1:41:51 Properties!
1:42:34 Sign in Spring instead of Facebook, Google, etc!
1:45:04 What did he want to do to the application!
1:50:45 Uses get, and post.
1:51:40 Gateway Application used!
1:51:44 Make is secure!
1:52:45 Spring security now!!
1:54:21 Code to add back for Spring boot.
1:55:38 Java is amazing now!
1:55:55 Three code check to take to production!
1:55:58 Languages electricity use? Good
2:01:29 GrVM Native used! It's really quick!
2:04:00 I'll make that a code and I'll let make and see to it.
2:14:52 PS -osss the data is really quick!
2:14:55 This the least favorite borers from the author.
2:23:54 Virtual Threatds use and more and amazing!
2:30:55 Some interesting result with GrVM Native used!
2:41:46 GraphVM and Java and it's great data!