From: Colin P. A. <co...@co...> - 2008-01-02 20:04:48
|
>>>>> "Eric" == Eric Bezault <er...@go...> writes: Eric> Colin Paul Adams wrote: >> I have factored out the core code for the XSLT functions >> format-date(), format-time() and format-date-time() and moved >> it into the time library (this introduces dependencies for the >> time library on the math and regexp libraries, but I think this >> should not be considered a problem), and added a new function >> named xslt_formatted to each of DT_DATE, DT_TIME and >> DT_DATE_TIME. Eric> Introducing new dependencies should always be considered as Eric> a problem and should be considered with care. My first Eric> question is: what does this refactoring bring to the users? It gives users powerful formatting capabilities for dates and times. Eric> I can see that people who don't care about XSLT and XPath Eric> will have more classes to compile. Will there be people who Eric> will use these new functionalities in the date/time library Eric> and not the xslt/xpath libraries? Yes. That is why I did it. Eric> now to review this code that have been added to the Eric> date/time library, but just looking at the names of the new Eric> classes seems very suspicious to me (DT_XSLT_..., Eric> DT_XPATH_...). Perhaps the names are misleading. The classes named DT_XPATH_* provide features needed by the XPath data model for times and dates that were not currently in the corresponding plain DT_* classes. Maybe they could be merged, or maybe I could think of better names. The DT_XSLT_* classes are just renamed from XM_XSLT_*. Eric>If it is likely that people who will use Eric> these new functionalities will also use the xslt/xpath Eric> libraries, then what about having all that in a cluster Eric> 'time' in these libraries? The refactoring is precisely so you DON'T have to compile the XPath and XSLT libraries in to your application to get these formatting routines. Eric> Also, I wonder what is peculiar Eric> to date/time in class DT_STRING_ROUTINES. Yes, that's a bad one. I don't really know what to do with it. Eric> Likewise with Eric> DT_XSLT_NUMBER_ROUTINES. The routines in their are also used by the XSLT format-number() function. Perhaps it would be better placed in the string library. -- Colin Adams Preston Lancashire |