r-code files for classes

Posted by Darren Parr on 16-May-2017 09:24

Hi

I don't know if I've asked this before but we are struggling with how to deal with changes to class files and what we should compile after a change and what we should put on site.

I know OE recompiles the parent class file to a class when it compiles it. We want a situation where we can generate list of class files and procedures that point to these class files based on a single class file change. At the moment we just take every xref reference that points to a class that we need to compile and ensure we compile all of those files too.

So for example say we change child.cls and that inherits from parent.cls, and we have test.p which references the child class, we currently force a compile of parent.cls and test.p. We then transfer all 3 files to site when we technically may not need to. We're worried about a compilation out of date message which only occurs when we've changed the public signatures of the classes.

So as things stand we treat any xref references as an indicator to compilation. How can we detect this better?

Before anyone points in the direction of other SCM's its worth noting that our SCM is deeply embedded into our environment and cannot be changed for all sorts of different reasons.

Thanks

Darren

Posted by Mike Fechner on 16-May-2017 09:56

OE version/service pack upgrade for instance.
 
So point proved. R-code will change and rules are hardly predictable and rules may change in future OE releases without any warning.
 
rcode-info:md5-value is safe.

All Replies

Posted by Mike Fechner on 16-May-2017 09:29

The safe way that tells you if you need to redeploy an r-code is rcode-info:md5-value.
 
I’d keep a list of the md5-values of all r-codes in a list (db-table, xml, json, plain text file) and after your full recompile, compare the stored md5-value with the new ones of the files on disc.
 
That’s the purpose of that functionality.
 
Everything else is just guessing.

Posted by Peter Judge on 16-May-2017 09:33

Just make sure that you add the GENERATE-MD5 option to the COMPILE statement

Posted by Jeff Ledbetter on 16-May-2017 09:36

OpenEdge will automatically compile the super classes.  We (Roundtable) compile subclasses and other Objects affected by the class change automatically based on stored xref data.

Posted by Mike Fechner on 16-May-2017 09:40

Does RTB also compile classes, when the assemblies.xml changes ?

Posted by Jeff Ledbetter on 16-May-2017 09:47

Would the assemblies.xml change without any code changes?

Posted by Mike Fechner on 16-May-2017 09:56

OE version/service pack upgrade for instance.
 
So point proved. R-code will change and rules are hardly predictable and rules may change in future OE releases without any warning.
 
rcode-info:md5-value is safe.

Posted by Jeff Ledbetter on 16-May-2017 10:01

I didn't realize that you were out to prove a point (which I'm not sure that you have), but okay.

Posted by Mike Fechner on 16-May-2017 10:03

And even without an OE upgrade … referencing an upgraded version of a 3rd party assembly.
 
Also without GUI for .NET, we all have seen service packs or hot fixes that required a recompile to apply / fix a certain issue. This will also require deploying r-code without changes to the source code.
 
SCM is not the answer to everything 😊 (it is the answer to a lot)
 

Posted by Mike Fechner on 16-May-2017 10:14

[quote user="Jeff Ledbetter"]

I didn't realize that you were out to prove a point (which I'm not sure that you have), but okay.

[/quote]
Point is, that just looking at the source code and derived data (like xref) is not sufficient to know if the r-code requires to be redeployed or not (which is the question that started this thread). 
Only if you make many assumptions about what is not supposed to change. 
And I didn't even start talking about compile time startup parameters which may have impact on the r-code.

Posted by Etienne Begin on 16-May-2017 10:47

Sometimes compiling the entire codebase feels like the only safe way.  Some shops do it nighly in their sandbox environment and report changes on binaries.  

You can try to predicate what needs recompiling all you want with grepping, xref etc.  The developer must decide what needs compiling, and you must detect what was missed with testing, utilities... or by comparing a complete build of the application and see the true differences.

I have not yet seen an approach which can tell me what needs recompiling under all circumstances.  Even in your case.

When I upgrade OE versions for a codebase that was not entirely compiled in 15 years I always feel a bit uneasy :)

Etienne

Posted by Jeff Ledbetter on 16-May-2017 11:11

"..not sufficient to know if the r-code requires to be redeployed or not (which is the question that started this thread). "

I didn't see a question about deploying r-code in his question. I was simply answering the xref can be reliable (it has proven so for us).  Thank you for monitoring my responses though.

This thread is closed