Re: name that method!
Re: name that method!
- Subject: Re: name that method!
- From: Andy Lee <email@hidden>
- Date: Fri, 28 Sep 2007 17:41:26 -0400
I was going to say something similar, at the risk of starting a
religious discussion. You can always add a generic parametrized
method later, if and when you need it, and have it call -
JSONRepresentation in the JSONFormat case.
--Andy
On Sep 28, 2007, at 5:24 PM, Uli Kusterer wrote:
Am 28.09.2007 um 22:40 schrieb Ilan Volow:
It would return different representations of the dictionary based
on what enum constant of type SerialFormat was passed in (e.g.
JSONFormat, XMLRPCFormat, OPMLFormat, etc), and that way I
wouldn't be locking myself into one particular representation of
the dictionary like I would if I chose a JSON-specific name for
the method. Which means I could reuse the dictionary category in
other projects where I might need representations other than JSON.
Which means I'd to write less code the next time around.
Unless you actually have plans to have other representations, I'd
consider that over-engineered. You don't need an API with millions
of selectors and parameters like the procedural QuickTime or
CoreAudio if all you want to do is handle JSON mark-up. The whole
point of JSON, IIRC, is to be simple and understandable (and more
human-readable than XML), and if I chose to use that, I'd want the
API to be a similarly clean design.
It's OK to design an API for things you plan to do, but planning
for things you may need in the future usually never yields code
that behaves the way you need it to, and you'll have to refactor.
So you might as well design for immediate needs and then have a
cleaner design in the beginning, if you'll have to refactor it anyway.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden