- عنوان کتاب: Java Real World Projects, A pragmatic guide for building modern Java applications
- نویسنده: Davi Vieira
- حوزه: برنامه نویسی جاوا
- سال انتشار: 2025
- تعداد صفحه: 407
- زبان اصلی: انگلیسی
- نوع فایل: pdf
- حجم فایل: 4.59 مگابایت
پس از گذشت سالهای بسیار از اولین انتشارش، جاوا همچنان با قدرت بخشیدن به حیاتیترین برنامهها در سازمانهایی با هر اندازهای، همچنان مرتبط باقی مانده است. دیدن برنامههای جاوا که هنوز ده، بیست سال پیش یا بیشتر اجرا میشوند، غیرمعمول نیست، که گواهی بر ماهیت قوی و قابل اعتماد جاوا است. از سوی دیگر، جاوا همچنان زبان انتخابی بسیاری از پروژههای جدید است که از نعمت انتخاب از بین مجموعهای از چارچوبهای با کیفیت بالا مانند Spring Boot، Quarkus یا Jakarta EE، که نوآوری را تقویت میکنند و زبان جاوا را برای مقابله با چالشهای توسعه نرمافزار مدرن در عصر ابر و هوش مصنوعی تازه نگه میدارند، برخوردارند. هیچوقت زمان بهتری برای عضویت در چنین اکوسیستم فناوری هیجانانگیزی وجود نداشته است، که فرصتهای بیپایانی را برای تأثیرگذاری بر زندگی دیگران از طریق نرمافزار ارائه میدهد. بر اساس این چشمانداز از فرصتها و نوآوریها، این کتاب برای کسانی نوشته شده است که تصمیم میگیرند با پیچیدگیها، ابهامات و سختیهایی که ممکن است از هر پروژه جدی جاوا ناشی شود، روبرو شوند. قرار نیست این کتاب یک راهنمای جامع برای زبان برنامهنویسی جاوا باشد؛ در عوض، از دیدگاه نویسنده، رویکردی عملگرایانه در تأکید بر ویژگیهای مرتبط جاوا و هر چیزی که مربوط به تولید نرمافزار آماده برای تولید است، اتخاذ میکند. این کتاب با بررسی اصول جاوا، اجزای اصلی API جاوا را که برای مدیریت کارآمد ساختارهای داده، فایلها، استثنائات، گزارشها و سایر عناصر ضروری موجود در اکثر برنامههای کاربردی سازمانی جاوا استفاده میشوند، مورد بررسی مجدد قرار میدهد. همچنین بررسی میکند که چگونه میتوان از ویژگیهای مدرن جاوا مانند کلاسهای مهر و موم شده، تطبیق الگو، الگوهای رکورد و نخهای مجازی برای ایجاد سیستمهای نرمافزاری که بهترین آنچه جاوا ارائه میدهد را استخراج میکنند، استفاده کرد. این کتاب تکنیکهایی را برای مدیریت کارآمد پایگاههای داده رابطهای با بهرهگیری از اتصال پایگاه داده جاوا (JDBC) و APIهای پایداری جاکارتا (JPA) ارائه میدهد و در نتیجه یک پایه محکم برای مدیریت دادههای جاوا فراهم میکند. با این حال، در زمینه اصول جاوا، به بررسی چگونگی افزایش کیفیت کلی کد با استفاده از تستهای واحد و ادغام میپردازد. پس از پوشش اصول جاوا، این کتاب بررسی میکند که چگونه میتوان از چارچوبهای توسعه نرمافزار قابل اعتماد مانند Spring Boot، Quarkus و Jakarta EE برای توسعه برنامههای کاربردی مبتنی بر اصول توسعهدهنده پسند و بهرهوری استفاده کرد. این چارچوبها با قادر ساختن توسعهدهنده جاوا به استفاده از فناوری پیشرفته و استانداردهای صنعتی که اساس اکثر برنامههای مهم back-end هستند، به او قدرت میدهند. این کتاب با نگاهی به چالش روزمره اجرای قابل اعتماد برنامههای جاوا در محیط تولید، تکنیکهای ضروری نظارت و مشاهدهپذیری را شرح میدهد که به توسعهدهنده جاوا کمک میکند تا درک بهتری از عملکرد برنامه خود در شرایط مختلف و اغلب غیرمنتظره داشته باشد و توسعهدهنده را در موقعیتی فعالتر از واکنشی در مواجهه با تنگناها، مقیاسپذیری و هر مسئله دیگری که میتواند خطری برای در دسترس بودن برنامه باشد، قرار دهد. این کتاب با بررسی چگونگی نقش ایدههای مختلف معماری نرمافزار، مانند طراحی مبتنی بر دامنه (DDD)، معماری لایهای و معماری شش ضلعی، در توسعه برنامههای کاربردی قابل تحمل در برابر تغییر و قابل نگهداری که نه تنها آنچه مشتری میخواهد را ارائه میدهند، بلکه پایههای محکمی را ایجاد میکنند که توسعهدهندگان را قادر میسازد تا تغییرات کد را با ظرافت و با کاهش تلاشهای refactoring معرفی کنند، به پایان میرسد. فصل 1: بازنگری API جاوا – این فصل APIهای اصلی و ضروری جاوا را که معمولاً در پروژههای دنیای واقعی دیده میشوند، بازنگری میکند. این فصل با بررسی ساختارهای دادهی Collections API آغاز میشود و روشهای ممکن برای مدیریت دادهها به عنوان اشیاء در سیستمهای جاوا را نشان میدهد. با توجه به اینکه چند وقت یکبار باید با فایلها سروکار داشته باشیم، این فصل نحوهی دستکاری فایلها با استفاده از NIO2 را نشان میدهد. بررسی دقیقتر استثنائات، و به دنبال آن Logging API، پایهی محکمی برای مدیریت مفید خطا و مدیریت پیشرفتهی Logging فراهم میکند. از آنجایی که اکثر برنامههای جاوا به نحوی نیاز به کار با تاریخ و زمان دارند، Data-Time API نیز بررسی میشود. در پایان فصل، ویژگیهای برنامهنویسی تابعی مانند streamها و lambdaها پوشش داده میشوند تا نحوهی نوشتن کد جاوا کارآمدتر و مختصرتر نشان داده شود. فصل 2: بررسی ویژگیهای مدرن جاوا – جاوا دائماً در حال تغییر است. بنابراین، بهروز بودن با ویژگیهای جدید آن ضروری است. این فصل به قابلیتهای مدرن جاوا میپردازد که توسعهدهندگان میتوانند از آنها برای ساخت برنامههای قوی با ویژگیهای پیچیدهی زبان استفاده کنند. این فصل با توضیح نحوهی استفاده از کلاسهای مهر و موم شده برای افزایش کنترل وراثت شروع میشود. این فصل یک روش شهودی برای تطبیق انواع جاوا با تطبیق الگو و استفاده از الگوهای رکورد برای استخراج دادهها از انواع تطبیق یافته ارائه میدهد. در نهایت، نشان میدهد که چگونه توسعهی برنامههای همزمان را با نخهای مجازی سادهسازی کنیم. فصل 3: مدیریت پایگاههای داده رابطهای با جاوا – توانایی برقراری ارتباط کارآمد با پایگاههای داده، یک ویژگی حیاتی برنامههای جاوا است که نیاز به پایداری دارند.
After so many years since its first release, Java remains as relevant as ever by powering the most critical applications in enterprises of all sizes. It is not uncommon to see Java applications still running ten, twenty, or more years ago, which serves as a testament to Java’s robust and reliable nature. On the other side of the coin, Java continues to be the language of choice for many new projects that have the luxury of choosing from a set of high-quality frameworks like Spring Boot, Quarkus, or Jakarta EE, to name a few, that foster innovation and keep the Java language fresh to tackle the challenges of modern software development in the age of cloud and artificial intelligence. There has never been a better time to be part of such an exciting technological ecosystem, which offers endless opportunities to impact other people’s lives through software. Based on this landscape of opportunities and innovations, this book was written for those who decide to face the complexities, ambiguities, and hardships that may derive from any serious Java project. It is not meant to be a comprehensive guide for the Java programming language; instead, it takes a pragmatic approach in emphasizing, from the author’s perspective, the relevant Java features and anything related to producing production-ready software. Starting with exploring Java fundamentals, this book revisits core Java API components used to efficiently handle data structures, files, exceptions, logs, and other essential elements found in most enterprise Java applications. It also examines how modern Java features such as sealed classes, pattern matching, record patterns, and virtual threads can be used to create software systems that extract the best of what Java can provide. This book presents techniques for efficiently handling relational databases by tapping into the Java Database Connectivity (JDBC) and Jakarta Persistence APIs (JPA), thereby providing a solid Java data handling foundation. Still, in the context of Java fundamentals, it explores how to increase overall code quality by employing unit and integration tests. After covering the Java Fundamentals, this book explores how reliable software development frameworks such as Spring Boot, Quarkus, and Jakarta EE can be used to develop applications based on developer-friendly and productivity principles. These frameworks empower the Java developer by enabling him to use cutting-edge technology and industry standards that are the basis for most critical back-end applications. With an eye on the everyday challenge of keeping Java applications running reliably in production, this book describes essential monitoring and observability techniques that help the Java developer better understand how well its application is behaving under different and quite often unexpected circumstances, putting the developer in a more pro-active than reactive position when dealing with bottlenecks, scalability and any other issue that can represent a risk for the application availability. It concludes with an exploration of how different software architecture ideas, such as domain-driven design (DDD), layered architecture, and hexagonal architecture, can play crucial roles in developing change-tolerable and maintainable applications that not only deliver what the customer wants but also establish solid foundations that enable developers to gracefully introduce code changes with reduced refactoring efforts. Chapter 1: Revisiting the Java API – This chapter revisits essential core Java APIs commonly seen in real-world projects. It starts by exploring the Collections API’s data structures, showing the possible ways to handle data as objects in Java systems. Considering how often files must be dealt with, this chapter shows how to manipulate files using the NIO2. A closer examination of exceptions, followed by the Logging API, provides a solid foundation for helpful error handling and enhanced logging management. As most Java applications somehow need to deal with date and time, the Data-Time API is also explored. Closing the chapter, functional programming features such as streams and lambdas are covered to show how to write more efficient and concise Java code. Chapter 2: Exploring Modern Java Features – Java is constantly changing. Therefore, it is essential to keep up to date with its new features. This chapter looks into modern Java capabilities developers can leverage to build robust applications with sophisticated language features. It starts by explaining how to use sealed classes to increase inheritance control. It presents an intuitive way of matching Java types with pattern matching and using record patterns to extract data from matched types. Finally, it shows how to simplify the development of concurrent applications with virtual threads. Chapter 3: Handling Relational Databases with Java – The ability to efficiently communicate with databases is a crucial characteristic of Java applications requiring persistence. Based on this premise, this chapter explores the Java Database Connectivity (JDBC) API, a fundamental Java component for handling relational databases. To enable developers to handle database entities as Java objects, it distills the main features of the Jakarta Persistence. The chapter finishes by examining local development approaches with container-based and inmemory databases for Java. Chapter 4: Preventing Unexpected Behaviors with Tests – Automated tests help to prevent code changes from breaking existing system behaviors. To help developers with such an outcome, this chapter overviews two automated test approaches: unit and integration testing. It explores the reliable and widely used test framework JUnit 5. Finally, it describes how to use Testcontainers to implement reliable integration tests that rely on real systems as test dependencies. Chapter 5: Building Production-Grade Systems with Spring Boot – Regarded as one of the most well-used Java frameworks, Spring Boot has withstood the test of time. So, this chapter explores the fundamental Spring components present in Spring Boot. Such fundamental knowledge leads to an analysis of how to bootstrap a new Spring Boot project and implement a CRUD application with major Spring Boot features. Chapter 6: Improving Developer Experience with Quarkus – In the age of cloud, Quarkus has arisen as a cloud-first Java development framework with the promise of delivering a developer-friendly framework that empowers developers to create cloud-native applications based on the best industry standards and technology. This chapter starts assessing the benefits Quarkus provides, shifting quickly to an explanation that details how to kickstart a new Quarkus project. It then shows how to use well-known Quarkus features to develop a CRUD application, including support for native compilation. Chapter 7: Building Enterprise Applications with Jakarta EE and MicroProfile – Accumulating decades of changes and improvements, the Jakarta EE (formerly Java EE and J2EE) framework still plays a major role in enterprise software development. Relying on Jakarta EE, there is also MicroProfile, a lean framework to develop cloud-native microservices. Focusing on these two frameworks, this chapter starts with an overview of the Jakarta EE development model and its specifications. Then, it jumps to hands-on practice by showing how to start a new Jakarta EE project and develop an enterprise application. Finally, it shows how to create microservices using MicroProfile. Chapter 8: Running Your Application in Cloud-Native Environments – Any serious Java developer must be able to make Java applications extract everything they can and perform well inside cloud environments. That is why this chapter explores cloud technologies, starting with container technologies, including Docker and Kubernetes. It explains how Java applications developed using frameworks like Spring Boot, Quarkus, and Jakarta EE can be properly dockerized to run in containers. Finally, it describes deploying such applications into a Kubernetes cluster. Chapter 9: Learning Monitoring and Observability Fundamentals – Understanding how a Java application behaves in production while being accessed by many users is critical to ensuring the business health of any organization. Considering this concern, this chapter explores what monitoring and observability mean and why they are crucial for production-grade Java systems. It then shows how to implement distributed tracing with Spring Boot and OpenTelemetry. Also, it explains how to handle logs using Elasticsearch, Fluentd, and Kibana. Chapter 10: Implementing Application Metrics with Micrometer – Metrics are essential to answer whether a Java application behaves as expected. Micrometer is a key technology that enables developers to implement metrics that answer those questions. This chapter explains how to use a Micrometer to provide metrics in a Spring Boot application. Chapter 11: Creating Useful Dashboards with Prometheus and Grafana – Visualizing important information regarding an application’s behavior through dashboards can prevent or considerably speed up the resolution of incidents in Java applications. Based on such concern, this chapter examines how to capture application metrics using Prometheus. It then covers the integration between Prometheus and Grafana, two essential monitoring tools. Finally, it shows how to create helpful Grafana dashboards with metrics generated by a Java application and use Alertmanager to trigger alerts based on such metrics. Chapter 12: Solving problems with Domain-driven Design – Based on the premise that the application code can serve as an accurate representation of a problem domain, Domain-driven Design (DDD) proposes a development approach that puts the problem domain as the driving factor that dictates the system’s architecture, resulting in better maintainable software. Considering such maintainability benefits, this chapter starts with a DDD introduction, followed by an analysis of essential ideas like value objects, entities, and specifications. The chapter closes by exploring how to test the domain model produced by a DDD application. Chapter 13: Fast Application Development with Layered Architecture – Enterprises of all sorts rely on back-end Java applications to support their business. The ability to fast deliver such applications is fundamental in a competitive environment. Layered architecture emerged organically among the developer community due to its straightforward approach to organizing application responsibilities into layers. In order to show the layered architecture benefits, this chapter starts with an analysis of the major ideas that comprise such architecture, followed by a closer look into applying layered architecture concepts in the development of a data layer for handling database access, a service layer for providing business rules, and an API layer for exposing system behaviors. Chapter 14: Building Applications with Hexagonal Architecture – The pace at which technologies change in software systems has increased considerably over the last years, creating challenges for those who want to tap into the latest cutting-edge innovations to build the best software possible. However, incorporating new technologies into existing working software may be challenging. That is where hexagonal architecture comes in as a solution to build change-tolerable applications that can receive significant technological changes without major refactoring efforts. With such advantage in mind, this chapter introduces the hexagonal architecture ideas, followed by hands-on guidance explaining the development of a hexagonal system based on the domain, application, and framework hexagons.
این کتاب را میتوانید از لینک زیر بصورت رایگان دانلود کنید:
Download: Java Real World Projects
نظرات کاربران