On 15/08/06, Edward Slattery <[EMAIL PROTECTED]> wrote:
This leads to a question which should be asked.
If the MyDataObject contains a DataObject, and all typesafe calls such as
getName() are in fact delegated via containedobject->getString("name")...
what has type safety actually gained us? We had to do a codegen to
generate
the wrapper class, the calls are no more efficient than the dynamic API.
All
we really gain is the ability for the compiler to grumble if we type
getNome() instead of getName() in our user program.
For the sake of an aditional set of tooling to be run prior to
compilation,
and probably a set of integration tools to make that work from DevStudio
as
a pre-build step, and Eclipse etc - is the benefit worth the work? What do
the C++ community feel?
The benefit is simplification of the programming for the end user. It is a
lot cleaner and more maintainable to code
Employee employee = someSDOmethod_returningMyTypesafeDO();
cout << employee.getName() << endl;
than
DataObjectPtr employee = someSDOmethod_returningDOPtr();
try
{
if (employee != NULL)
{
cout << employee->getString("name") << endl;
}
}
catch (SDORuntimeException &e)
{
}
OK... I've assumed the exception handling is in the static SDO methods but
even so you can see what I'm getting at. Maybe we need a thread on what
TypeSafe SDO means for C++. Is there a spec/design?
Cheers,
--
Pete