|
From: Luigi B. <lui...@gm...> - 2011-10-03 12:52:03
|
On Mon, 2011-10-03 at 20:14 +0800, R Y wrote: > Your points are perfectly valid. My point is that reading from a text > file improves the extendibility of the library as it doesn't require > rebuilding the source code (of course I'm sure you're well aware of > that). Yes, and you can do it already. Read a list of dates in whatever way you like, build a BespokeCalendar instance, pass it the dates you read, it's done. In case a new holiday is added to an existing calendar, you can use the addHoliday method instead of modifying the code. So you have extendibility. In the context of a library, data files are somewhat prone to problems. For instance, how should the library know where the data files are? On windows, you might have a preferred location for those. On Linux systems, there are a number of preferred locations which are used depending on whether one installs the library as user or superuser. Then the library might be linked statically to one's program, which means that suddenly a developer using the library has to ship the calendar files together with his program. The added migraines just don't seem worth the effort... Luigi -- When I was a boy of fourteen, my father was so ignorant I could hardly stand to have the old man around. But when I got to be twenty-one, I was astonished at how much the old man had learned in seven years. -- Mark Twain |