Showing results for 
Search instead for 
Did you mean: 

oop specification pattern example

I'm new to OOP so forgive my basic question.


In this link, 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.



0 Kudos
Message 1 of 3

I think it would better for you to start here:


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:

There are some good discustion over there on LVOOP and design patterns with examples.

Message 2 of 3

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.

Message 3 of 3