Replies: 1 comment
-
Hi @Mota-Link, thank you for your support! Yes, you are right that it is probably more appropriate to name the type variable as In any case, you might still see the terms "components" and "providers" being a bit overloaded even today. The term "component" is a bit of a catch all phrase in CGP to capture all different ways to organize code via common interfaces. If we want to be pedantic, we could qualify the specific use, such as the component name (i.e. the name struct), the component implementation (i.e. the provider), and the component interface (i.e. consumer and provider traits). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello @soareschen! Thank you for proposing such an excellent design pattern! I've carefully studied the Terminology and Core Concepts sections of your book and feel this is a highly promising new technology.
However, I have a question about one detail:
In the Linking Consumers with Providers chapter, you state:
But in the Provider Delegation chapter, you use a blanket implementation to implement
StringFormatter
for thePersonComponents
type. The code is written as:I notice this impl block defines two generic parameters, where
Component
representsPersonComponents
. In my understanding,PersonComponents
isn't actually a Component (as defined by the consumer-provider trait pair), but rather an aggregated provider.Should this blanket implementation instead be written as follows?
Beta Was this translation helpful? Give feedback.
All reactions