Archive

Archive for the ‘Random Notes’ Category

The importance of Composition

February 4th, 2009

Many times when we are designing our programs model, first thing most people, including myself, want to start doing is inheriting from other classes. This makes for a nice large hierarchical beast. Not that there is anything wrong with that, but it can lead to certain problems (from my own personal experience, it usually does). With composition, the programmer no longer has to extend from the parent class. You are able to expose only the methods you are interested in. In this article, I really want to discuss the importance of composition. I feel as programmers, many of us find inheritance easier and we often use it without thinking about the repercussions it may bring to us.
Read more…

Marcel Best Practices, Design Patterns, Opinion, Random Notes , ,

ToStringBuilder plugin for eclipse

May 20th, 2008

So at work, I am given the task to refactor a lot of DTO’s. It’s an unfortunate lump of busy work, but at least eclipse has a built in generate getters/setters option. However, it doesn’t have a ToStringBuilder generator and it is beyond a pain to type .append(”class1″,class1).append(”class2″,class2), etcetcetc.

Luckily I found a plugin that generates them for you. You can also customize how you want your class to be generated. Its a nice small plugin that could save you a lot of time.

Marcel Random Notes