asibbald

asibbald

Programming Phoenix LiveView: P156

“…With this function, we name the concept of a base query and we provide one common way to build the foundation for all Demographic queries. This type of function is called a constructor. We’ll rely on it to create an initial query for demographics…”

I struggle to understand this paragraph

  1. “with this function “ - which function is being referred to? Query? base? for_user?.

  2. “we name the concept of…” do you mean something like “we introduce the concept of…?”

  3. “…we provide one common way to build the foundation for all Demographic queries…” It’s not clear how we do this.

Given that there are at least three new concepts being introduced here, it would be useful to expand the discussion, and/or provide a diagram or pseudocode to assist.

Marked As Solved

SophieDeBenedetto

SophieDeBenedetto

Author of Programming Phoenix LiveView

All great points/questions, thank you @asibbald! I’ll take them one at a time:

“with this function “ - which function is being referred to? Query? base? for_user?.

We do mean the base/0 function. I’ll clarify that in the next release :slight_smile:

“we name the concept of…” do you mean something like “we introduce the concept of…?”

What we mean here is that we are encapsulating the responsibility of the base query and giving it a name.

“…we provide one common way to build the foundation for all Demographic queries…” It’s not clear how we do this.

What we mean here is that the base/0 function provides this common functionality for the first step of writing any new query for demographics.

I think we can add some language to clarify this a bit.

Popular Pragmatic topics Top

belgoros
Following the steps described in Chapter 6 of the book, I’m stuck with running the migration as described on page 84: bundle exec sequel...
New
sdmoralesma
Title: Web Development with Clojure, Third Edition - migrations/create not working: p159 When I execute the command: user=> (create-...
New
conradwt
First, the code resources: Page 237: rumbl_umbrella/apps/rumbl/mix.exs Note: That this file is missing. Page 238: rumbl_umbrella/app...
New
jeremyhuiskamp
Title: Web Development with Clojure, Third Edition, vB17.0 (p9) The create table guestbook syntax suggested doesn’t seem to be accepted ...
New
curtosis
Running mix deps.get in the sensor_hub directory fails with the following error: ** (Mix) No SSH public keys found in ~/.ssh. An ssh aut...
New
fynn
This is as much a suggestion as a question, as a note for others. Locally the SGP30 wasn’t available, so I ordered a SGP40. On page 53, ...
New
jskubick
I found an issue in Chapter 7 regarding android:backgroundTint vs app:backgroundTint. How to replicate: load chapter-7 from zipfile i...
New
redconfetti
Docker-Machine became part of the Docker Toolbox, which was deprecated in 2020, long after Docker Desktop supported Docker Engine nativel...
New
gorkaio
root_layout: {PentoWeb.LayoutView, :root}, This results in the following following error: no “root” html template defined for PentoWeb...
New
dachristenson
@mfazio23 Android Studio will not accept anything I do when trying to use the Transformations class, as described on pp. 140-141. Googl...
New

Other popular topics Top

New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
New
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
First poster: bot
The overengineered Solution to my Pigeon Problem. TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New
PragmaticBookshelf
Author Spotlight Erin Dees @undees Welcome to our new author spotlight! We had the pleasure of chatting with Erin Dees, co-author of ...
New
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
PragmaticBookshelf
A Ruby-Centric Chat with Noel Rappin @noelrappin Once you start noodling around with Ruby you quickly figure out, as Noel Rappi...
New
New

Latest in PragProg

View all threads ❯