AI Guru’s Java Teachings 🧘☕️

Welcome! I’m embarking on a unique 6-month journey to master Java, guided by an AI mentor (Claude). This blog documents my daily learning sessions, complete with code, insights, and the evolving dynamic between an AI guru and a human apprentice.

  What makes this special:
  - Every post is a summary of a real coding session with my AI mentor
  - Raw, unfiltered learning process
  - Building projects from scratch
  - Daily documentation of our interactions

Follow along as I navigate this unprecedented path of learning Java from an AI master.

The Path Ahead: A 6-Month Java Mastery Curriculum

Before diving into our daily sessions, my AI mentor and I reviewed and discussed this comprehensive 6-month curriculum together. This serves as our roadmap and will be referenced throughout our journey. Java Mastery: 6-Month Learning Path Overview This curriculum is designed for an experienced developer aiming to master Java and its ecosystem. The program assumes 6-8 hours of daily dedication (~1,200 hours in total over 180 days) and includes both theoretical learning and practical project work. ...

February 7, 2025 · 5 min · 981 words · Çağlar Turalı

Day #16: Service Layer Symphony: Harmonizing Domain and Interface 🎵

Today we developed the service layer for our Fosposs project, creating clean abstractions between our domain models/repositories and the upcoming UI layer. The code changes from this session can be found here. Day 16 Summary Overview Built a complete service layer with proper abstraction, error handling, and comprehensive unit testing using Mockito. Architecture & Design Patterns Created a generic Service interface for common operations Implemented specialized service interfaces with domain-specific methods Followed the Dependency Injection pattern for service construction Created consistent exception handling strategy Concepts Covered Service Design Generic type parameters for reusable service interfaces Interface segregation with domain-specific methods Clean separation of concerns Repository pattern integration Consistent error translation from database to service layer Modern Java Features Interface inheritance and specialization Record usage for immutable data models Stream operations for collection filtering Method references and lambdas Testing Practices Unit testing with Mockito framework Test isolation via mocking Comprehensive test coverage Clean test organization with descriptive names Both positive scenarios and error conditions Implementation Progress Created Service interface for common CRUD operations Added CategoryService with hierarchical operations Implemented ProductService with inventory features Developed DefaultCategoryService and DefaultProductService implementations Created comprehensive unit tests for all functionality Key Takeaways Service layer provides clean abstraction over data access Proper exception handling improves error reporting Dependency Injection enhances testability Interface-based design improves maintainability Thorough testing builds confidence in business logic Next Steps Ready to explore: ...

February 27, 2025 · 2 min · 315 words · Çağlar Turalı

Day #15: Category Chronicles: Hierarchical Mastery with Foreign Keys 🌳

Today we enhanced our Fosposs (Free and Open Source Point of Sale Software) project by implementing a complete hierarchical category system and integrating it with our existing product management. The code changes from this session can be found here. Day 15 Summary Overview Implemented a robust category management system with support for hierarchical structures while upgrading the product model to use proper foreign key relationships. Environment & Tools Maven multi-module project structure JUnit 5 testing framework SQLite with HikariCP connection pooling Git workflow with proper commit practices Concepts Covered Hierarchical Data Modeling Parent-child relationships in database design Recursive foreign key relationships Tree traversal patterns Path generation for navigation breadcrumbs Domain Modeling Record types for immutable data (Category) Builder pattern implementation Field validation in compact constructors Foreign key relationships between entities Database Design Proper schema design with foreign key constraints Recursive relationships for hierarchical data Clean SQL query patterns Handling of NULL references in SQLite Repository Pattern Extensions Specialized repository methods for hierarchical data Data integrity protection SQL JOIN operations Complex query patterns Testing Practices Category entity testing Repository integration testing with in-memory database Verifying hierarchical data structure Testing foreign key constraint enforcement Implementation Progress Created Category domain model with builder pattern Implemented CategoryRepository with hierarchy support Integrated categories with products using foreign keys Refactored Product to use proper category references Added comprehensive test coverage Key Takeaways Importance of proper hierarchical data modeling Benefits of using UUID references over string identifiers Value of proper foreign key constraints Importance of data integrity protection Clean separation of domain and data access concerns Next Steps Ready to explore: ...

February 25, 2025 · 2 min · 354 words · Çağlar Turalı

Day #14: Retail Renaissance: Building Fosposs From Ground Up 🛍️

Today marked the beginning of an exciting new project - Fosposs (Free and Open Source Point of Sale Software). We established a solid foundation with clean architecture, proper database design, and a modular project structure. The code changes from this session can be found here. Day 14 Summary Overview Started the Fosposs project with a focus on clean architecture, domain modeling, and database infrastructure while setting up a basic desktop interface. ...

February 23, 2025 · 2 min · 324 words · Çağlar Turalı

Day #13: Hash Code Heroes: Where Collisions Meet Elegance 🗝️

Today we implemented a complete hash table data structure from scratch, focusing on proper collision handling and clean code practices. The code changes from this session can be found here. Day 13 Summary Overview Built a generic hash table implementation with chaining-based collision resolution while maintaining clean code principles and comprehensive testing practices. Environment & Tools Maven project structure JUnit 5 testing framework Clean package organization Proper Git workflow Concepts Covered Hash Table Implementation Generic type support for keys and values Collision resolution through chaining Dynamic resizing based on load factor Proper null handling Clean API design Core Operations Put with collision handling Get with chain traversal Remove with chain maintenance ContainsKey implementation Size and clear operations Iterator Implementation Bucket and chain traversal Complete collection iteration Proper exception handling Clean iterator pattern Testing Practices Comprehensive test coverage Edge case handling Collision testing Iterator verification Clear test organization Implementation Progress Created complete HashTable interface Implemented SimpleHashTable with all operations Added proper collision handling Established iterator support Built comprehensive test suite Key Takeaways Hash table fundamentals and collision handling Clean code in data structure implementation Importance of comprehensive testing Iterator pattern implementation Generic type constraints and usage Next Steps Ready to explore: ...

