Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!198.186.194.247.MISMATCH!news-out.readnews.com!transit3.readnews.com!postnews.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!extra.newsguy.com!newsp.newsguy.com!news3 From: Michael Wojcik Newsgroups: comp.lang.java.programmer Subject: Re: =?UTF-8?B?QW5kcm9pZOKAlFdoeSBEYWx2aWs/?= Date: Wed, 15 Jun 2011 14:01:55 -0400 Organization: Micro Focus Lines: 39 Message-ID: References: <3KTHp.3576$PA5.1424@newsfe01.iad> NNTP-Posting-Host: p1b53c2b07f0a82ea20b1773f9d29162d2e6d2776c086168f.newsdawg.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5328 Arved Sandstrom wrote: > > I suspect that when I did write a fair bit of C, that I wrote the client > code in such a way that I usually needed the full declaration anyway - > that is, no particular APIs to wrap the anticipated handling of the > struct. You make a good point about writing the APIs in such a way that > client code can do what it needs to do with only the pointer. Yeah. C doesn't provide much in the way of abstraction and encapsulation (the way that typical OO languages do), so a lot of C programmers never notice that there are some ways to achieve a fair bit of it. > This is where Axis 2 C made this mistake, as I described. Their WSDL > stub generator (and probably their skeleton generator also) produces > code that deferences at least one very important struct pointer. The > relevant header (and accompanying implementation) has no provision for > supplying a suitable function that would obviate the need to dereference. Yup, that would be a bug. > As I see it you'd have 2 options here - (1) expose the complete struct > in the header, and not change the client, or (2) add a function to carry > out the operation that the client code requires, which means modifying > both the client (the code generator actually if you're going to do this > a lot) and the library. Either way you have to modify the library code, > which is not something you should require of your library users. Agreed. This might be the result of insufficient standards and editing among the development team for Axis 2 C - it sounds like some contributors wanted encapsulation, and others weren't thinking of it. One of the advantages of open source is that you can fix things like this yourself. One of the disadvantages is that you may have to... -- Michael Wojcik Micro Focus Rhetoric & Writing, Michigan State University