Dual maintenance


I apologize if this is addressed in the forum. I may not have used adequate search criteria as it is a general development approach question.

Recently, we did maintenance to a portion of the code on a project. Our client runs many different ignition projects. Another project had the same window and related code, not because it somehow referenced the same window and code, but rather because it was copied into the second project from the first. In reviewing the window and it’s related code I find it has several custom tags that use the expression language, and python code to handle events. The result of the manner in which this is implemented results in the need for dual maintenance. I am curious what the “right” way was to share this window and its related code between two projects?

It’s a tad hard to say without knowing more about the exact variations between the project, but there certainly is one key feature that was introduced in 7.7 that can help: shared scripts. Previously, having the python code duplicated was your only option. Now with 7.7, you can write functions in the “shared” space, that are used by multiple projects.

For the expression/tags… tags are already shared, or if each project is using its own tag provider, you might choose to make an additional tag provider for the shared tags. The expressions are on the window level, and unfortunately you can’t “share” a window. However, what you can do is “send” a window to other or all projects, replacing the copy there. So what I’ve seen some people do is create a “Resource Master” project that contains the core definition of templates and windows, and then push them out from there to all of the projects that need them.

(I’ll point out that this methodology of sending copies out instead of sharing templates/windows was on purpose, because although it seems like a nice idea to share across projects, we got LOTS of strong feedback that people didn’t actually want this, because it leads to inadvertent changes)

Hope this gives you something to work with,