Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Visitor Pattern. To me it really depends on the context and how many "majigs" you're going to have, how flexible your application needs to be -- do you need to leave layers open to other implementations (different view, different transport, different persistence strategy)? I've gone both ways in the past with different projects, but if I were identify a rule for myself it would be that frameworks go the first way (easier to extend or swap components) while plugins go the second way (self-contained functionality).

If you can handle a larger number of classes you can sort of get around the question by using a good plugin loader that can associate the proper Persistamajig or Displayamajig with a particular object at run time.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: