t***@grapevine.com.au
2007-09-28 02:02:09 UTC
I've been doing some investigation into UDTs as implemented by DB2 for LUW. One of the proported benefits of UDTs (and OO in general) is encapsulation. As long as the interface remains the same, the internals can be changed without impact. I take this to mean that both logic and data are "hidden". However, DB2 system generated constructor, mutators and observers (C-M-O) can't be over-ridden. So the internal representation (attribute data types) of the UDT are exposed. For instance, I might choose to represent a date using a db2 integer datatype within my UDT, but to expose it as db2 date datatype. But if you can't over-ride the system generated C-M-O, then I haven't really encapsulated anything, even if I've implemented my own methods / functions.