Muutke küpsiste eelistusi

E-raamat: Phoenix in Action

  • Formaat: 336 pages
  • Ilmumisaeg: 26-Apr-2019
  • Kirjastus: Manning Publications
  • Keel: eng
  • ISBN-13: 9781638356202
  • Formaat - EPUB+DRM
  • Hind: 45,77 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.
  • Formaat: 336 pages
  • Ilmumisaeg: 26-Apr-2019
  • Kirjastus: Manning Publications
  • Keel: eng
  • ISBN-13: 9781638356202

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

Description

Phoenix is a modern web framework built for the Elixir programming language. Elegant, fault-tolerant, and performant, Phoenix is as easy to use as Rails and as rock-solid as Elixirs Erlang-based foundation. Phoenix in Action builds on your existing web dev skills, teaching you the unique benefits of Phoenix along with just enough Elixir to get the job done.

 

Phoenix in Action is an example-based tutorial that teaches you how to use the Phoenix framework to build production-quality web apps. Following a running example of an online auction site, youll design and build everything from the core components that drive the app to the real-time user interactions where Phoenix really shines. Youll handle business logic, database interactions, and app designs that take advantage of functional programming as you discover a better way to develop web applications.

 

Key features

·   Use channels for real-time communication

·   Learn database interactions with Ecto

·   Hands-on examples

·   Step-by-step instructions

·   Jargon-free

 

Audience

Written for web developers familiar with a framework like Rails or ASP.NET. No experience of Elixir or Phoenix required.



About the technology

