>>>>> "SB" == Steve Bertrand <[email protected]> writes:

  SB> I have found some benefit to having wildly changing API's... I've learnt
  SB> better ways to manage the callers to minimize impact, and better ways to
  SB> design parameter handling. I'm sure once I find my own style that
  SB> conforms (even loosely) to what other coders deem readable, I'll settle
  SB> so that API's are designed to not require change.

what you are doing (but slowly) is learning about api design and
architecture. it is very hard to teach or learn from a book. it is best
learned from experience and that can take a long time. this is not
knocking what you are doing, but letting you know that you are in it for
the long haul. sometimes an api may work for a long time when you then
learn or discover some new feature you want that just doesn't fit
cleanly. not much you can do about it. or a simple api works for years
and then you learn it needs to support threads (see solaris kernel stuff
for the old and the new thread safe versions of many calls). it is very
hard to predict future api needs without have years of seeing them
change behind you. :)

  SB> I think I've got a good start. API changes, here we come. Out with the
  SB> old, and in with dispatch tables and callbacks ;)

i love both of those and use them in many different places. one very
powerful way to use dispatch tables indirectly is with polymorphism with
methods. if you have the same method names in different classes, you can
replace one class with another and call it the same way as the method
names are looked up on the fly (cached too for speed). so you can use
different modules with the same api for different needs, e.g. different
codecs which support the same api become a plugin thing. this is
effectively using the symbol table looked up by the class name as the
dispatch table with the method name being the constant.

uri

-- 
Uri Guttman  ------  [email protected]  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to