Avatar
Thank you for your reply!
they have built-in assumptions about how their types are represented
Yes, they have assumptions about the payload structure. However, sometimes it differs from built-in structure provided by Swift standard library, like the example of CGPoint .
Dates and Data specifically because they are ... likely to have the same representation across your entire payload
I agree. Not only Date and Data , but also all types are likely to have same representation across entire payload. The types indicate their only one representation by conforming to Codable . The current problem is that, when it differs from assumption, there is no way to adopt "really" assumed format instead of built-in format. So I realized that introducing strategies is not the best way for my motivation. A better way is to
  • remove built-in Codable conformance from some types ( Data , Date , CGPoint and more).
  • let developers define their own extension Foo: Codable to conform their "real" format.
What do you think of this idea?
8:23 AM
返事を考えたけどStrategyの話ではなくなってしまった
8:24 AM
(見当違いなこと言ってないでしょうか…)