وبلاگ بلیان

Practical Scala DSLs : Real-World Applications Using Domain Specific Languages

معرفی کتاب «Practical Scala DSLs : Real-World Applications Using Domain Specific Languages» نوشتهٔ Pierluigi Riti (auth.)، منتشرشده توسط نشر Apress : Imprint : Apress در سال 2018. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.

Build domain specific languages (DSLs) using Java's most popular functional programming language: Scala. This book introduces the basics of Scala and DSLs using a series of practical examples. In __Practical Scala DSLs__, you’ll learn to create pragmatic and complete code examples that explain the actual use of DSLs with Scala: a web API and microservices; a custom language; a mobile app; a Forex system; a game; and cloud applications. At the end of this unique book, you’ll be able to describe the differences between external and internal DSLs; understand when and how to apply DSLs; create DSLs using Scala; and even create a DSL using another programming language.**What You'll Learn** * Build DSLs in Scala * Write a web API and microservices * Create a custom language * Apply DSLs to mobile apps development, a Forex trading system, game development, and more * Discover the role of DSLs in cloud development * Integrate DSLs as part of a DevOps program or structure * Build internal and external DSLs **Who This Book Is For**Experienced Java coders with at least some prior experience with Scala. You may be new to DSLs. Table of Contents 5 About the Author 10 About the Technical Reviewer 11 Introduction 12 Chapter 1: Introduction to Scala 13 Basic Syntax 14 Variable and Value in Scala 15 Naming in Scala 17 First Example in Scala 17 Define a Method and Function in Scala 18 Classes in Scala 20 Singleton Object 21 Types in Scala 22 Converting Numeric Types 22 String in Scala 23 Multiline String 24 String Interpolation 25 Expressions in Scala 26 Conditional Expression 28 Pattern Matching Expression 28 Multiple Conditions 29 Pattern Guard 31 Range and Loop 32 Other Loops 34 Data Structures 36 Array 36 List 37 Set 38 Tuple 38 Map 39 Summary 40 Chapter 2: Introduction to DSL 41 Definition of DSL 41 Difference Between Internal and External DSLs 42 Designing a Good DSL 43 Analyze the Domain 44 Creating a Common Dictionary 46 Sample DSLs 47 DSL Goals 48 Implementing a DSL 50 Grammar and Data Parsing 52 First DSL Implementation 53 Common DSL Patterns 54 Conclusion 55 Chapter 3: Internal DSL 56 Creating an Internal DSL 56 Method Chaining 57 Creating a Fluent Interface 59 Designing the Parsing Layer 62 Design the Parsing Layer Using Functions 65 Conclusion 68 Chapter 4: External DSL 69 Internal DSLs vs. External DSLs 69 Grammar and Syntax 70 Creating an External DSL 72 Producing the Output 75 What Is a Parser? 76 What Style of DSL to Use 78 Conclusion 79 Chapter 5: Web API and μService 80 What Is a μService 80 Communication 84 The Team 86 Innovation 86 When to Use Microservices 87 REST Architecture 88 Designing Microservices in Scala 92 Installing the Play Framework 92 Designing the REST Microservice 95 Creating a Microservice in Play 96 Our Own DSL Microservice 98 Conclusion 104 Chapter 6: User Recognition System 106 Grammar 107 Scala Parser Combinator Library 108 A Simple Sample Parser 110 Defining a Domain Problem and the Grammar 112 Preparing the Parser 114 Describing the Parser 116 Improving the JSON Parser 117 Conclusion 121 Chapter 7: Creating a Custom Language 122 What Is a “Language”? 123 Patterns for Designing a Language 124 Designing the Language 130 Creating the Language 132 Creating the Reader Class 132 Defining the Token 139 Creating the Translator for the Language 141 Executing the Language 145 Conclusion 146 Chapter 8: Mobile Development 147 Introduction to Mobile Development in Android 147 Starting with Android Development 148 Anatomy of an Android Application 152 Our First Scala-Android Application 155 Creating Services in Android 161 Defining Our DSLs 163 Conclusion 166 Chapter 9: Forex Trading System 167 What Is a Forex Trading System? 167 Designing the DSL System 169 Implementing the System 171 Improving the Basic Class 173 Creating the Order 174 Why It Is Important to Design a Good API 175 Designing the New DSL API 177 Consuming the First API 180 Improving the API 180 Adding the Last Functionality 182 Conclusion 187 Chapter 10: Game Development 188 Game Team Structure 188 Engineering Team 189 Artist Team 190 Other Actors Involved 191 Producer 191 Marketing and Customer Service 191 Game Designer 191 Definition of a Game Engine 191 Designing Our New DSL Game Engine 193 Defining the Generic Component 195 Other Components 207 Conclusion 214 Chapter 11: Cloud and DevOps 215 What Is DevOps? 215 Common DevOps Practice 217 Start with AWS 218 Deployment and Build in AWS 220 Creating the Project in AWS 221 Creating the Basic Files 222 Creating the Build File 224 Final Conclusion 226 Index 227 Build domain specific languages (DSLs) using Java's most popular functional programming language: Scala. This book introduces the basics of Scala and DSLs using a series of practical examples. In Practical Scala DSLs, you’ll learn to create pragmatic and complete code examples that explain the actual use of DSLs with Scala: a web API and microservices; a custom language; a mobile app; a Forex system; a game; and cloud applications. At the end of this unique book, you’ll be able to describe the differences between external and internal DSLs; understand when and how to apply DSLs; create DSLs using Scala; and even create a DSL using another programming language. What You'll Learn Build DSLs in Scala Write a web API and microservices Create a custom language Apply DSLs to mobile apps development, a Forex trading system, game development, and more Discover the role of DSLs in cloud development Integrate DSLs as part of a DevOps program or structure Build internal and external DSLs Who This Book Is For Experienced Java coders with at least some prior experience with Scala. You may be new to DSLs. Build domain specific languages (DSLs) using Java's most popular functional programming language: Scala. This book introduces the basics of Scala and DSLs using a series of practical examples. In each chapter of Practical Scala DSLs, you'll learn to create pragmatic and complete code examples that explain the actual use of DSLs with Scala: a web API and microservices; a custom language; a mobile app; a Forex system; a game; and cloud applications. At the end of this unique book, you'll be able to describe the differences between external and internal DSLs; understand when and how to apply DSLs; create DSLs using Scala; and even create a DSL using another programming language. You will: Build DSLs in Scala Write a web API and microservices Create a custom language Apply DSLs to mobile apps development, a Forex trading system, game development, and more Discover the role of DSLs in cloud development Integrate DSLs as part of a DevOps program or structure Build internal and external DSLs Front Matter ....Pages i-xv Introduction to Scala (Pierluigi Riti)....Pages 1-28 Introduction to DSL (Pierluigi Riti)....Pages 29-43 Internal DSL (Pierluigi Riti)....Pages 45-57 External DSL (Pierluigi Riti)....Pages 59-69 Web API and μService (Pierluigi Riti)....Pages 71-96 User Recognition System (Pierluigi Riti)....Pages 97-112 Creating a Custom Language (Pierluigi Riti)....Pages 113-137 Mobile Development (Pierluigi Riti)....Pages 139-158 Forex Trading System (Pierluigi Riti)....Pages 159-179 Game Development (Pierluigi Riti)....Pages 181-207 Cloud and DevOps (Pierluigi Riti)....Pages 209-220 Back Matter ....Pages 221-226
دانلود کتاب Practical Scala DSLs : Real-World Applications Using Domain Specific Languages