- عنوان کتاب: Java Generics and Collections – Fundamentals and recommended practices
- نویسنده: Maurice Naftalin
- حوزه: برنامه نویسی جاوا
- سال انتشار: 2025
- تعداد صفحه: 607
- زبان اصلی: انگلیسی
- نوع فایل: pdf
- حجم فایل: 4.17 مگابایت
ویرایش دوم این کتاب، بهروزرسانی جامعی برای جاوا ۲۱ است. از آنجایی که انگیزه اصلی برای نوشتن این کتاب، معرفی مجموعههای توالییافته و تأثیر اولیهی جریانها و لامبداها بود، قبل از شروع کار انتظار داشتم که تغییرات عمدهی مورد نیاز در بخش دوم، عمدتاً در نتیجهی معرفی مجموعههای توالییافته، باشد. با این حال، این یک دست کم گرفتن جدی از تغییراتی بود که جاوا در ۲۰ سال گذشته متحمل شده است: در واقع، اصلاحات زیادی در بخش اول نیز مورد نیاز بود. زبان تغییر کرده است. اکنون از رکوردها، استنتاج نوع متغیر محلی، عبارات تطبیق الگو و انواع عمومی در عبارات مقایسهی نوع پشتیبانی میکند. همچنین، اکثر مثالهای بخش اول نیاز به بهروزرسانی داشتند تا تغییرات در کتابخانههای پلتفرم، از جمله منسوخ شدن فعلی سازندههای عدد صحیح، روشهای استاتیک در رابط Comparator و معرفی مجموعهها و جریانهای غیرقابل تغییر را در نظر بگیرند. انگیزه مهم برای نوشتن ویرایش دوم، ثبت برخی از بینشهای بهدستآمده توسط جامعه جاوا در استفاده از ژنریکها و مجموعهها از سال ۲۰۰۵ بود. این بینشها عمدتاً در یک بخش گذشتهنگر («درباره طراحی ژنریکهای جاوا») و دو فصل جدید مجموعهها گنجانده شدهاند: فصل ۱۷، که راهنماییهایی برای استفاده از چارچوب مجموعهها ارائه میدهد، و فصل ۱۸، که مهمترین – و همچنین بحثبرانگیزترین – تصمیمات زیربنایی انتخابهای انجامشده در طراحی چارچوب را بررسی میکند. علاوه بر این، فصلهای مربوط به شیءسازی (فصل ۵) و ژنریکهای مؤثر (فصل ۷) بهطور اساسی بازنویسی شدهاند، فصل مربوط به الگوهای طراحی حذف شده است، و فصل مربوط به مهاجرت از کد پیش ژنریک به صورت آنلاین بهعنوان ضمیمه برای علاقهمندان فنی و تاریخی در دسترس قرار گرفته است. من مقدمه ویرایش اول را به صورت بهروز شده در انتهای این بخش نگه داشتهام. فکر کردم این ارزشمند است تا بخشی از حس هیجان همراه با مجموعه کاملاً هماهنگ ویژگیهایی که جاوا ۵ با آنها زبان جاوا را به قرن بیست و یکم آورد، منتقل شود.
The second edition of this book is a comprehensive update for Java 21. Since a major impetus for writing it was the introduction of sequenced collections and the earlier impact of streams and lambdas, I expected before starting work that the major changes needed would be in Part II, principally as a result of the introduction of sequenced collections. However, that was a serious underestimate of the changes that Java has undergone in the last 20 years: in fact, many revisions to Part I were also required. The language has changed; it now supports records, local variable type inference, pattern-matching expressions, and generic types in type comparison expressions. Also, most examples in Part I needed updating to take account of changes in the platform libraries, including the current deprecation of the Integer constructors, static methods on the Comparator interface, and the introduction of unmodifiable collections and of streams. An important motivation for writing a second edition was to record some of the insights gained by the Java community in the use of both generics and collections since 2005. These are mainly contained in a retrospective section (“On the Design of Java Generics”) and two new collections chapters: Chapter 17, which provides guidance for use of the Collections Framework, and Chapter 18, which reviews the most crucial— and also the most controversial— decisions underlying the choices made in the design of the framework. In addition, the chapters on reification (Chapter 5) and effective generics (Chapter 7) have been substantially rewritten, the chapter on design patterns has been dropped, and the chapter on migration from pregeneric code has been made available online as an Appendix for technical and historical interest. I have preserved the preface to the first edition, in an updated form, at the end of this section. I thought this was worthwhile to convey some of the sense of excitement that accompanied the finely coordinated collection of features with which Java 5 brought the Java language into the 21st century.
این کتاب را میتوانید از لینک زیر بصورت رایگان دانلود کنید:
Download: Java Generics and Collections
نظرات کاربران