<?xml version="1.0" ?>

<kc>

<title>GNUe Traffic</title>

<editor contact="mailto:psu@burdonvale.co.uk">Peter Sullivan</editor>

<issue num="113" date="24 Apr 2006 00:00:00 -0800" />

<headquote>
#gnuenterprise tackles existential philosophy - 
the meaning of 'self'
</headquote>


<intro>
  This newsletter mainly covers the the #gnuenterprise IRC channel, 
  with occasional coverage of the three main mailing lists 
  (gnue-announce, gnue and gnue-dev) for the 
  <a href="http://www.gnuenterprise.org">GNU Enterprise</a> 
  project.
</intro>


<section 
   title="Trigger namespace and the self property"
   subject="[IRC] 18 Apr 2006"
   archive="http://www.gnuenterprise.org/irc-logs/gnue-public.log.2006-04-18"
   author="Peter Sullivan" 
   contact="mailto:psu@burdonvale.co.uk" 
   startdate="18 Apr 2006 12:00:00 -0800"
   enddate="20 Apr 2006 12:00:00 -0800">

<topic>Common</topic>
<topic>Forms</topic>

<p>After a long discussion about using pylint to help enforce coding 
standards for GNUe (and hence minimise the number of bugs), 
Reinhard M&#252;ller (reinhard) asked <quote who="Reinhard M&#252;ller">about 
trigger namespace</quote>, as previously discussed in 
<kcref title="Trigger namespace in Forms" subject="[IRC] 14 Apr 2006" />. 
He had originally changed the code to require references to trigger
objects in the current Form to be in the format 'formname.object()' 
or 'self.object()', rather than just 'object()'. But he had changed 
this back again pending further discussion, for fear of breaking 
all of James Thompson's (jamest) existing form designs. James said 
that, in forms that he had designed, he normally used the 
fully-qualified 'formname.object()' syntax anyway, not either 
'self.object()' or 'object()' - he had found that these last two 
had proved problematical in the past. Reinhard noted 
<quote who="Reinhard M&#252;ller">any feedback welcome - I think nobody 
uses triggers as much as you do</quote>. James confessed 
<quote who="James Thompson">i luvs my triggers</quote>.</p>

<p><a href="http://www.gnuenterprise.org/irc-logs/gnue-public.log.2006-04-19">The 
next day</a>, Reinhard noted that <quote who="Reinhard M&#252;ller">self 
in named triggers now works fine - it's always the object that fired 
the trigger</quote>. Jason Cater (jcater) gave an 
example where the same trigger code might be fired from different 
objects in different blocks. Reinhard agreed that 
<quote who="Reinhard M&#252;ller">you wouldn't use &quot;self&quot; in such 
a case - except for maybe</quote> debugging-like purposes (i.e. to 
find out which object had called the trigger). Jason suggested using 
an idea from Zope, and having both <quote who="Jason Cater">self == what 
the trigger is &quot;bound&quot; to</quote> and 
<quote who="Jason Cater">context == what is calling the 
trigger</quote>. Reinhard felt 'self' might be better to refer 
to the object calling the trigger, not the object containing 
the trigger code - <quote who="Reinhard M&#252;ller">anybody writing 
the trigger code *knows* where he puts it</quote> but 
<quote who="Reinhard M&#252;ller">if the trigger can be fired from 
different objects - there is no way of finding out from where it was 
fired</quote> except by checking. Jason was not disputing that 
knowing what called the trigger was typically more important, he 
was <quote who="Jason Cater">just questioning whether &quot;self&quot; 
has a loaded meaning and would confuse those beginning to code 
gnue triggers</quote>.</p>

<p>Jason also noted that <quote who="Jason Cater">the cool part 
about that is if you have code that needs to happen both on a 
pre-insert and a pre-update - but only a few lines of the code is 
different</quote> - you could have one block of trigger code that 
used self.action to find out <i>why</i> it had been called and 
branch accordingly.</p>

<p><a href="http://www.gnuenterprise.org/irc-logs/gnue-public.log.2006-04-20">The 
next day</a>, James noted that <quote who="James Thompson">in 
the old forms namespace - you could do a startup trigger</quote> that 
declared a global object and used it to import a module of trigger code, 
which was then available globally to any other trigger in the form. 
<quote who="James Thompson">that no longer works - which will break a 
ton of stuff for me :)</quote> Reinhard said 
<quote who="Reinhard M&#252;ller">it actually works for me - I wonder, 
does your case invove any dialogs?</quote> As he wondered if 
James' problems could be a side-effect of when 
<quote who="Reinhard M&#252;ller">dialogs got their own global 
namespace</quote>.</p>

</section>


<section 
   title="Manually creating triggers"
   subject="[IRC] 19 Apr 2006"
   archive="http://www.gnuenterprise.org/irc-logs/gnue-public.log.2006-04-19"
   author="Peter Sullivan" 
   contact="mailto:psu@burdonvale.co.uk" 
   startdate="19 Apr 2006 12:00:00 -0800"
   enddate="19 Apr 2006 12:00:00 -0800">

<topic>Common</topic>

<p>Reinhard M&#252;ller (reinhard) asked <quote who="Reinhard M&#252;ller">I 
wonder whether you use manually created GTrigger instances - 
(i.e. not defined in an XML file</quote> such as a .gfd GNUe Form 
Definition or .grd GNUe Report definition), noting that 
<quote who="Reinhard M&#252;ller">GTrigger.__init__ provides a way to 
directly initialize with type, name, text, language - which would 
only make sense at all if an instance is created manually</quote>.
James Thompson (jamest) said that <quote who="James Thompson">iirc 
we wanted triggers to be useful outside of xml files - we've just 
never documented the feature so no one does it I'd imagine</quote>. 
Reinhard was <quote who="Reinhard M&#252;ller">not sure if it would be 
easy to use triggers outside XML files anyway - as much of the 
trigger code is tightly connected with GObj et al</quote>. James 
noted that one possible use for triggers not in an XML file 
would be unit testing, as discussed in 
<kcref title="Test/Sample database for GNUe" subject="[IRC] 11 Mar 2006" />.</p>

</section>


<section 
   title="Spring cleaning for redundant code in GNUe Common"
   subject="[IRC] 19 Apr 2006"
   archive="http://www.gnuenterprise.org/irc-logs/gnue-public.log.2006-04-19"
   author="Peter Sullivan" 
   contact="mailto:psu@burdonvale.co.uk" 
   startdate="19 Apr 2006 12:00:00 -0800"
   enddate="19 Apr 2006 12:00:00 -0800">

<topic>Common</topic>

<mention>Reinhard M&#252;ller</mention>

<p>Reinhard M&#252;ller (reinhard) asked what the GBinary and 
GParserMultiplexor code in GNUe Common was for. Jason Cater
(jcater) explained that <quote who="Jason Cater">GBinary is a way 
to store images, etc, in an XML file - it would save an icon or 
whatever resource in mime64 (or whatever)</quote> - for example, 
for use in GNUe Reports. However, GParserMultiplexor was now 
redundant - <quote who="Jason Cater">python's new-style classes 
would've done what I was going to do with GParserMultiplexor - 
so even if I got back around to that, it'd be done 
differently</quote>. Reinhard volunteered to remove this.</p>

</section>


<section 
   title="Proposals to Refactor the GObjects code in GNUe Common"
   subject="[IRC] 19 Apr 2006"
   archive="http://www.gnuenterprise.org/irc-logs/gnue-public.log.2006-04-19"
   author="Peter Sullivan" 
   contact="mailto:psu@burdonvale.co.uk" 
   startdate="19 Apr 2006 12:00:00 -0800"
   enddate="19 Apr 2006 12:00:00 -0800">

<topic>Common</topic>

<p>Reinhard M&#252;ller (reinhard) asked about <quote who="Reinhard M&#252;ller">the 
concept behind GObj and ParserObject - or, more specifically - 
where ParserObject ends and where GObj starts</quote>. 
Jason Cater (jcater) said that the basic principle was that 
<quote who="Jason Cater">ParserObj is anything that could be 
represented by XML - including GObjects, text content, and xml 
comments - and GObjects are strictly objects that are of concern 
to a GNUe document</quote>. He clarified that originally 
<quote who="Jason Cater">ParserObj just held code that was 
shared by GObj and GContent - but it seems to have grown in 
scope</quote> since.</p>

<p>Reinhard explained that his reason for asking was that 
<quote who="Reinhard M&#252;ller">I have been playing with the idea 
of extracting some stuff from there into a new class hierarchy 
that might be reusable for other stuff</quote>. Jason said that 
he would love to see <quote who="Jason Cater">the separation of 
the document structure and the document storage logic - right 
now GObjects are really xml-centric, from their creation to the 
way data is stored in them</quote>. But <quote who="Jason Cater">I've 
always envisioned GNUe supporting storage &quot;formats&quot; other 
than XML - such as storing in a database table (and I don't just 
mean storing marshalled XML). But even if we never did support 
more than XML - I'd like GObject creation in Python scripts to be 
a little cleaner</quote> and less XML-specific.</p>

<p>Reinhard explained what he had been thinking about - 
<quote who="Reinhard M&#252;ller">1. a base class for a tree structure, 
providing everything that deals with the tree structure in 
principle, like getParent, getChildren, children iterators, 
walk(), findParentOfType etc - 2. derived from that, a class that 
adds XML on top of it, adding things like parser magic, dumpXML, 
namespace magic etc - 3. on top of that, a class that adds in other 
stuff used in gnue, like triggers, namespaces, events - 4. a GObj 
to remain compatible with the old structure</quote>. He noted 
<quote who="Reinhard M&#252;ller">1 &amp; 2 could be completely independent 
of the rest of gnue - so it might match your goal by at least 
having all XML related issues in a single place - and it might also 
match jamest's long term idea of &quot;decoupling&quot; gnue-common 
parts from each other</quote>.</p>

<p>James Thompson (jamest) said that <quote who="James Thompson">i'd 
thought about 1 at the least - as gobj is bloated - and I'd think 
it usefull for the base of menus and such</quote>. Reinhard 
noted that including item 4 would allow for backwards-compatability, 
at least in the medium term. Jason noted <quote who="Jason Cater">I 
have a laundry list of things I wish were done differntly with 
GObjects - but couldn't change as it'd break stuff - (but you're 
proposing a migration object, so I can wish out loud now :)</quote>.
Reinhard and Jason discussed some detailed tidying-up that they 
would like to do, now that breaking compatability with the old 
GObject was not an issue, finding that they had very similar 
ideas in most cases.</p>

<p>Reinhard added that he <quote who="Reinhard M&#252;ller">would like 
objects to be more &quot;self-contained&quot; and 
&quot;self-defined&quot;</quote>, in that 
<quote who="Reinhard M&#252;ller">classes could have class variables 
defining what we now have in getXMLelements</quote>. Jason agreed - 
<quote who="Jason Cater">it would keep designer cleaner - 
as designer uses those attributes a lot</quote>. James felt 
<quote who="James Thompson">that should make the G*Parser unnecessary 
in most cases I would imagine - at least the huge arse 
dict</quote>. Jason noted that <quote who="Jason Cater">originally, 
GParser was very simple and loaded and XML file and created GObjects
- not much else - but the definition dicts were expanded to include 
parent information, requirements, defaults, etc - because designer 
needed that information - but GParser was never updated to enforce 
what the definition dict listed (I fully intended to, just never got 
around to it)</quote>. Reinhard fully appreciated 
<quote who="Reinhard M&#252;ller">that it's a system that has grown - 
probably grown much over what it was designed for from the start in 
many aspects - and I'm proud that I'm the one to get the honor of 
restructuring these aspects to be clean again</quote>.</p>

<p>Jason was <quote who="Jason Cater">so glad appserver is 
python/gnue-common based now</quote>, in line with the other 
GNUe Tools - it had originally been a stand-alone tool written 
in C. Reinhard asked <quote who="Reinhard M&#252;ller">are you sure? I 
would probably never have touched gnue-common otherwise ;-)</quote> 
Jason admitted that <quote who="Jason Cater">the one crappy part of 
changing GParser - is that I have quite a few projects inhouse that 
use GParser to create object trees - that I haven't looked at in ages
(but just work)</quote>. Reinhard said that these 
<quote who="Reinhard M&#252;ller">might generate usable feedback - 
if these projects turn out to become easiser, more straightforward 
with the new classes, the it's good - if things get more complicated 
with the new classes, we have wrong design decisions</quote>. In 
any case, having a GObj to remain compatible with the old structure, 
as discussed above, should <quote who="Reinhard M&#252;ller">make a soft 
break for the &quot;logic&quot; changes - i.e. gnue-common should be 
100% compatible for now - I have planned to add depreciation warnings 
for old stuff with gnue-common 0.7 - and remove depreciated stuff 
with 0.8 - which will be not earlier than in a year or two - so 
people really have time to convert their apps</quote>.</p>

<p>Following on from 
<kcref title="Forms approaching version 1.0?" subject="[IRC] 13 Apr 2006" />, 
Reinhard thought that <quote who="Reinhard M&#252;ller">common is really 
approaching a state that I think calling it 1.0 would be justified 
(after all these changes we talked about now, of course)</quote>.</p>

</section>


<section 
   title="Checking list of values for data types"
   subject="[IRC] 20 Apr 2006"
   archive="http://www.gnuenterprise.org/irc-logs/gnue-public.log.2006-04-20"
   author="Peter Sullivan" 
   contact="mailto:psu@burdonvale.co.uk" 
   startdate="20 Apr 2006 12:00:00 -0800"
   enddate="20 Apr 2006 12:00:00 -0800">

<topic>Forms</topic>

<p>James Thompson (jamest) asked if GNUe Forms was now 
<quote who="James Thompson">validating the typecasts in fields</quote> 
as he was now getting an <quote who="James Thompson">XML markup error
- 'datetime' is not valid for typecast-attribute which allows these 
values only: 'Default', 'Description', 'ValueSet', 'Typecase', 
'Label'</quote>. Johannes Vetter (johannesV) said 
<quote who="Johannes Vetter">this is because the options defined in 
a ValueSet will be checked now</quote>. James agreed, but said that 
the error message was wrong - the list of allowed values
<quote who="James Thompson">look more like gparse dict keys</quote> 
than a list of valid data types. Johannes found and fixed this bug.</p>

<p>Later, James noted that the list of valid data types was 
just <quote who="James Thompson">date, text, number</quote>, adding 
<quote who="James Thompson">i thought we did a datetime too</quote>. 
And <quote who="James Thompson">what about boolean - i swore boolean 
worked</quote>?</p>

</section>


<section 
   title="Dialog boxes in GNUe Forms"
   subject="[IRC] 20 Apr 2006"
   archive="http://www.gnuenterprise.org/irc-logs/gnue-public.log.2006-04-20"
   author="Peter Sullivan" 
   contact="mailto:psu@burdonvale.co.uk" 
   startdate="20 Apr 2006 12:00:00 -0800"
   enddate="20 Apr 2006 12:00:00 -0800">

<topic>Forms</topic>

<p>Reinhard M&#252;ller (reinhard) asked <quote who="Reinhard M&#252;ller">if 
a trigger is defined within a &lt;dialog&gt;, what should 
&quot;form&quot; point to in your opinion? the main form, or the 
dialog?</quote> James Thompson (jamest) said <quote who="James Thompson">it 
should point to the dialog form - all &lt;dialog&gt; is is an alias for 
&lt;form type=&quot;dialog&quot;&gt; or some such</quote>. Reinhard 
noted that this would mean <quote who="Reinhard M&#252;ller">there would 
be no way to access the main form from within a dialog</quote>. James 
said that the proper way for a dialog box to communicate with the form 
that called it was <quote who="James Thompson">via the activateDialog() 
function</quote>. This was so that <quote who="James Thompson">dialogs 
would be self contained with a standard API</quote>. That way, the same 
dialog could easily be hooked into multiple forms if required.</p>

</section>


</kc>