activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mittler, Nathan" <>
Subject RE: Regarding feedback on OpenWire C++ client
Date Tue, 28 Mar 2006 12:12:37 GMT

>Please define the interfaces that you want to be SP-free!

I'm with Hiram ... I think the entire API should be SP-free.  The less
the users have to see SPs, the better.

>>It's all about the user and helping them come up to speed and use the
>>as quickly and painlessly as possible.  I understand that in these
>>you're passing a pointer and not copying, but it complicates the user
>>interface when the person just wants to pass in a string.  They
>>have to create a string on the heap an then wrap it in a smart pointer
>>just call a function.

>Just a quick note, this is not necessary with the current design of
>accepting "const char*" and returning p<string>. The user can easily
>extract the const char from the SP string if wanted. 

But then you lose the symmetry of the getters and setters ... the setter
should take the same type that the getter returns.  IMHO, it seems
strange to have the setter take a char* and then the getter returns a
smart pointer.

>>Class Xxx {
>>  std::string name;
>>  void setName (const std::string& name) {
>>    this->name = name;
>>  }
>>  const std::string& getName () const {
>>    return this->name;
>>  }
>Shall we agree on the one above?
>Mats & David


View raw message