03-07-2012 03:11 PM
I'm new to OOP so forgive my basic question.
In this link, https://decibel.ni.com/content/docs/DOC-13709 the specification pattern is discussed. Since I'm new to OOP, it would help me to understand this by having an example. I can't find one and the link commits the famous error of assuming that we are all experts and so the pattern is too simple to merit an included example. The article talks about them being all over the place, so obviously I don't understand the pattern. Would someone point me to a specific example of this pattern? I am just learning class diagrams as well, so the illustrations I have seen using UML aren't breaking the logjam either.
Help?
03-07-2012 03:27 PM
I think it would better for you to start here: https://decibel.ni.com/content/docs/DOC-15014
This link will give you the basic for the LVOOP and has some examples.
If you have any question to LVOOP feel free to post them at the forum.
Once you get a better grib on LVOOP there are also a place on LAVA for LVOOP programming:
http://lavag.org/forum/26-object-oriented-programming/
There are some good discustion over there on LVOOP and design patterns with examples.
03-07-2012 03:31 PM
The problem might be that this pattern is so simple and prevalent that you don't even think of it as a pattern. Have you ever created a cluster that contains an enumeration and several different types of data, and used the enumeration to indicate which of the cluster elements has relevant data? For example, you might need to pass some communication parameters. Perhaps the enumeration has the options TCP and Serial, and the cluster contains elements for IP address and Port (relevant only for TCP) and Serial Port and Baud Rate (relevant only for serial communication). This is a case where you should have two different classes - one for serial, the other for TCP - and eliminate the enumeration.