At 02:18 18/02/2010, Nick Ager wrote:
I understand that sometimes it's handy to be able
to dynamically add
fields to an object, which is when it makes sense to use a
Dictionary, however to aid my understanding it seems much simpler to
store properties in instance variables accessed via accessors. Will
I fall into any problems if I use an accessor pattern on my PRWidget
derived classes by ensuring that #write:using: reimplements the
Object>>write:using: ?
Pier provides a general mechanism for handling the issue we
discussed. It could be done differently, like the solution above.
But, in that case you break the logic of your implementation
framework, Pier, which means that you take an additional maintenance
responsibility to keep your logic in synch. with that of Pier (that
may change with time). I'd avoid this, and would keep the Property
Pattern of Pier that works just fine. After all, widgets are
transient objects that provide users a view on your model objects
during a session. I'd therefore recommend to focus on model objects,
and just reuse the solution provided by Pier.
Hoping this helps,
Reza