Details

Professional Clojure


Professional Clojure


1. Aufl.

von: Jeremy Anderson, Michael Gaare, Justin Holguín, Nick Bailey, Timothy Pratley

38,99 €

Verlag: Wiley
Format: EPUB
Veröffentl.: 25.05.2016
ISBN/EAN: 9781119267294
Sprache: englisch
Anzahl Seiten: 264

DRM-geschütztes eBook, Sie benötigen z.B. Adobe Digital Editions und eine Adobe ID zum Lesen.

Beschreibungen

<b>Clear, practical Clojure for the professional programmer</b> <p><i>Professional Clojure</i> is the experienced developer's guide to functional programming using the Clojure language. Designed specifically to meet the needs of professional developers, this book briefly introduces functional programming before skipping directly to the heart of using Clojure in a real-world setting. The discussion details the read—eval—print workflow that enables fast feedback loops, then dives into enterprise-level Clojure development with expert guidance on web services, testing, datomics, performance, and more. Read from beginning to end, this book serves as a clear, direct guide to Clojure programming—but the comprehensive coverage and detail makes it extraordinarily useful as a quick reference for mid-project snags. The author team includes four professional Clojure developers, ensuring professional-level instruction from a highly practical perspective.</p> <p>Clojure is an open-source programming language maintained and supported by Cognitect., and quickly gaining use across industries at companies like Amazon, Walmart, Facebook, Netflix, and more. This guide provides a concise, yet thorough resource for professional developers needing to quickly put Clojure to work.</p> <ul> <li>Parse the difference between functional and object-oriented programming</li> <li>Understand Clojure performance and capabilities</li> <li>Develop reactive web pages using ClojureScript</li> <li>Adopt an REPL-driven development workflow</li> </ul> <p>Clojure is a modern dialect of Lisp, designed for concurrency and Java compatibility. It can be used with the Java virtual machine, Microsoft's Common Language Runtime, and JavaScript engines, providing a level of both versatility and functionality that is appealing to more and more enterprise-level developers. As requirements grow increasingly complex, stepping away from imperative programming can dramatically streamline the development workflow. <i>Professional Clojure</i> provides the expert instruction that gets professionals up to speed and back to work quickly.</p>
<p>INTRODUCTION xv</p> <p><b>CHAPTER 1: HAVE A BEGINNER’S MIND 1</b></p> <p>Functional Thinking 2</p> <p>Value Oriented 2</p> <p>Thinking Recursively 5</p> <p>Higher Order Functions 8</p> <p>Embracing Laziness 11</p> <p>When You Really Do Need to Mutate 12</p> <p>Nil Punning 15</p> <p>The Functional Web 16</p> <p>Doing Object-Oriented Better 16</p> <p>Polymorphic Dispatch with defmulti 18</p> <p>Defining Types with deftype and defrecord 20</p> <p>Protocols 21</p> <p>Reify 22</p> <p>Persistent Data Structures 23</p> <p>Shaping the Language 27</p> <p>Summary 29</p> <p><b>CHAPTER 2: RAPID FEEDBACK CYCLES WITH CLOJURE 31</b></p> <p>REPL-Driven Development 32</p> <p>Basic REPL Usage with Leiningen 32</p> <p>Remote REPLs with nREPL 34</p> <p>REPL Usage with a Real Application 35</p> <p>Connecting Your Editor to a REPL 39</p> <p>Reloading Code 40</p> <p>Reloading Code from the REPL 40</p> <p>Automatically Reloading Code 43</p> <p>Writing Reloadable Code 49</p> <p>Summary 51</p> <p><b>CHAPTER 3: WEB SERVICES 53</b></p> <p>Project Overview 53</p> <p>Namespace Layout 54</p> <p>Elements of a Web Service 55</p> <p>Libraries, Not Frameworks 55</p> <p>HTTP 55</p> <p>Routing 64</p> <p>JSON Endpoints 70</p> <p>Example Service 74</p> <p>Create the Project 75</p> <p>Additional Namespaces 75</p> <p>Default Middleware 77</p> <p>The Storage Protocol 78</p> <p>Handlers 83</p> <p>Middleware 88</p> <p>Routes 89</p> <p>Deployment 94</p> <p>Using Leiningen 94</p> <p>Compiling an Uberjar or Uberwar 95</p> <p>Hosting 96</p> <p>Summary 97</p> <p><b>CHAPTER 4: TESTING 99</b></p> <p>Testing Basics with clojure.test 100</p> <p>with-test 101</p> <p>deftest 101</p> <p>are 102</p> <p>Using Fixtures 103</p> <p>Testing Strategies 104</p> <p>Tests Against DB 104</p> <p>Testing Ring Handlers 106</p> <p>Mocking/Stubbing Using with-redefs 108</p> <p>Redefining Dynamic Vars 110</p> <p>Record/Replay with VCR 111</p> <p>Measuring Code Quality 112</p> <p>Code Coverage with Cloverage 112</p> <p>Static Analysis with kibit and bikeshed 114</p> <p>Keeping Dependencies Under Control 116</p> <p>Testing Framework Alternatives 119</p> <p>Expectations 119</p> <p>Speclj 119</p> <p>Cucumber 120</p> <p>Kerodon 126</p> <p>Summary 127</p> <p><b>CHAPTER 5: REACTIVE WEB PAGES IN CLOJURESCRIPT 129</b></p> <p>ClojureScript Is a Big Deal 129</p> <p>A First Brush with ClojureScript 131</p> <p>Starting a New ClojureScript Project 132</p> <p>Getting Fast Feedback with Figwheel 132</p> <p>Creating Components 134</p> <p>Modeling the Data 135</p> <p>Responding to Events and Handling State Change 136</p> <p>Understanding Errors and Warnings 137</p> <p>Namespace Layout 141</p> <p>Styling 141</p> <p>Form Inputs and Form Handling 142</p> <p>Navigation and Routes 145</p> <p>HTTP Calls: Talking to a Server 147</p> <p>Drag and Drop 149</p> <p>Publishing 150</p> <p>Reagent in Depth 151</p> <p>Form 1: A Function That Returns a Vector 151</p> <p>Form 2: A Function That Returns a Component 152</p> <p>Form 3: A Function That Returns a Class 153</p> <p>Sequences and Keys 154</p> <p>Custom Markup 155</p> <p>Reactions 156</p> <p>A Note on Style 158</p> <p>Testing Components with Devcards 159</p> <p>Interop with JavaScript 162</p> <p>One Language, One Idiom, Many Platforms 164</p> <p>Things to Know About the Closure Compiler and Library 164</p> <p>Modeling State with DataScript 165</p> <p>Go Routines in Your Browser with core.async 166</p> <p>Summary 167</p> <p><b>CHAPTER 6: THE DATOMIC DATABASE 169</b></p> <p>Datomic Basics 170</p> <p>Why Datomic? 170</p> <p>The Datomic Data Model 172</p> <p>Querying 175</p> <p>Transactions 181</p> <p>Indexes Really Tie Your Data Together 183</p> <p>Datomic’s Unique Architecture 187</p> <p>Modeling Application Data 188</p> <p>Example Schema for Task Tracker App 188</p> <p>Entity ids and Partitions 196</p> <p>Datomic’s Clojure API 197</p> <p>Basic Setup 197</p> <p>Experimenting in the REPL 200</p> <p>Building Applications with Datomic 206</p> <p>User Functions 206</p> <p>Account Functions 209</p> <p>Task Functions 210</p> <p>Deployment 213</p> <p>The Limitations 214</p> <p>Summary 215</p> <p><b>CHAPTER 7: PERFORMANCE 217</b></p> <p>What Is Performance? 219</p> <p>Choosing the Right Data Structure Is a Prerequisite for Performance 219</p> <p>Benchmarking 221</p> <p>Timing Slow Things 221</p> <p>Use Criterium for Timing Fast Things 223</p> <p>Use Test Selectors for Performance Tests 225</p> <p>Parallelism 225</p> <p>Memoization 226</p> <p>Inlining 227</p> <p>Persistent Data Structures 228</p> <p>Safe Mutation with Transients 228</p> <p>Profi ling 229</p> <p>Avoiding Reflection with Type Hinting 230</p> <p>Java Flags 232</p> <p>Math 232</p> <p>Summary 232</p> <p>INDEX 235</p>
<p><b>About the authors</b> <p><b>Jeremy Anderson</b> is a Developer at Code Adept, and a Clojure contributor. <p><b>Michael Gaare</b> is the platform technical lead at Nextangles, a financial technology startup. <p><b>Justin Holguín</b> is a software engineer at Puppet Labs, where he specializes in Clojure backend services. <p><b>Nick Bailey</b> is a Clojure enthusiast and the maintainer of the Clojure java.jmx library. He is a software architect at DataStax. <p><b>Timothy Pratley</b> is a Clojure contributor at Outpace Systems, Inc. <p><b>Visit us at wrox.com where you have access to free code samples, Programmer to Programmer forums, and discussions on the latest happenings in the industry from around the world.</b>
<p><b>Professional guide to functional programming with Clojure</b> <p>A modern dialect of Lisp, designed for concurrency and Java compatibility, Clojure offers the solutions many developers are seeking. Clojure's versatility and functionality are drawing more and more attention among enterprise-level developers, especially those looking to streamline their workflow with a step away from imperative programming. This book offers complete reference for the professional, with clear instruction and practical perspective on using Clojure in a real-world setting. Functional programming fundamentals are followed by Clojure-specific guidance, with insight from expert Clojure contributors. As the demand for experienced Clojure developers continues to grow, this guide provides the essential reference professionals need to get up to speed quickly. <p><i>Professional Clojure:</i> <ul> <li>Explores the gap between functional and object-oriented programming, and how Clojure provides a solution for that space</li> <li>Describes the read-eval-print loop workflow used in declarative programming for fast feedback loops</li> <li>Demonstrates the use of ClojureScript in the design and development of reactive web pages</li> <li>Explains Clojure's features, performance, capabilities, and the versatile compatibility that makes it an essential language</li> <li>Covers web services, testing, the datomic database, and much more for a complete professional reference and tutorial</li> <li>Provides practical insight on real-world applications from expert programmers and Clojure contributors</li> </ul> <p><b>Wrox Professional</b> guides are planned and written by working programmers to meet the real-world needs of programmers, developers, and IT professionals. Focused and relevant, they address the issues technology professionals face every day. They provide examples, practical solutions, and expert education in new technologies, all designed to help programmers do a better job.

Diese Produkte könnten Sie auch interessieren:

Software Process Modeling
Software Process Modeling
von: Silvia T. Acuna, Natalia Juristo
PDF ebook
96,29 €
A Software Process Model Handbook for Incorporating People's Capabilities
A Software Process Model Handbook for Incorporating People's Capabilities
von: Silvia T. Acuna, Natalia Juristo, Ana Maria Moreno, Alicia Mon
PDF ebook
149,79 €
XML for Bioinformatics
XML for Bioinformatics
von: Ethan Cerami
PDF ebook
53,49 €