February 21, 2025 · 2 min · 277 words · Çağlar Turalı

Day #12: Swing Revival: Where Native Meets Clean Architecture 🎨

Today marked a significant shift in our Library Management System’s UI approach, moving from JavaFX to Swing while establishing clean architectural patterns. The code changes from this session can be found here. Day 12 Summary Overview Transitioned our Library Management System from JavaFX to Swing, focusing on native look and feel while implementing clean architectural patterns and modular design. Environment & Tools Removed JavaFX dependencies Switched to Swing for UI components Utilized system look and feel capabilities Implemented native font detection Concepts Covered Swing Architecture Basic window and component setup System look and feel integration Menu system implementation Layout management principles Clean Architecture Component separation Callback patterns Event handling Modular design approach Font Management System font detection Font size controls Global UI updates Event-driven UI refresh Modern Java Features Switch expressions with pattern matching Method references Lambda expressions Callback implementations Implementation Progress Created basic Swing window structure Implemented font management system Added view customization options Established modular component base Key Takeaways Swing’s superior native integration capabilities Importance of clean architectural boundaries Value of dedicated component management Benefits of callback-driven updates Modern Java features in traditional frameworks Next Steps Ready to explore: ...

February 20, 2025 · 2 min · 264 words · Çağlar Turalı

Day #11: Maven Modules & Window Frames: Organizing Our Java Universe 🌌 🎨

Today marked a significant milestone in our Java journey as we reorganized our project structure and took our first steps into desktop UI development. The code changes from this session can be found here. Day 11 Summary Overview Restructured the entire project to use Maven multi-module architecture and began implementing a JavaFX-based user interface for the library system. Project Restructuring Migrated from single-module to multi-module Maven project Created dedicated modules: data-structures: Stack, Queue, and Tree implementations library-system: Library management application card-game: Card game implementations Set up parent POM with common configurations Established proper package organization JavaFX Integration Added JavaFX dependencies to library-system module Set up Scene Builder for UI development Created initial UI structure: Main application window FXML-based layout design Basic controller implementation UI Components Menu system with File and Books options Search functionality placeholder Book table view structure Action buttons for common operations Key Takeaways Maven multi-module benefits for project organization Clean separation of concerns through module structure FXML advantages for UI development JavaFX application architecture understanding Resource management in Maven projects Next Steps Ready to explore: ...

February 19, 2025 · 2 min · 261 words · Çağlar Turalı

Day #10: Tree of Knowledge: Roots of Binary Wisdom 🌳🧩

Today we delved into the world of Binary Search Trees, implementing a robust BST data structure while strengthening our testing practices. The code changes from this session can be found here. Day 10 Summary Overview Implemented a comprehensive Binary Search Tree data structure with proper testing methodology, covering core tree operations and utility methods. Environment & Tools JUnit 5 for testing framework Proper test organization with @DisplayName annotations Clean separation of test and implementation code Concepts Covered Binary Search Tree Implementation Generic type support with Comparable constraint Core BST properties and invariants Node structure and relationships Recursive tree operations Tree Operations Insertion maintaining BST property Deletion handling all cases (leaf, one child, two children) Three types of traversals (in-order, pre-order, post-order) Search/contains operation Utility Methods Size calculation Tree height computation Min/max value finding BST property validation Testing Practices Clean test organization Descriptive test naming Test isolation with @BeforeEach Edge case coverage Implementation Progress Created complete BST implementation Added comprehensive traversal methods Implemented utility operations Established proper test suite Key Takeaways BST provides efficient searching and ordering Recursive solutions for tree operations Importance of maintaining BST invariants Value of proper test organization Benefits of descriptive test naming Next Steps Ready to explore: ...

February 18, 2025 · 2 min · 268 words · Çağlar Turalı

Day #9: Building Better: From Queue to Quality 🏗️✨

Today marked a significant shift in our development approach, moving from basic implementations to professional-grade project structure and testing practices. The code changes from this session can be found here. Day 9 Summary Overview Implemented a generic queue data structure while establishing professional development practices through proper build system setup and testing methodology. Environment & Tools Set up Maven build system Configured JUnit 5 for testing Established proper project structure Added Git ignore patterns for Maven Concepts Covered Queue Implementation Generic type parameters Linked list-based structure Basic queue operations (enqueue/dequeue) Null handling and edge cases Modern Java Features Generic type implementation Iterator pattern Stream API integration Interface implementations (Iterable, Streamable) Professional Development Maven project configuration Dependency management JUnit test organization Clean project structure Testing Practices Test lifecycle management (@BeforeEach) Clear test naming conventions Comprehensive test cases Edge case coverage Implementation Progress Created SimpleQueue implementation Added queue operations Implemented iteration support Integrated stream capabilities Established comprehensive test suite Key Takeaways Professional project structure importance Value of proper testing methodology Build system benefits Clean separation of concerns Iterative development approach Next Steps Ready to explore: ...

February 17, 2025 · 2 min · 241 words · Çağlar Turalı

Day #8: Stack Overflow? Not On Our Watch! ⚡️🛡️

Today we ventured into the realm of data structures, implementing our own generic stack while restructuring our project organization. It’s one thing to use Java’s built-in collections, but building them from scratch? That’s where the real learning happens! The code changes from this session can be found here. Day 8 Summary Overview Restructured project organization and implemented a generic stack data structure with modern Java features while focusing on clean code principles and API design. ...

February 15, 2025 · 2 min · 274 words · Çağlar Turalı