[Gambas-user] Issue 123 in gambas: GUI dependencies in library projects not exposing any gui dependency

gambas at ...2524... gambas at ...2524...
Tue Feb 7 01:24:24 CET 2012


Comment #3 on issue 123 by adamn... at ...626...: GUI dependencies in library  
projects not exposing any gui dependency
http://code.google.com/p/gambas/issues/detail?id=123

I'm not sure on whether that would help as I'm not clear on how both  
component and library loads work regarding dependencies.

I'll try explaining what I do understand and what I'd expect to see if that  
makes anything clearer.

By way of an example, I have three projects that I want to share with other  
projects:

phApplication3 - This is a moderately stable project that provides some  
basic startup automation for any project(settings, application login,  
database connecticty etc).  I currently only want to install it as a local  
gambas library until I get around to fixing a little used option in it.  It  
has internal dependencies on gb.settings, gb.db and gb.gui (and gb.form and  
gb.image). The project contains a single exported class and three forms  
that are used internally. The three forms in it are very simple and quite  
desktop agnostic. I have the Component Properties/Requires set with no  
features and the above 5 components. Lets say that he primary task of this  
project is to check whether the client project has a settings file and if  
so create database connections according to those settings. If the client  
project has no settings file for the user then it shows a form to allow the  
user to create the settings.
When this library is used in another project I expect that it takes care of  
its own needs in terms of the required components.  In fact what happens is  
this, I create a commandline project and add phApplication3 as a library.   
In the Main() I call phApplication.Init which is the public method in the  
exposed class that does all that initialisation stuff. When I run this it  
fails with a signal 11.  I then add gb.db as a component and now the  
program works correctly. Note that I have not added any gui component to  
this client project.  Now things get a bit messy. First I add gb.qt4 as a  
component to the client project. It now fails with a signal 6 error. So I  
change it to use gb.gui. Now it works. Finally, I change it to use gb.gtk  
(the default desktop here in LXDE) and it still works.
So in summary, with this library in a client project it appears to load  
some of the dependencies (the gui components used in the library and  
gb.settings) but not others (gb.db). In addition, if the client project gui  
component choice conflicts with the library gui component, the client  
project fails.

phDB9a - This is a complex project that essentially decouples the client  
application "business object" classes (BOC's) from their persitence  
mechanism. In short, it exports one class which is used as the parent class  
for all BOCs. The exported class provides Load, Save, Add and Delete  
methods that take care of all the database access for the BOC object. It  
has one feature of interest, it makes the application BOC object perform  
like a gb.db Result object, i.e. it can be iterated and accessed as an  
array.  At the moment this library is only implemented for Postgresql,  
Sqlite, text and XML "back ends" (MySQL is just too buggy!) so I don't make  
it as a component.  This library depends on the settings and connection  
management provided by phApplication3.  Thus the library required  
components are phApplication3 and gb.db (as loading phApplication3 does not  
load gb.db as seen above!).
This library also has some extensive internal testing code that uses forms.  
(This is where issue 123 came to be.)  Most importantly, none of that test  
code is exported nor used by any of the stuff accessed by a client project  
that uses this library.  The test code has to be in the library so we can  
debug it and step through it when necessary.  So currently we have to  
maintain two versions of phDB9a to avoid the gui conflicts (and there is my  
pain.)

phControls3 - This is a set of enhanced gui control classes that mainly  
tries to work around the gtk/qt4 inconsistences and adds some of my "great  
ideas" that make gui development easier :-) such as self labelling and  
event consistency.  This is a stable library and I have implemented it as a  
local gambas component, albeit with some problems with the automake  
template mentioned in another issue.  The only dependency I think I need to  
include is gb.desktop (as the gui library is taken care of by the client  
project).  This all appears to work and I do not need to add gb.desktop as  
a client project component.
So it seems that the component loads it's declared dependency automatically?






More information about the User mailing list