{"id":3480,"date":"2024-09-05T23:52:31","date_gmt":"2024-09-06T03:52:31","guid":{"rendered":"https:\/\/www.mymiller.name\/wordpress\/?p=3480"},"modified":"2024-11-03T20:08:42","modified_gmt":"2024-11-04T01:08:42","slug":"coding-standard-zero-tolerance","status":"publish","type":"post","link":"https:\/\/www.mymiller.name\/wordpress\/architecture\/coding-standard-zero-tolerance\/","title":{"rendered":"Coding Standard: Zero Tolerance"},"content":{"rendered":"\n<p>Coding standards are the unsung heroes of software development, quietly shaping the backbone of every successful project. Like the grammar rules of a language, they provide a common set of guidelines that developers adhere to when writing code. From indentation styles to variable naming conventions, coding standards ensure consistency, readability, and maintainability across a codebase. In this blog post, we&#8217;ll delve into the importance of coding standards, explore how they enhance collaboration and efficiency within development teams, and discuss best practices for implementing and enforcing them effectively. So, grab your favorite beverage and let&#8217;s embark on a journey to unravel the significance of coding standards in the world of software engineering.<\/p>\n\n\n\n<p>ZERO Tolerance means for any code to be accepted in a Pull Request, it must meet the following requirements:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>0 Sonarlint issues found<\/li>\n\n\n\n<li>0 JavaDoc errors\/warnings<\/li>\n\n\n\n<li>Protobuf fully documented<\/li>\n\n\n\n<li>JaCoCo reporting 90+% code coverage.<\/li>\n\n\n\n<li>Spotless code formatter.<\/li>\n<\/ul>\n\n\n\n<p>Enforcing strict coding standards is the cornerstone of maintaining high-quality software. Among the myriad of practices, adopting a &#8220;zero tolerance&#8221; policy in pull requests ensures that only code meeting a predefined set of criteria is accepted into the codebase. This approach not only elevates the overall quality of the software but also fosters a culture of excellence within development teams.<\/p>\n\n\n\n<p>At the heart of this stringent policy lies the requirement of zero SonarLint issues. SonarLint, a static code analysis tool, meticulously scans code for bugs, vulnerabilities, and code smells. By mandating the absence of SonarLint issues, teams uphold a commitment to code cleanliness, which in turn enhances the reliability and security of the software.<\/p>\n\n\n\n<p>In addition to SonarLint checks, adherence to JavaDoc standards is paramount. JavaDoc serves as invaluable documentation for developers, providing insights into the purpose and functionality of code elements. By ensuring zero JavaDoc errors or warnings, teams prioritize clarity and comprehensibility, facilitating smoother collaboration and knowledge transfer among team members.<\/p>\n\n\n\n<p>Furthermore, comprehensive documentation of Protobuf (Protocol Buffers) is essential. Protobuf offers a concise and efficient mechanism for serializing structured data, but its effectiveness hinges on clear documentation. By mandating fully documented Protobuf definitions, teams promote transparency and ease of integration, empowering developers to leverage Protobuf effectively across the codebase.<\/p>\n\n\n\n<p>Aiming for a JaCoCo code coverage of 90% or higher adds another layer of assurance to the quality of the software. JaCoCo, a Java code coverage library, provides insights into the extent to which code is exercised by tests. By setting a high bar for code coverage, teams prioritize thorough testing, mitigating the risk of undiscovered defects and enhancing the robustness of the software.<\/p>\n\n\n\n<p>Finally, integrating a Spotless code formatter into the development workflow ensures consistent code formatting throughout the codebase. Spotless automatically enforces predefined code formatting rules, eliminating the need for manual formatting and reducing the likelihood of stylistic inconsistencies. This adherence to uniform code styling not only enhances readability but also streamlines code reviews and maintenance tasks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Springboot Layout<\/h2>\n\n\n\n<p>In a Spring Boot project, the package layout typically starts at the application level, often referred to as the root package or base package. This package serves as the entry point for the application and contains the main class annotated with <code>@SpringBootApplication<\/code>. From this root package, sub-packages are organized based on different components and functionalities of the application.<\/p>\n\n\n\n<p>Here&#8217;s a breakdown of the package layout:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Application Level (Root Package)<\/strong>:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>com.example.springboot<\/code><\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Sub-packages<\/strong>:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>config<\/strong>: Contains configuration classes for Spring beans, security configurations, database configurations, etc.<\/li>\n\n\n\n<li><strong>controller<\/strong>: Houses Spring MVC controllers responsible for handling HTTP requests and responses.<\/li>\n\n\n\n<li><strong>dto<\/strong>: Contains Data Transfer Objects (DTOs) used for transferring data between layers or components.<\/li>\n\n\n\n<li><strong>handlers<\/strong>: Contains exception handlers for handling application-specific exceptions.<\/li>\n\n\n\n<li><strong>models<\/strong>: Houses domain model classes representing entities within the application.<\/li>\n\n\n\n<li><strong>repository<\/strong>: Houses repository interfaces or classes responsible for database interaction (e.g., Spring Data JPA repositories).<\/li>\n\n\n\n<li><strong>security<\/strong>: Contains classes related to security configurations, authentication, authorization, etc.<\/li>\n\n\n\n<li><strong>service<\/strong>: Contains service interfaces defining business logic contracts.<\/li>\n\n\n\n<li><strong>service.impl<\/strong>: Contains implementations of service interfaces.<\/li>\n\n\n\n<li><strong>utils<\/strong>: Holds utility classes and helper methods used across the application.<\/li>\n<\/ul>\n\n\n\n<p>Here&#8217;s how the directory layout might look based on the package structure outlined above:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>src\n\u2514\u2500\u2500 main\n    \u251c\u2500\u2500 java\n    \u2502   \u2514\u2500\u2500 com\n    \u2502       \u2514\u2500\u2500 example\n    \u2502           \u2514\u2500\u2500 springboot\n    \u2502               \u251c\u2500\u2500 Application.java\n    \u2502               \u251c\u2500\u2500 config\n    \u2502               \u2502   \u2514\u2500\u2500 AppConfig.java\n    \u2502               \u251c\u2500\u2500 controller\n    \u2502               \u2502   \u2514\u2500\u2500 UserController.java\n    \u2502               \u251c\u2500\u2500 dto\n    \u2502               \u2502   \u2514\u2500\u2500 UserDTO.java\n    \u2502               \u251c\u2500\u2500 handlers\n    \u2502               \u2502   \u2514\u2500\u2500 GlobalExceptionHandler.java\n    \u2502               \u251c\u2500\u2500 models\n    \u2502               \u2502   \u2514\u2500\u2500 User.java\n    \u2502               \u251c\u2500\u2500 repository\n    \u2502               \u2502   \u2514\u2500\u2500 UserRepository.java\n    \u2502               \u251c\u2500\u2500 security\n    \u2502               \u2502   \u2514\u2500\u2500 SecurityConfig.java\n    \u2502               \u251c\u2500\u2500 service\n    \u2502               \u2502   \u2514\u2500\u2500 UserService.java\n    \u2502               \u2502   \u2514\u2500\u2500 impl\n    \u2502               \u2502       \u2514\u2500\u2500 UserServiceImpl.java\n    \u2502               \u2514\u2500\u2500 utils\n    \u2502                   \u2514\u2500\u2500 StringUtil.java\n    \u2514\u2500\u2500 resources\n        \u251c\u2500\u2500 application.properties\n        \u2514\u2500\u2500 ...\n<\/code><\/pre>\n\n\n\n<p>This directory layout provides a clear and organized structure for different components of the Spring Boot application, making it easier for developers to navigate, understand, and maintain the codebase.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Coding standards are the unsung heroes of software development, quietly shaping the backbone of every successful project. Like the grammar rules of a language, they provide a common set of guidelines that developers adhere to when writing code. From indentation styles to variable naming conventions, coding standards ensure consistency, readability, and maintainability across a codebase. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3484,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[363],"tags":[],"series":[],"class_list":["post-3480","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-architecture"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/04\/computer-6560745_640.jpg?fit=640%2C298&ssl=1","jetpack-related-posts":[{"id":3970,"url":"https:\/\/www.mymiller.name\/wordpress\/architecture\/vibe-coding-the-next-generation-how-we-built-aimud-using-an-ai-ensemble\/","url_meta":{"origin":3480,"position":0},"title":"Vibe Coding the Next Generation: How We Built AIMUD Using an AI Ensemble","author":"Jeffery Miller","date":"April 21, 2026","format":false,"excerpt":"In the traditional world of software engineering, building a Multi-User Dungeon (MUD) is a rite of passage. It requires handling complex state, real-time networking, concurrency, and deep game logic. Usually, this takes months of meticulous, line-by-line keyboard grinding. But for AIMUD, we didn't just code; we vibe coded. By leveraging\u2026","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/www.mymiller.name\/wordpress\/category\/ai\/"},"img":{"alt_text":"","src":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_6veptk6veptk6vep-scaled.avif","width":350,"height":200,"srcset":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_6veptk6veptk6vep-scaled.avif 1x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_6veptk6veptk6vep-scaled.avif 1.5x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_6veptk6veptk6vep-scaled.avif 2x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_6veptk6veptk6vep-scaled.avif 3x"},"classes":[]},{"id":2409,"url":"https:\/\/www.mymiller.name\/wordpress\/lambda_stream\/java-getter-setter-used-as-lamdas\/","url_meta":{"origin":3480,"position":1},"title":"Java getter\/setter used as Lamda&#8217;s","author":"Jeffery Miller","date":"December 23, 2025","format":false,"excerpt":"Once again I'm looking into ways to make coding so much easier. I needed to be able to pass in a Class::get and a Class:set as a Lamda in order to be able to reuse code across types. It's a rather simple process. However I have not found it really\u2026","rel":"","context":"In &quot;Lambda's and Streams&quot;","block_context":{"text":"Lambda's and Streams","link":"https:\/\/www.mymiller.name\/wordpress\/category\/lambda_stream\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2018\/10\/coffee-cup-2317201_640.jpg?fit=640%2C426&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2018\/10\/coffee-cup-2317201_640.jpg?fit=640%2C426&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2018\/10\/coffee-cup-2317201_640.jpg?fit=640%2C426&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3922,"url":"https:\/\/www.mymiller.name\/wordpress\/spng_security\/beyond-rbac-spring-security-6-oauth-2-1-and-the-zero-trust-evolution\/","url_meta":{"origin":3480,"position":2},"title":"Beyond RBAC: Spring Security 6, OAuth 2.1, and the Zero-Trust Evolution","author":"Jeffery Miller","date":"November 19, 2025","format":false,"excerpt":"The journey to Zero Trust (ZT) is an ongoing architectural evolution, not a single deployment. While the foundational principles\u2014never trust, always verify\u2014are clear, implementing them in a distributed microservice environment requires rigorous adherence to modern standards. For Spring architects and developers, Spring Security 6 and the Spring Authorization Server provide\u2026","rel":"","context":"In &quot;Spring Security&quot;","block_context":{"text":"Spring Security","link":"https:\/\/www.mymiller.name\/wordpress\/category\/spng_security\/"},"img":{"alt_text":"","src":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2025\/11\/coding-1841550_1280.avif","width":350,"height":200,"srcset":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2025\/11\/coding-1841550_1280.avif 1x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2025\/11\/coding-1841550_1280.avif 1.5x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2025\/11\/coding-1841550_1280.avif 2x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2025\/11\/coding-1841550_1280.avif 3x"},"classes":[]},{"id":3533,"url":"https:\/\/www.mymiller.name\/wordpress\/spring_aop\/spring-aop-in-action\/","url_meta":{"origin":3480,"position":3},"title":"Spring AOP in Action","author":"Jeffery Miller","date":"April 20, 2026","format":false,"excerpt":"Spring AOP empowers you to conquer a common challenge in object-oriented programming: managing cross-cutting concerns. These are functionalities that span multiple parts of your application, like logging, security, and transaction management. By scattering this code throughout your application, you introduce complexity and hinder maintainability. Spring AOP offers a solution through\u2026","rel":"","context":"In &quot;Spring AOP&quot;","block_context":{"text":"Spring AOP","link":"https:\/\/www.mymiller.name\/wordpress\/category\/spring_aop\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/05\/ai-generated-8041774_640.jpg?fit=640%2C479&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/05\/ai-generated-8041774_640.jpg?fit=640%2C479&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/05\/ai-generated-8041774_640.jpg?fit=640%2C479&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3944,"url":"https:\/\/www.mymiller.name\/wordpress\/spring\/spring4\/goodbye-resilience4j-native-fault-tolerance-in-spring-boot-4\/","url_meta":{"origin":3480,"position":4},"title":"Goodbye Resilience4j? Native Fault Tolerance in Spring Boot 4","author":"Jeffery Miller","date":"December 18, 2025","format":false,"excerpt":"For years, the standard advice for building resilient Spring Boot microservices was simple: add Resilience4j. It became the Swiss Army knife for circuit breakers, rate limiters, and retries. However, with the release of Spring Boot 4, the landscape has shifted. The framework now promotes a \"batteries-included\" philosophy for fault tolerance.\u2026","rel":"","context":"In &quot;Spring4&quot;","block_context":{"text":"Spring4","link":"https:\/\/www.mymiller.name\/wordpress\/category\/spring\/spring4\/"},"img":{"alt_text":"","src":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2025\/12\/iduino-uno-r3b-1699990_1280.avif","width":350,"height":200,"srcset":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2025\/12\/iduino-uno-r3b-1699990_1280.avif 1x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2025\/12\/iduino-uno-r3b-1699990_1280.avif 1.5x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2025\/12\/iduino-uno-r3b-1699990_1280.avif 2x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2025\/12\/iduino-uno-r3b-1699990_1280.avif 3x"},"classes":[]},{"id":3737,"url":"https:\/\/www.mymiller.name\/wordpress\/java_new_features\/java-23-is-here-exploring-the-full-release-and-incubator-features\/","url_meta":{"origin":3480,"position":5},"title":"Java 23 is Here: Exploring the Full Release and Incubator Features","author":"Jeffery Miller","date":"December 23, 2025","format":false,"excerpt":"Java 23 arrived in September 2023 with a range of new features and improvements. While it may not be a Long-Term Support (LTS) release, it offers some exciting additions worth exploring. In this blog post, we\u2019ll dive into the full release features of Java 23, providing clear explanations and practical\u2026","rel":"","context":"In &quot;Java New Features&quot;","block_context":{"text":"Java New Features","link":"https:\/\/www.mymiller.name\/wordpress\/category\/java_new_features\/"},"img":{"alt_text":"","src":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/immune-defense-1359197_1280-jpg.avif","width":350,"height":200,"srcset":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/immune-defense-1359197_1280-jpg.avif 1x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/immune-defense-1359197_1280-jpg.avif 1.5x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/immune-defense-1359197_1280-jpg.avif 2x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/immune-defense-1359197_1280-jpg.avif 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts\/3480","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/comments?post=3480"}],"version-history":[{"count":2,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts\/3480\/revisions"}],"predecessor-version":[{"id":3482,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts\/3480\/revisions\/3482"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/media\/3484"}],"wp:attachment":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/media?parent=3480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/categories?post=3480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/tags?post=3480"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/series?post=3480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}