Thomas Nunninger wrote: > Hi, > > there is an issue (#010913) about complex datatypes for persistent > object. I don't know in deep about the disussion - but I just have an > idea: > > Wouldn't it be good to have a dedicated Datatype component? This > component could cover things like validation, conversion (to an > internal representation and between different representations e.g. > degree Celsius and Farenheit), and provide datatype specific operators, > e.g. calculating a distance between two location-related datatypes. > > This component could be used in several places: > > - input validation > > - business objects > > - persistent object > > What do you think about such a component?
Does it need to be a component? Then all (or at least some) components will depend on it. I think having a "Tools" class in Base would be better, or some conversion classes, like ezcBaseDateConverter and ezcBaseTemperatureConverter. But then you actually don't need these classes, just use date() with a format and the Celsius/Fahrenheit formula and you are done. For distances there is also a formula which does not need to be wrapped in a class inside a component in order to be used. So I think it won't make much sense to have a dedicated component for data types. It would force the users of ezc to learn it and use it, and we said that our components must be independent and general purposed. What do the others think about this? Cheers, Alex. -- Alexandru Stanoi eZ Components System Developer eZ Systems | http://ez.no -- Components mailing list [email protected] http://lists.ez.no/mailman/listinfo/components
