Re: [java-gnome-hackers] Libraries vs Packaging (1): Linkage
Brought to you by:
afcowie
From: Francisco O. <fr...@pu...> - 2011-06-02 15:35:50
|
Continuing with the aside > As an aside, > > On Wed, 2011-06-01 at 14:19 -0300, Francisco Ortiz wrote: > >> - using a factory: its a derivative of the previous one, but cleaner. >> The factory is responsible of provide the correct implementation, it >> will return a class that implements an interface which can be the real >> implementation or the mocked/not supported by the system one. Again , >> its more code but cleaner. > > If we had done an interface based design for 4.0, as I originally > considered, then this would be a snap. But interfaces didn't work out, > and changing our entire public API to interfaces-only at this point > would be ... messy. Like 5.0 messy. > http://java-gnome.sourceforge.net/4.0/doc/design/5a-Architecture.html Its definitely a 5.0 kind of mess. I remember i read that part one year ago and you get stuck with the JavaDoc issue. Did you check the {@inheritDoc} tag?. Check this article: http://firstclassthoughts.co.uk/java/javadoc_documentation_inheritance.html maybe can be useful for that. > My thinking about this has come from the other side. My guess was that > the thing to do would be to put an individual loadNativeLibrary() call > in each package's Plumbing class's static { ... } block, rather than the > single all-encompassing master one down in > org.freedesktop.bindings.Plumbing's. > > That would mean that the only libMODULENAMEjni.so that get loaded would > be those corresponding to modules you actually use as a developer, which > corresponds to the lazy loading of Java classes on the JVM side. Good. > My concern is the case where the user tries to use the java class without the library. Should we create a mocked implementation o throws the runtime exception? > It means more .so shared libraries. Lots more. Some people tell me > that's bad. Other people tell me not to worry about it. > > So I was thinking about our Java package space, but a better level would > presumably be pkg-config space. I didn't check how bad that is, but I think not *all* the dependencies should be modularized, only the optional ones. Anyway need to get my hands in the code to get more answers. |