3 ms·
How would Mutations compare with Concerns, which seems to be DHH's preferred method?
by nchuhoai 14y ago
How would Mutations compare with Concerns, which seems to be DHH's preferred method?
- jbverschoor 14y agoI don't see the correlation here
- bemurphy 14y agoOne big difference would be encapsulation. With mixins (sometimes called Concerns), you have a shared state between the module and the class including it. With a real class, you have your own space and (probably) don't have to deal with state and method collisions. Pros/cons to each surely, and a lot is a matter of taste at that.