Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.lang.java.programmer > #5328

Re: Android—Why Dalvik?

From Michael Wojcik <mwojcik@newsguy.com>
Newsgroups comp.lang.java.programmer
Subject Re: Android—Why Dalvik?
Date 2011-06-15 14:01 -0400
Organization Micro Focus
Message-ID <itbmha017f9@news3.newsguy.com> (permalink)
References (18 earlier) <isee3b$sj9$1@lust.ihug.co.nz> <isnvt2615kt@news2.newsguy.com> <3KTHp.3576$PA5.1424@newsfe01.iad> <it0b3c01q2f@news2.newsguy.com> <GU8Jp.50669$5f.28538@newsfe19.iad>

Show all headers | View raw


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

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: Android—Why Dalvik? Michael Wojcik <mwojcik@newsguy.com> - 2011-06-03 09:31 -0400
  Re: Android—Why Dalvik? BGB <cr88192@hotmail.com> - 2011-06-03 12:45 -0700
    Re: Android—Why Dalvik? Michael Wojcik <mwojcik@newsguy.com> - 2011-06-03 17:14 -0400
  Re: Android—Why Dalvik? Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-06-04 12:23 +1200
    Re: Android—Why Dalvik? BGB <cr88192@hotmail.com> - 2011-06-03 19:01 -0700
      Re: Android—Why Dalvik? Michael Wojcik <mwojcik@newsguy.com> - 2011-06-07 11:59 -0400
    Re: Android—Why Dalvik? Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-06-04 02:44 -0400
      Re: Android—Why Dalvik? Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-06-05 11:11 +1200
        Re: Android—Why Dalvik? Michael Wojcik <mwojcik@newsguy.com> - 2011-06-08 10:10 -0400
          Re: Android—Why Dalvik? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-06-08 20:38 -0300
            Re: Android—Why Dalvik? Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-06-08 17:28 -0700
              Re: Android—Why Dalvik? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-06-08 23:41 -0300
            Re: Android—Why Dalvik? Michael Wojcik <mwojcik@newsguy.com> - 2011-06-11 13:38 -0400
              Re: Android—Why Dalvik? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-06-12 16:59 -0300
                Re: Android—Why Dalvik? Michael Wojcik <mwojcik@newsguy.com> - 2011-06-15 14:01 -0400
          Re: Android—Why Dalvik? BGB <cr88192@hotmail.com> - 2011-06-08 22:46 -0700
          Re: Android---Why Dalvik? Michael Wojcik <mwojcik@newsguy.com> - 2011-06-11 13:39 -0400

csiph-web