Objects and Process Control :
An Engineering Viewpoint
Objects and Object Oriented Programming: An engineers viewpoint!
When Object Oriented Programming first appeared, it was heralded as the most significant advance in computer technology since the semiconductor chip. Why then, we ask ourselves, do we engineers still find ourself using applications like Excel and Visual Basic and not the supposedly rich Object Oriented environment?
Ok so the computer programmers seem to have taken to Objects like ducks to water, but we engineers are still watching the show from the shoreline! Before we answer this, let's look briefly at what we mean by Objected Oriented Programming.
What do we mean by Object Oriented?
Most engineers (myself included) have a pretty murky idea of what Object Oriented Programming is all about. Here then is a thirty second overview of Object Oriented programs (compared to procedural language) and some examples of how it could apply to Process Control.
Essentially, instead of making a list of steps or procedures that a program must sequentially run through, in Object Oriented Programming, we create classes or templates that bundle together properties and behaviours that represent the real-life objects.
For example, if we are writing a program to optimize the performance of a machine, we create a class called "Machine". The Machine class has various attributes or properties and various methods or behaviours associated with it. In other words, the Machine Class or Template will perform exactly like the real thing. This is so diabolically obvious that one wonders why we haven't been programming like this from the start.
Once we have created the Class (or template) we can now create hundred of machine objects based on this class....and each will behave just like the template.
But what happens if we have a new machine that is slightly different to the other machines? Well, instead of writing a brand new program, we create a new class that inherits all the properties and behaviours of the existing class and all we do is add the new properties or behaviours for the new kind of machine. In other words, we only need to program what is different in the new machine, not the whole machine.
So what are the advantages of working with Objects instead of Procedures?
Programs written in Object Code are:
- Much more flexible and expandable
- Easier to maintain and enhance
- More scalable
- Have a longer life
- Are easier to Understand because the program works like we think and looks like the real thing.
- Are more compact etc.....
As engineers however, one of the main advantages are that the object oriented paradigm has an amazing fit to our process control environment. It does not take a rocket scientist to see how we can create classes that represents machines, vessels, instruments, pipes, workers, raw materials etc. Once these classes are created, the programs that use them become significantly simpler and we are well on our way to having applications that will grow steadily and reliably with our needs.
If the Object Oriented Paradigm offers so much, why are we engineers still using Excel and VB?
The main reason for us being confined to the "procedural prison" is that the tools for creating object based applications have been (up till now) relatively cryptic and are more difficult to use than their procedural counterparts. With power comes complexity and our project ends up in the "too hard" basket. We engineers are often under extreme pressure and we just don't have the time to learn the details of a new programming language.
So where is the technology going .....
Various significant rumblings in the industry are currently taking place that are (at last) opening the door to this technology.
New applications are coming on the market that enable us to get the power of Object Orientation without having to write the code. The objects are displayed graphically and we can create new objects by just dragging them into a work area. Although this is not programming, it gives us the feel for just what is possible and makes us think in the Object paradigm.
Even more significant, programming languages like Python and Java are becoming increasingly easier to use and more importantly, the development environments are becoming simpler and more intuitive so that we can clearly see what is going on. Python in particular is a simple yet powerful language, it is free, it is open source and it is interpretive. This means we can learn it quickly and without breaking the bank.
.... and how can we become part of it?
If you are interested in the Object Oriented paradigm there is a free on-line book on the subject obtainable here. (How to think like a Computer Scientist).
However, the best way to learn is to just dive in and start programming. (Obviously not for the faint hearted.) We recommend you choose a fun (but extremely powerful) language like Python as the basis. You can download the language for free from the official web site and also download the tutorial here. (They claim you can learn the language in an afternoon!)
View the on-line Demo
Please send me more information
Click here to view our Price List.
|