Classes like CPTextStyle and CPLineStyle are struct-like in that they simply
act as storage vessels for attributes. The fact that these classes are mutable
complicates the design of Core Plot, because it requires that the framework
monitor to changes to any properties and update appropriately.
A better, more Cocoa-like solution would be to introduce mutable subclasses,
and make these classes immutable.
A model for this would be the NSURLRequest class. In practice, you rarely
create a NSURLRequest directly, but create a NSMutableURLRequest and upcast it.
The same could be done in CP. Properties in the framework would be immutable,
simplifying framework design. Users of the framework would create mutable
objects, setup as required, and then pass them to the framework where the
compiler would ensure they were not modified.
Original issue reported on code.google.com by drewmcco...@mac.com on 12 Dec 2010 at 7:14
Original issue reported on code.google.com by
drewmcco...@mac.com
on 12 Dec 2010 at 7:14