On Jun 27, 2007, at 8:21 AM, Timothy Wall wrote:
The current state of member/class access is not written in stone,
but mostly as restrictive as possible to communicate to the user
which classes they really need to be looking at. We're trying to
drive the API by actual usage, which unfortunately is limited right
now to Wayne's gstreamer work and my various experiments with
various w32 and X11 APIs.
Uhhhh, I'm actually using JNA, mostly starting within the past week.
Mistake? Hope not. So far it looks good.
I've already got Interfaces to three .dlls, containing in total 90
methods.
I'll have at least two more .dlls thrown into the mix within the month.
I went ahead with the solution sketched by Wayne ("delegate").
I skipped the type mapping, at least for now, as I see no real
benefit from it in my case. (It would have been just as hard to get
all the type mapping correct as it was to get all the method
arguments correct. The code I ended up with is more direct and
obvious to any strangers who might wander in and look at my code.
Plus, I'm in a hurry...)
I still think the subclassing would have been okay for some (but not
all) of my usages (assuming the necessary JNA methods had been
changed from "package private" to "protected"). I understand now
what Wayne meant about the inheritance of all the spurious JNA-
specific methods, and am sympathetic. But not all of the handles
returned from .dll methods wander too far through my code.
In spite of all the chin-scratching and tinkering with this or that
usage of JNA you may have seen from me, I'm generally pleased with
the ease-of-use of JNA, and the resulting appearance of that part of
the project.
- Ben