If the strings are mandatory, I would supply them in the constructor. This makes it clear that they have to be supplied.
This leaves 2 options. Supply the 10 strings in the constructor, or supply a Map with 10 Strings to the constructor. I would prefer the 10 Strings in this case, for the simple reason that it is very clear that you need 10 strings. If you can supply a Map, somebody might pass a Map with only 6 Strings for example.
Hope this helps
Main Topics
Browse All Topics





by: cmalakarPosted on 2008-01-24 at 03:51:23ID: 20732119
why not Use array of objects as the parameter to a constructor..