From: Harald K. <har...@we...> - 2004-08-19 17:17:31
|
Hi All, I thought about how to implement a better handling of data inside occurrences. This approach should also bring a better support for later adding support for xml inside occurrence data. I suggest to add an Interface named OccurrenceData (or OccurrenceContent, i am not quite sure which is the better name) which encasulates the Data of an Occurrence. The Occurrence Interface would have to be extended with the methods getOccurrenceData(...) and setOccurrenceData(..) (or getOccurrenceContent and setOccurrenceContent). The Methods getData() and setData() should be kept for compatibility reasons. The OccurrenceData (or OccurrenceContent) would have the following methods: String getData / void setData(String) have the same behavier like getData/setData of Occurrence StringReader getStringReader() returns a StringReader containing the data Object getAdapter(Class clazz) Following the Adapter Pattern would make the support of other Data Formats easier to implement. It would also prevent the interface from getting to complex blown up. The basic implementation should support the creation of the following Instances throug its getAdapter Method: java.util.Date (for Temporal Data) org.xml.sax.InputSource (for XML Data) javax.xml.transform.Source (returning a javax.xml.transform.stream.StreamSource) (for XML Data) further DataFormats that might be interesting are: some class that understands Wiki Formatting instructions some class that understands spatial data (Christoph, is there a STandart API or something like that ?) I experimented with the java.util.Date class and together with an Occurence type which specifies the time format by a Basename following the formatting syntax (e.g. dd.mm.yyyy) we get a way to create time aware TopicMaps. I also think that the impact on the API would be relatively small. Cheers, Harald ____________________________________________________ Aufnehmen, abschicken, nah sein - So einfach ist WEB.DE Video-Mail: http://freemail.web.de/?mc=021200 |