Phoenix is a web framework for the Elixir language. Phoenix applications are blazingly fast, and as a developer youll appreciate the attention to detail in the framework design that makes you superproductive almost immediately. In particular, Phoenix channels provide an easy way to set up and manage real-time communication.
Foreword xi
Preface xiv
Acknowledgments xvi
About this book xviii
About the author xxii
About the cover illustration xxiii
Part 1 Getting Started 1(66)
1 Ride the Phoenix
3(14)
1.1 What is Phoenix?
4(1)
1.2 Elixir and Phoenix vs. the alternatives
5(4)
Real-time communication
5(1)
Efficient, small processes
6(1)
Background computation
6(1)
Minimal hardware requirements, low-cost scaling
7(1)
It's not all roses
8(1)
1.3 The power of Elixir
9(4)
Scalability
9(1)
Supervision trees
10(1)
Erlang VM
11(1)
Macro and metaprogramming support
12(1)
OTP
12(1)
1.4 Functional vs. object-oriented programming
13(3)
Overview of functional programming
13(3)
1.5 Keep reading
16(1)
2 Intro to Elixir
17(28)
2.1 The basics
18(19)
IEx
19(3)
Basic types
22(1)
A small detour into functions
23(4)
Data type details
27(7)
Back to modules and named functions
34(2)
alias
36(1)
import
36(1)
2.2 Other idiomatic Elixir language features
37(8)
The pipe operator
37(1)
Pattern matching
38(5)
Using IEx.Helpers.v/1
43(2)
3 A little Phoenix overview
45(22)
3.1 Follow the data
47(19)
The basics of a web request
47(1)
Endpoint
48(4)
Router
52(4)
Controller
56(5)
Views
61(1)
Templates
62(4)
3.2 Putting it all together
66(1)
Part 2 Diving In Deep 67(172)
4 Phoenix is not your application
69(17)
4.1 I thought this book was about Phoenix
70(2)
4.2 The first steps in building your application
72(12)
Defining an item
73(2)
Adding a fake database
75(4)
Getting an Item by id
79(2)
Getting an Item based on other information
81(3)
4.3 Next steps
84(2)
5 Elixir application structure
86(21)
5.1 Moving from a single file to an application
87(8)
Using Mix to create a new application
88(2)
Generating an auction umbrella application
90(2)
The magic mix.exs file
92(3)
5.2 Organizing, compiling, and running your new application
95(5)
Breaking apart the three modules
96(2)
Compile and run!
98(1)
Running the Auction application for the first time
99(1)
5.3 Using Hex to get external dependencies
100(7)
Pulling in your dependencies
103(4)
6 Bring in Phoenix
107(12)
6.1 Installing Phoenix on your system
108(1)
6.2 Creating a new Phoenix application
109(3)
Running your server for the first time
110(2)
6.3 Listing items from the fake repo
112(7)
Modifying the controller and template
113(6)
7 Being persistent with a database
119(18)
7.1 A quick intro to Ecto
120(1)
7.2 Configuring Ecto
120(3)
Using Ecto's Mix tools to set up your database
123(1)
7.3 Preparing Auction to use the database
123(7)
Defining the Auction.Item schema
123(2)
Migrating the database
125(3)
Pointing the public interface to the new repo
128(1)
Instructing the application to supervise the database connection
128(1)
Testing it out
129(1)
7.4 Creating, retrieving, and deleting data in the database
130(7)
Inserting data
131(2)
Retrieving data
133(1)
Deleting data
134(1)
Updating data
135(1)
What about the website?
135(2)
8 Making changes with Ecto.Changeset
137(15)
8.1 Can't I just ... update?
138(10)
A brief intro to changesets
139(1)
Creating a changeset for Auction.Item
139(9)
8.2 Now you can update!
148(4)
Adjusting the public interface for updating
150(2)
9 Transforming data in your browser
152(29)
9.1 Handling new routes in your application
153(7)
Adding a new route
153(4)
Adding a new controller
157(1)
Adding a new view
158(1)
Adding a new template
158(2)
9.2 Viewing the details of a single item
160(5)
Defining the show route and function
160(2)
Defining the show. html template
162(1)
Linking to individual items
162(3)
9.3 Creating items through web forms
165(9)
Defining the new and create routes
165(1)
Defining the "new" controller function
166(1)
Defining the "new" template
167(1)
Defining the create controller function
168(6)
9.4 Editing items through web forms
174(7)
Defining the edit and update routes
174(1)
Defining the "edit" controller function
175(1)
Defining the edit.html.eex template
176(2)
Defining AuctionWeb.ItemController.update/2
178(3)
10 Plugs, assigns, and dealing with session data
181(27)
10.1 Preparing your application for user registration
182(10)
Defining the Auction. User schema
182(1)
Creating a migration to create the users table
183(1)
Defining changesets for Auction. User
184(3)
Creating API functions in Auction
187(1)
User registration web flow
188(4)
10.2 Handling user login and sessions
192(8)
Creating the route, controller, view, and templates for logging in and out
193(2)
Implementing the dirty details of sessions and authentication
195(5)
10.3 Plugs
200(2)
10.4 Adding site navigation
202(3)
Implementing the log out function
204(1)
10.5 Restricting users from certain pages
205(3)
11 Associating records and accepting bids
208(31)
11.1 Creating bids
209(1)
11.2 Adding associations to the Auction.Bid schema
210(12)
A little detour into associations
210(2)
Creating a migration that describes the associations
212(5)
Creating a form to accept' bids
217(5)
11.3 Using has_many with items and users
222(8)
Preloading and avoiding N+1 queries
223(3)
Preloading associations in the public interface module and controller
226(1)
Adding the list of bids to the view template
227(3)
11.4 Listing a user's bids on their profile page
230(7)
Using Ecto.Query to construct database queries
231(1)
Making a view helper function global and using the bids assign
232(4)
Using Timex to format dates and times
236(1)
11.5 Some ideas for further improvement
237(2)
Part 3 Those Important Extras 239(58)
12 Using Phoenix channels for real-time communication
241(20)
12.1 What are Phoenix channels?
242(1)
12.2 Connecting a user to a channel and a topic
242(9)
Handling topic join requests
243(1)
Getting the user's browser to join a topic
244(7)
12.3 Sending real-time messages to a user
251(3)
Receiving messages in the user's browser
251(1)
Configuring the channel to handle messages
252(1)
Sending your browser a message from IEx
253(1)
12.4 Updating all users when a new bid is made
254(7)
Refactoring the rendering of an item's bids
255(1)
Modifying the controller to broadcast a message
256(2)
Handling the broadcasted HTML in the browser
258(3)
3 Building an API
261(10)
13.1 Scoping API requests to a new controller
262(2)
13.2 Creating the AuctionWeb.Api.ItemController controller and view
264(3)
13.3 Including related bid and user data
267(4)
14 Testing in Elixir and Phoenix
271(26)
14.1 An introduction to ExUnit
272(3)
Writing a first test
273(2)
14.2 Setting up tests for Ecto
275(4)
Configuring a new database
275(1)
Creating a sandbox and configuring Ecto to use it in tests
276(1)
Setting up the database before tests run
277(1)
Creating a Mix alias for use during test runs
278(1)
14.3 Testing Ecto queries in Auction
279(4)
Testing Auction.list_items/0
279(2)
Testing Auction.get_item/1
281(1)
Testing Auction.insert_item/1
282(1)
14.4 Simultaneously writing documentation and tests with doctests
283(8)
Writing function-level documentation
283(2)
Viewing documentation in IEx
285(1)
Viewing documentation with ExDoc
286(1)
Adding examples and doctests
287(2)
Module-level documentation
289(2)
14.5 Writing tests For Phoenix
291(5)
Testing that an item is added to the database on success
292(1)
Testing that you're redirected to the new item on success
293(1)
Testing that no item is created on error
294(1)
Testing that the new item form is rendered on error
295(1)
The entire ItemControllerTest module
295(1)
14.6 What next?
296(1)
Appendix A Installing Elixir and Phoenix 297(3)
Appendix B More Elixir resources 300(1)
Index 301
Geoffrey Lessel has been a web developer for over 15 yearsfirst with PHP and Perl and now with Ruby on Rails and Phoenix. He has spoken at ElixirConf and blogs about Elixir and Ecto at geoffreylessel.com.