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

I pretty often find myself "functionalizing" design patterns in in Java to split out the verbose part from the part that is interesting.

For instance, say you have a Log object that has 15 or so Log methods for different severity levels and signatures and you just want to write something that prepends something to anything that gets logged.

If you split this to "something that applies a function to any message passed to the log" and "a function that transforms a message" you get something that's certainly better if you implement more than one transform and probably better in the case of just one because the repetitive boilerplate is physically separated from the "business end".



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

Search: