[swift-evolution] Proposal - Allow properties in Extensions

James Campbell james at supmenow.com
Wed Dec 23 09:09:38 CST 2015


I wouldn't mind it being treated just as a bunch of getters and setters.

On Wed, Dec 23, 2015 at 3:05 PM, Paul Cantrell via swift-evolution <
swift-evolution at swift.org> wrote:

> On Dec 22, 2015, at 10:45 PM, John McCall via swift-evolution <
> swift-evolution at swift.org> wrote:
> >
> > when you stuff a lot of functionality into a single class in most OO
> languages, there’s no real way to enforce its division into subsystems,
> because every method has direct access to every property and every other
> method.  In contrast, in Swift you can divide that class into distinct
> components with their own interface, state, and invariants, essentially
> making each component as good as its own type as far as encapsulation goes.
>
> Can you elaborate on this, John? Extensions and protocols in Swift today
> still don’t solve the problem that shared _private_ class state has to be
> centralized. Or were you speaking as if this “properties in extensions”
> proposal were already implemented?
>
> Cheers,
>
> Paul
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>



-- 
 Wizard
james at supmenow.com
+44 7523 279 698
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151223/5e178917/attachment.html>


More information about the swift-evolution mailing list