Hi All, I recently came along an interesting way to do an empty-check in a new project. They were using an object type decision instead of a regular decision for the empty-check. I was wondering if anybody else is using this and what the pro's and con's are of using this way over the regular way? Why would this or the regular way be used as a best practice?
asked
Lennart Bijl
3 answers
3
I consider that a misuse of functionality.
It's not really documented that this is a valid usage if the object is not a specialization/generalization.
The standard patter IS a decision with empty check.
It is not universally applicable (if your object actually is a specialization, you cannot only have the specilization outgoing path)
It confuses other developers
answered
Fabian Recktenwald
0
I use it too sometimes. It looks a little weird, but there is less chance you draw the true / false lines the wrong way. The moment will come where you forgot the ! in != empty and then use an empty object in the true flow.
answered
Martin Koelewijn
0
I use it a lot as I find it more obvious for simple empty checks after a retrieve of a single object. I like that it clearly shows what the object condition should be on the outgoing paths.