OK, so if we dont deal with exception hiding, the two are:

Employee employee = someSDOmethod_returningMyTypesafeDO();
  cout << employee->getName() << endl;

DataObjectPtr employee = someSDOmethod_returningAnSDO();
 cout << employee->getString("name") << endl;


..so Im  not sure that type safety really increases maintainability that
much that a developer would be willing to introduce a custom step into the
build process, and maintain generated code with all the resulting issues of
upward compatibility, debugging code you didn't write, getting inevitable
bugs fixed in the generator in a timely way etc.

Im not saying typesafe is wrong, I just dont want to see it developed in the
C++ world because its cool in the java world.

Theres no design for it yet - but maybe the value in doing it will become
clearer to me if we start discussing that amongst the community.


On 15/08/06, Pete Robbins <[EMAIL PROTECTED]> wrote:

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


Reply via email to