How it is working on a 30-year-old application

S.Z., Software Development Consultant

Careers

20.10.2020.

featured image

We have a new client who needs developers that have used WPF before. It’s a German company with headquarters in a small town near Frankfurt.

They work with many companies in the textile industry that use a variety of machines for which they need sensors and automation-related stuff that they make. Some of these are several generations of PLCs and they install a bunch of them on those machines. The PLCs are connected to HMIs – which they also make – and they have several generations of them, as well. Communication with HMIs to which the PLCs are connected is made via applications that are part of a MES type of information system and everything is ‘overlooked’ by their ERP application. You and your future colleague would maintain both MES and ERP and extend them with new functionalities.

They use Btrieve and SQLite along with C++ and MFC in old applications which are mostly converted to C#, WPF, WCF and MSSQL. Mostly.

Oh, and the development of the application you will be working on was started back in 1992. And it went through several really breaking changes but nevertheless kept backward compatibility with Windows XP/Windows Server 2003 and even some older OSs. Also, you’ll find all of the custom-made source code was written by several generations of programmers. And their latest gen of HMI UI is written in HTML5/CSS3/JS.

Are you interested in working for them?”

Zoran Kovačević, Technical director

For someone that had just finished his career in the financial industry and thought that he understood complexity, this was a shocker. So many technologies that are old in terms of being used in present times are successfully used in an international German company today. This is where our very interesting journey as software developers in Serengeti’s extension team started.

The first thing that was awesome is that it worked together cohesively. Everything was finely tuned from the machine-controlled parts to the user-controlled parts of the system. The machine rings an alarm, it shows up on the user’s screen. The user wants to set actions through a web application interface that will then be executed on a machine – and the machine will execute it. In a millisecond.

Older applications made for the first generation of PLCs and HMIs were used on old operating systems. Nevertheless, these same applications were successfully integrated and used with the industry standard technologies of today. They are written in C++ and MFC and use Btrieve for persistence. They aren’t pretty, but they run fast. This was one of the most noted issues with very old users converting to new applications that were written in C# and WPF. To them, new was pretty and shiny, but slower when compared to old applications. And that is one of the somewhat difficult tasks when converting old to new.

As a programmer, you rarely think about ‘really old’, especially when adding new functionalities that are meant to be used in older applications. Optimizing a two decades backward-compatible application can be tricky. So, a compromise was worked out. Let us use some great functionalities from new applications along with some from old ones by creating interop libraries that are used for communication between new and old. With some C++ magic and some C# magic you have an optimization of the new and the old, where the old gets some nice new functionalities. And the rest is history.

However, not everything can be implemented in this way. Especially when reading old configurations with important data – they can’t be that easily changed because this would, in some cases, mean replacing old PLCs and HMIs with new ones. And that was out of the question for most of their clients. So an application was made that served, again, as a bridge between old and new. This application was a WCF service that had access to old configurations – some of which were written in the 90s, while the newest ones were in databases.

Since the technology stack of the applications (MEF and ERP) mostly consists of desktop-based technologies that include .NET, WPF, WCF and MSSQL, our client wanted to test integration with newer technologies like Angular and .NET Core. All in hope that integration would be possible when there was time and need for it. And it was. Although the code was old and sometimes clunky, we successfully integrated older application parts with the newer ones and it was truly a great feat.

It was great because it showed us that no matter how old an application is, sometimes you don’t need to write it from the ground up just because there is ‘a new kid on the block’. However, you should perhaps take what the old technology has to offer and find the best way to integrate it with the new stuff.

If you would like to join us, feel free to check open positions

RELATED

15.10.2020.

Geti Champions Get Together

Since the coronavirus crisis stopped us in our initial idea to have monthly gatherings, and it seems it’s not going to stop anytime soon, we decided to organize an autumn meeting. Of course, all was in line with epidemiological measures – mask and all.

Read more