[openbeos] Re: Development Model?

  • From: "Waldemar Kornewald" <Waldemar.Kornewald@xxxxxx>
  • To: <openbeos@xxxxxxxxxxxxx>
  • Date: Mon, 12 May 2003 19:29:19 +0200

> First, the problem domain: the fickle nature of TCP socket
> connection(s) means that said connection can change state at any given
> moment without so much as a cursory "so long, and thanks for all the
> fish."  For example, in the BNetEndpoint class one is allowed to
> programatically change any aspect of a live connection which directly
> effects most aspects of an instance of BNetEndpoint.  Said
> behind-the-scenes changes will bubble up into userland with potential
> adverse side effects.

What are you thinking of when you want to "change aspects of BNetEndpoint"?
As this message was already posted on every possible group I am willing to
talk about it, but I have not understood your problem. ;)

> Next, the quandary: I tend to code using the "contract programming"
> development model as I find it very tolerant to both real-world
> failures as well as pathological cases.  I interpret the essence of
> contract programming is that there is a guarantee in place, to wit:
> should "A::method()" fail, the member data of whatever instance of
> class A won't be left in an indeterminate state.  As I read the BeBook,
> in the current incarnation of the BNetEndpoint we basically bail out of
> a failed connection, leaving whatever instance of BNetEndpoint in an
> indeterminate state -- thus my abhorrant confusion.

Why should the user bother about the member data? A Send() will fail and
return B_ERROR if the connection could not be established or am I missing
the point?

> I guess that the point of this long-winded obfuscated electronic
> dissertation is twofold in that I don't want to break binary
> compatiblilty with R5 but at the same time I would like to handle
> socket connection failures more gracefully than is implied in the
> BeBook -- lookin' for validation to my madness.

Do you mean that InitCheck() only returns B_ERROR instead of the real error?
Please excuse my stupidity. :)

Waldemar


Other related posts: