[Os-project-managers] Question about OSxLParserdata, OSInstance, OSOption

Horand Gassmann Horand.Gassmann at DAL.CA
Tue Dec 21 09:05:13 EST 2010


Horand Gassmann <Horand.Gassmann at dal.ca> wrote:

> Kipp Martin <kmartin at chicagobooth.edu> wrote:
>
>> Hi Gus:
>>>
>>> I probably should have asked this long ago, but I never really took
>>>  everything on board and then I forgot.
>>
>> First, a generic comment. One I have made before. OS is a project
>> evolving over time. Much of what you see in OSInstance was written
>> four years ago. My guess is that if you were to work on the OSoL
>> parser four year from now you might do things differently. The OS
>> constitution was not written on day 1 and then adhered to from day 1
>> over time. It evolved and is evolving. We are constantly learning
>> new and better ways to do things. I knew almost no C++ when I first
>> started OS.
>>
>> Now, with regard to the m_mxxx. Let's take as an illustration,
>> m_mdVariableLowerBounds.  Remember, Object Orient Programming makes
>> things SLOW. There is definitely a performance hit. Indeed we are
>> really getting clobbered with this in the nonlinear part of our
>> code. So let's look at for example, the method to get the variable
>> lower bounds. Here it is:
>>
>>
>> double* OSInstance::getVariableLowerBounds() {
>> 	processVariables();
>> 	return m_mdVariableLowerBounds;
>> }//getVariableLowerBounds
>
> I agree that this is faster. But remember what I wrote earlier about
> the danger of memory pollution? If you give the user access to your
> memory in this way, you run the risk that they overwrite your memory.
> I do not consider this safe.

Can I summarize the state of affairs as follows: The constitution  
requires OSInstance, OSResult and OSOption, but for efficiency it may  
be more expeditious to switch to a flat storage scheme. Is that fair?


Can I also ask about set() methods? I noticed that OSParseosil.y  
stores things into the OSInstance object directly; for example in line  
1109:

osinstance->instanceHeader->name = pelementText;

or in line 1440:
					osinstance->instanceData->variables->var[varcount]->lb
         = atofmod1( osillineno,attText, attTextEnd);

One of the things that is slowing me down is the endless writing and  
invoking of set() methods to get the data into the OSOption object.  
Was that even necessary? Should I have left in the old

osoption->general->serviceURI = $3;

in place of

if (osoption->setServiceURI($3) == false)
        osolError(...)


These are nagging questions, and I am more and more thinking that  
maybe Bjarni had it right all along --- that an XML schema with flat  
structure would have been a lot easier. (Witness:  
m_mdVariableLowerBounds, postfix notation, etc.)

I am getting more and more confused about this. It seems to be a  
*MAJOR* point to discuss on the 29th. BTW, I am not sure how we should  
handle that. I completely forgot that the university closes between  
Christmas and New Year (or rather, I forgot that we were this far  
advanced in the year already), so it looks like I won't have the  
conference call available. We may have to use skype instead.

Cheers

gus



More information about the Os-project-managers mailing list