DEV Community

Discussion on: It’s all about the abstractions baby

birdayz profile image
Johannes Brüderl

no. it's a statement against shallow data classes without behavior.

Thread Thread
qm3ster profile image
Mihail Malo

I don't see why you'd assume MyObject doesn't have rich methods and doesn't protect its invariants.

Thread Thread
kritner profile image
Russ Hammett Author

Sorry maybe I'm missing something the purpose of this and your original comment, can you elaborate?

I didn't think there was really any model type classes in this post; save the undefined MyObject. I'm not saying that classes with behavior are bad, I meant more as if it's implementing an interface, then the consumers can work with the interface, rather than the concrete. This, at least in my opinion, is a better high level design, and makes it easier on consumers/callers to understand a system, rather than getting bogged down in the details of implementation.