11-11-2015 02:20 PM
I gave this presentation at the Bay Area LabVIEW User Group meeting on November 10, 2015 and thought it might also be interesting to a broader audience. You may find the original slide stack here.
Abstract
Error Clusters are one of the most frequently used LabVIEW features. Error Clusters did not evolve over the years, yet still provide adequate error handling support for smaller applications. However, developers working on larger projects with emphasis on reusable code need something more flexible and scalable these days.
Presentation goes over design of an Error Handling & Logging Library that uses Error Classes instead of Error Clusters - which allows adding custom error data and altering error handling/logging functionality without touching existing code.
Error Cluster wires are used to propagate both, native Error Cluster data and flattened Error Objects to Error Handling VIs without creating ripples throughout the code.
11-17-2015 12:14 AM
Hi Dmitry, I want to say thank you, recently I have started to look at LVOOP and this presentation is a great point to see how to make a good LVOOP Design; I just have a question, what is the criteria or how works the "Is_Valid" method at ArT_Error_Interface class?
I will continue reviewing the presentation, your articles are very interesting I would like to attend group meetings but unfortunately it is impossible given my location.
Thanks for your attention.
11-17-2015 07:12 PM
AYanez wrote:
I just have a question, what is the criteria or how works the "Is_Valid" method at ArT_Error_Interface class?
That’s a very good question …
Short answer:
ArT_Error_Interface class has a single private data item - Is Valid? (a boolean) and a public method Is_Valid, returning Is Valid? value to caller.
Long answer:
01-30-2019 10:01 AM
I realise this is an old post but I've been reading through the presentation to get ideas on building better error handling into my work, one thing I've not managed to puzzle out is this:
on the slide referencing the flattening and unflattening of ArT_Error objects you refer to generating internal errors if this conversion fails however the class performing this conversion is the ArT_Error_Interface class which on it's own has no capability of generating error objects - this is all done in the ArT_Host_Error (a child class) or the ArT class and it's children, could you shed any light on this or has your error strategy moved away from this methodology?
01-31-2019 02:33 AM
Hi IFW,
There is a more recent presentation on the subject: SOLID Error Handling I gave at NIWeek in 2017. It is based on this one (2015), but has an improved structure, ~30% new/updated slides and shows a “No Error” case frame on the flatten/unflatten slide you’ve been asking about.
on the slide referencing the flattening and unflattening of ArT_Error objects you refer to generating internal errors if this conversion fails however the class performing this conversion is the ArT_Error_Interface class which on it's own has no capability of generating error objects - this is all done in the ArT_Host_Error (a child class) or the ArT class and it's children, could you shed any light on this or has your error strategy moved away from this methodology?
Well, a simple answer is: ArT_Error_Interface class has a protected method Set_Internal_Error that is not shown on slide #20 since Protected virtual folder on the screenshot is collapsed …
I did not cover this part in any of the “Error Handling” presentations since
But since you’ve asked here is the Set_Internal_Error BD:
It creates and returns an “internal error” object. And, by design, this happens to be an instance of ArT_Host_Error class … Which brings us to the actual question:
How can a Parent class (ArT_Error_Interface) create an instance of one of its Child classes (ArT_Host_Error), without introducing a static dependency on such Child class?
Quite simple 😊 :
Hope this answers your question …