After watching 's Controlling Complexity talk, all of my Swift classes instantly became structs and now I am rich.
Conversation
yeaaaa boi live that nonprofit lifestyle
1
*pours glass of cleanskin red wine* Represent!
1
1
The only thing I’m unsure about is how would you implement core data/realm with structs, as they require NSObjec
3
1
1
Replying to
They have a mistaken conceptual model; ORMs are a trap. Control data flow explicitly, think of records, not objects.
Replying to
1
1
Replying to
exactly. Is it risky to extend NSCoder to archive your structs? (Being a class cluster etc)
1
Yes. But you can make e.g. class FooCodingAdapter: NSCoding { init(foo: Foo); let foo: Foo }
2
Show replies
Replying to
I love that there is even a Wikipedia article about how ORMs are a trap. en.wikipedia.org/wiki/Object-re
Replying to
Isn't that an implementation detail that can be fixed? (E.g. Active record vs data mapper patterns.)
1




