
عنوان:
Data-Oriented Programming
نویسنده:
Yehonathan Sharvit
انتشارات:
Manning Publications City
تاریخ انتشار:
2022
حجم:
7.1MB
معرفی کتاب:" برنامهنویسی دادهمحور: کاهش پیچیدگی از طریق بازنگری دادهها – نسخه اول "
پیچیدگی اجتنابناپذیر طراحیهای شیءگرا را از بین ببرید.
پارادایم نوآورانهی برنامهنویسی دادهمحور (Data-Oriented Programming یا DOP) با سادهتر کردن دسترسی و پردازش دادهها، سیستمهای شما را کمتر پیچیده میکند.
در کتاب برنامهنویسی دادهمحور خواهید آموخت که چگونه:
- کد را از داده جدا کنید
- داده را با ساختارهای دادهای عمومی (generic) نمایش دهید
- داده را با توابع عمومی و چندمنظوره پردازش کنید
- حالت (state) را بدون تغییر مستقیم داده مدیریت کنید
- همزمانی (concurrency) را در سیستمهای بسیار مقیاسپذیر کنترل کنید
- تستهای واحد (unit tests) دادهمحور بنویسید
- شکل و ساختار دادههای خود را مشخص کنید
- بدون استفاده از اشیاء، از چندریختی (polymorphism) بهرهمند شوید
- بدون استفاده از دیباگر (debugger)، برنامهها را اشکالزدایی کنید
برنامهنویسی دادهمحور یک راهنمای منحصربهفرد است که پارادایم دادهمحور را معرفی میکند. این رویکرد انقلابی دادهها را با ساختارهای دادهای عمومی و تغییرناپذیر (immutable) نمایش میدهد. این روش مدیریت حالت را ساده میکند، همزمانی را آسانتر میسازد، و مشکلات رایج کدهای شیءگرا را از بین میبرد. کتاب ایدههای قدرتمند جدید را از طریق گفتگوها، قطعهکدها و نمودارهایی ارائه میدهد که به شما کمک میکند به سرعت جذابیت DOP را درک کنید. بهترین بخش ماجرا این است که این پارادایم مستقل از زبان برنامهنویسی است—یعنی یاد میگیرید کد دادهمحور بنویسید که میتواند در زبانهایی مانند JavaScript، Ruby، Python، Clojure و حتی زبانهای شیءگرای سنتی مانند Java یا #C پیادهسازی شود.
درباره فناوری
کدی که رفتار (behavior) و داده را با هم ترکیب میکند—همانطور که در طراحیهای شیءگرا رایج است—میتواند پیچیدگی تقریباً غیرقابلمدیری را برای مدیریت حالت ایجاد کند. پارادایم برنامهنویسی دادهمحور (DOP) مدیریت حالت را با نگهداری دادههای برنامه در ساختارهای دادهای عمومی و تغییرناپذیر، و انجام محاسبات با استفاده از توابع عمومی و بدون تغییر مستقیم داده، ساده میکند. نتیجه این است که برنامههای شما از خطاهای مرتبط با حالت خالی میشوند و کدتان قابلفهمتر و نگهداری آن آسانتر میشود.
درباره کتاب
برنامهنویسی دادهمحور به شما آموزش میدهد که چگونه با استفاده از این پارادایم انقلابی، نرمافزار طراحی کنید. شما DOP را در عمل به کار میگیرید تا مدلهای دادهای برای موجودیتهای تجاری طراحی کنید و یک سیستم مدیریت کتابخانه بسازید که حالت را بدون تغییر مستقیم داده مدیریت میکند. نمودارهای متعدد، نقشههای ذهنی شهودی و سبک منحصربهفرد روایی کتاب، به شما کمک میکنند این ایدههای نو را بهخوبی درک کنید. در هر فصل، یک «لحظه چراغ روشن» (lightbulb moment) وجود دارد که طرز فکر شما نسبت به برنامهنویسی را تغییر خواهد داد.
آنچه در کتاب خواهید یافت
- جدا کردن کد از داده
- نمایش داده با ساختارهای دادهای عمومی
- مدیریت حالت بدون تغییر مستقیم داده
- کنترل همزمانی در سیستمهای بسیار مقیاسپذیر
- نوشتن تستهای واحد دادهمحور
- مشخص کردن شکل و ساختار دادهها
مخاطبان کتاب
این کتاب برای برنامهنویسانی است که با یک زبان برنامهنویسی سطحبالا مانند JavaScript، Java، Python، C#، Clojure یا Ruby تجربه دارند.
درباره نویسنده
Yehonathan Sharvit بیش از بیست سال تجربه به عنوان مهندس نرمافزار دارد. او در کنفرانسها سخنرانی میکند، وبلاگ مینویسد و کارگاههای آموزشی برنامهنویسی دادهمحور را در سراسر جهان برگزار میکند.
فهرست مطالب
- Data-Oriented Programming
- brief contents
- contents
- forewords
- preface
- acknowledgments
- about this book
- about the author
- about the cover illustration
- dramatis personae
- Part 1—Flexibility
- Chapter 1: Complexity of object- oriented programming
- 1.1 OOP design: Classic or classical?
- 1.2 Sources of complexity
- Summary
- Chapter 2: Separation between code and data
- 2.1 The two parts of a DOP system
- 2.2 Data entities
- 2.3 Code modules
- 2.4 DOP systems are easy to understand
- 2.5 DOP systems are flexible
- Summary
- Chapter 3: Basic data manipulation
- 3.1 Designing a data model
- 3.2 Representing records as maps
- 3.3 Manipulating data with generic functions
- 3.4 Calculating search results
- 3.5 Handling records of different types
- Summary
- Chapter 4: State management
- 4.1 Multiple versions of the system data
- 4.2 Structural sharing
- 4.3 Implementing structural sharing
- 4.4 Data safety
- 4.5 The commit phase of a mutation
- 4.6 Ensuring system state integrity
- 4.7 Restoring previous states
- Summary
- Chapter 5: Basic concurrency control
- 5.1 Optimistic concurrency control
- 5.2 Reconciliation between concurrent mutations
- 5.3 Reducing collections
- 5.4 Structural difference
- 5.5 Implementing the reconciliation algorithm
- Summary
- Chapter 6: Unit tests
- Part 2—Scalability
- Chapter 7: Basic data validation
- 7.1 Data validation in DOP
- 7.2 JSON Schema in a nutshell
- 7.3 Schema flexibility and strictness
- 7.4 Schema composition
- 7.5 Details about data validation failures
- Summary
- Chapter 8: Advanced concurrency control
- 8.1 The complexity of locks
- 8.2 Thread-safe counter with atoms
- 8.3 Thread-safe cache with atoms
- 8.4 State management with atoms
- Summary
- Chapter 9: Persistent data structures
- 9.1 The need for persistent data structures
- 9.2 The efficiency of persistent data structures
- 9.3 Persistent data structures libraries
- 9.4 Persistent data structures in action
- Summary
- Chapter 10: Database operations
- 10.1 Fetching data from the database
- 10.2 Storing data in the database
- 10.3 Simple data manipulation
- 10.4 Advanced data manipulation
- Summary
- Chapter 11: Web services
- 11.1 Another feature request
- 11.2 Building the insides like the outsides
- 11.3 Representing a client request as a map
- 11.4 Representing a server response as a map
- 11.5 Passing information forward
- 11.6 Search result enrichment in action
- Delivering on time
- Summary
- Part 3—Maintainability
- Chapter 12: Advanced data validation
- 12.1 Function arguments validation
- 12.2 Return value validation
- 12.3 Advanced data validation
- 12.4 Automatic generation of data model diagrams
- 12.5 Automatic generation of schema-based unit tests
- 12.6 A new gift
- Summary
- Chapter 13: Polymorphism
- 13.1 The essence of polymorphism
- 13.2 Multimethods with single dispatch
- 13.3 Multimethods with multiple dispatch
- 13.4 Multimethods with dynamic dispatch
- 13.5 Integrating multimethods in a production system
- Summary
- Chapter 14: Advanced data manipulation
- 14.1 Updating a value in a map with eloquence
- 14.2 Manipulating nested data
- 14.3 Using the best tool for the job
- 14.4 Unwinding at ease
- Summary
- Chapter 15: Debugging
- 15.1 Determinism in programming
- 15.2 Reproducibility with numbers and strings
- 15.3 Reproducibility with any data
- 15.4 Unit tests
- 15.5 Dealing with external data sources
- Farewell
- Summary
- Appendix A—Principles of data-oriented programming
- Appendix B—Generic data access in statically-typed languages
- Appendix C—Data-oriented programming: A link in the chain of programming paradigms
- Appendix D—Lodash reference
- index
مشخصات
نام کتاب
Data-Oriented Programming
نویسنده
Yehonathan Sharvit
انتشارات
Manning Publications
تاریخ انتشار
2022
ISBN
9781617298578
تعداد صفحات
426
زبان
انگلیسی
فرمت
حجم
7.1MB
موضوع
Software Engineering; Databases; Debugging; Data Structures; Concurrency; Object-Oriented Programming