RE: [infiniband-diags] [PATCH] [2/2] split out scan specific data from ibnd_node_t

Sean Hefty
2009-11-12T23:10:54Z

>> Making things "private" allows us to change the library without breaking the
>> interface.
>
>I don't think
>
>> Furthermore, it simplifies the interface for users who want to
>> write code at a higher level.
>
>I'm not asking to make high level life harder :). My point is to not
>prevent from advanced developers to use available low level too,
>especially when such preventing requires some extra efforts.

I haven't been following the details of this thread, but it's very common to
expose only a portion of a data structure to the user, while keeping some of it
private. As long as the lower library allocates the structure and exchanges
pointers, the interface can be maintained.

Trying to expose what should be internal data structures through a public
interface tosses encapsulation out the window, along with any benefits that it
provides. In the end, all you get is a poorly designed interface.

Advanced developers can use lower level interfaces, like mad or umad.

- Sean