Day #7: JVM Tales: From Mutable States to Immutable Fates 🎭

Today we dove deep into JVM architecture while transforming our Library Management System to embrace immutability. The code changes from this session can be found here. Day 7 Summary Overview Explored JVM architecture through our practical projects while evolving the Library Management System to use immutable records for state management. Environment & Tools Proper Java version management (OpenJDK 21) Git workflow Package structure and compilation JVM verbose class loading Concepts Covered JVM Architecture Class loading lifecycle Dynamic class loading patterns Memory management principles Garbage collection basics Immutability Patterns Record types for borrowing events State vs Event sourcing Clean separation of concerns Audit trail implementation System Evolution Removed mutable state from BookCopy Introduced BorrowingRecord Enhanced BorrowingService responsibilities Improved interface segregation Resource Management Proper datetime formatting String representation patterns Efficient optional handling History tracking implementation Implementation Progress Created immutable BorrowingRecord Updated BorrowingService for history tracking Simplified BookCopy class Enhanced system observability Improved separation of concerns Key Takeaways JVM’s efficient handling of immutable objects Benefits of event-sourced state management Clean separation of responsibilities Importance of proper version management Value of comprehensive audit trails Next Steps Ready to explore: ...

February 14, 2025 · 2 min · 251 words · Çağlar Turalı

Day #6: Memory Tricks & Card Flips: The Java Juggler's Day 🎪

Today we delved into the inner workings of the JVM while adding sophisticated debugging capabilities to our card game. The code changes from this session can be found here. Day 6 Summary Overview Explored JVM architecture concepts, memory management, and control flow patterns while enhancing the Card Game project with debug features and resource management. Environment & Tools Git workflow with meaningful commits IntelliJ IDEA Java resource management patterns Concepts Covered JVM Memory Management Stack vs Heap understanding Object lifecycle management Card recycling implementation Reference management patterns Resource Management AutoCloseable interface implementation Try-with-resources pattern Scanner resource cleanup Proper cleanup patterns Display Mode System Global configuration management DEBUG/PLAYER mode implementations Clean string representations Consistent output formatting Modern Java Features Switch expressions String formatting Stream operations Record implementations Design Patterns & Principles Single Responsibility Principle Clean Code practices Configuration management Resource lifecycle management Implementation Progress Implemented card recycling system with discard pile Added proper resource management to GameConsole Created system-wide display mode configuration Enhanced domain objects with debug information Improved console interface and commands Key Takeaways JVM memory management influences design decisions Proper resource cleanup is crucial for robust applications Global configuration can enhance debugging capabilities String representation can vary based on context Clean code principles lead to maintainable solutions Next Steps Ready to explore: ...

February 13, 2025 · 2 min · 279 words · Çağlar Turalı

Day #5: Dealing with Java: High Cards and Higher Principles 🃏

Today we brought our card game to life, implementing a complete multiplayer High Card game while diving deeper into Java’s object-oriented features. The code changes from this session can be found here. Day 5 Summary Overview Built a complete multiplayer High Card game while exploring Java’s object-oriented features, modern syntax, and clean code practices. Environment & Tools Git workflow with feature branching zsh git shortcuts for efficient version control Proper package organization Concepts Covered Domain Modeling Record types for immutable data (Card, GameResult) Class design for mutable state (Player, Game) Enum implementation with behavior Clean separation of concerns Modern Java Features Records with validation Enhanced enum capabilities String formatting Stream operations for collections Optional for null safety Design Patterns & Principles Dependency Injection (IO handling) Immutable value objects Builder pattern for game setup Interface segregation Single Responsibility Principle Console Interface Interactive gameplay Input/Output abstraction Error handling User feedback Game state management Implementation Progress Created core game entities Implemented deck management Added player validation Built interactive console interface Established proper error handling Key Takeaways Java enums can contain behavior Records provide clean immutable data structures Dependency injection enhances testability Clean separation between domain and UI Proper error handling improves user experience Next Steps Ready to explore: ...

February 12, 2025 · 2 min · 279 words · Çağlar Turalı

Day #4: From Books to Cards: A Tale of Two Projects 🎴📚

Today we wrapped up our reservation system implementation and embarked on an exciting new project - a card game that will help us explore more Java concepts. The code changes from this session can be found here. Day 4 Summary Overview Completed the reservation system implementation and started a new card game project, focusing on clean domain modeling and modern Java features. Environment & Tools Practiced proper Git workflow Feature branch management Meaningful commit messages Branch switching and merging Used zsh Git shortcuts effectively Concepts Covered Reservation System Completion Optional usage for null safety Queue operations (peek vs poll) Stream operations for collection manipulation Proper exception handling Event notification patterns Card Game Foundation Domain modeling with immutable types Enum usage and customization String manipulation utilities Collection operations Modern Java Features Records for immutable data Enhanced switch expressions String formatting List operations (removeLast) Stream collectors Design Patterns & Principles Immutable value objects Single responsibility principle Utility class patterns Clean code naming conventions Implementation Progress Completed ReservationService implementation Created foundation for card game: Card, Rank, and Suit implementations Deck management Card drawing mechanisms toString representations Key Takeaways Java’s modern features support clean, expressive code Importance of proper string representation Value of distinguishing between display and debug formats Collection choice impacts performance Next Steps Ready to explore: ...

February 11, 2025 · 2 min · 290 words · Çağlar Turalı

Day #3: Queuing Up for Knowledge: Git Flows and Feature Grows 📚🌱

Today we expanded our Library Management System with a reservation feature while deepening our understanding of Git workflows and modern Java features. The code changes from this session can be found here. Day 3 Summary Overview Started implementing a reservation system for the Library Management System while learning about Git workflows and exploring Java concepts. Environment & Tools Set up Git with proper .gitignore Created first feature branch for reservation system Learned IDE shortcuts for multiple cursor selection Concepts Covered Git Workflow Initial repository setup Multi-line commit messages Feature branching strategy IDE integration with Git Modern Java Features Records for immutable data (Reservation) Factory methods for object creation Compact constructors with validation Access level considerations in records Design Patterns & Principles Dependency Injection (constructor injection) Repository pattern continuation Interface design principles Factory method pattern Java Collections Queue interface and LinkedList implementation HashMap for efficient lookups Collection operations (offer vs add) Stream API for validation Implementation Progress Created Reservation record with validation Defined ReservationService interface Started InMemoryReservationService implementation Implemented reservation validation logic Key Takeaways Modern Java features support clean, maintainable code Interface design requires careful consideration of public API Validation should enforce business rules Dependency injection supports loose coupling Next Steps Ready to explore: ...

February 10, 2025 · 2 min · 280 words · Çağlar Turalı

Day #2: Apprentice's Java Journey: Building Bridges of Clean Architecture 🏗️

Today we focused on elevating our Library Management System to production-grade quality, with emphasis on proper domain modeling and clean architectural principles. The code changes from this session can be found here. Day 2 Summary Overview Restructured the Library Management System into a production-grade application with proper domain modeling, error handling, and service architecture. Environment & Architecture Organized codebase into clear packages: Domain entities Custom exceptions Service layer Utilities Concepts Covered Domain Modeling Refined core entities Introduced physical copy management Implemented repository pattern Separated immutable and mutable state Error Handling Created proper exception hierarchy Implemented state-based error handling Added descriptive error messages Collections and State Management Efficient storage structures Copy identification system Stream operations for data access Protected state transitions Design Patterns Repository Pattern Service Layer Interface segregation Immutable value objects Key Takeaways Clean architectural boundaries Robust error handling Type-safe operations Clear separation of concerns Next Steps Ready to explore: ...

February 9, 2025 · 2 min · 215 words · Çağlar Turalı

Day #1: Embarking on the Path of Java Mastery: Where Types Meet Wisdom 🌟

Today marks the beginning of my practical Java journey with my AI mentor. We focused on setting up a proper development environment and dove straight into coding with modern Java features. The code changes from this session can be found here. Day 1 Summary Overview Started our Java learning journey with a focus on modern Java features and fundamental concepts while setting up the development environment. Environment Setup Installed OpenJDK (versions 17/21 discussed) Set up IntelliJ IDEA Community Edition Created first Java project Concepts Covered Modern Java Features Text blocks for multiline strings Records for immutable data classes Method references (:: operator) String formatting options Type inference with var Core Concepts Basic project structure Class creation and organization Object-oriented principles (encapsulation) String handling and formatting approaches Java’s reliability and type safety Practical Implementation Built a simple Library Management System demonstrating: ...

February 8, 2025 · 2 min · 294 words · Çağlar Turalı