LabVIEW Development Best Practices Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

A Call for Better LabVIEW Design Patterns

Hi Guys

Since it looks like you all like design patterns, I’ll give you a preview of the features I’ll like to show you at NI-week. It’s an easy way of adding design patterns to LabVIEW using the UML modeller.

In the example below I ‘m made a RTF-document reader class, which needs to be able to convert the text to different types, but the number of types I need to support is open-ended.

Builder1.png

So I’ve heard of the design pattern called builder that solves this, so I right click on my class and selects “Apply Design patterns…”

Builder2.png

I select the GoF’s Builder pattern, press OK, update the UML diagram with what names I like to call the Builder and ConcreteBuilder classes.

Builder3.png

See you next week guys.

Cheers,

Mikael

0 Kudos
Message 51 of 56
(1,883 Views)

Mikael, I'm very interested to see this in person!  I don't suppose you could share what the code that it generates look like?

Elijah Kerry
NI Director, Software Community
0 Kudos
Message 52 of 56
(1,883 Views)

So far the UML modeller creates only classes accordingly to the UML class diagram with its attributes and methods.

It supports 4 different class templates so far (3 reference based, and one by value based=lvoop).
I’ve attached the project after a Class creation. These classes are all based on a reference DVR class template.

Currently the design patterns in the UML modeller is based on simple XML files, that describes the design. But it doesn’t support more advanced feature of how to implement the methods to get the pattern fully working right away.

But we have another feature that can do this, it’s a right click function GDS provides from the Project Explorer Windows when you selects a class. This is using a plug in architecture and anyone can implement these plug-ins.

Builder_Add_Dp.png

These design patterns plug-ins have a user interface to configure the pattern needed and then they can modify the class accordingly.

E.g. We have the active object design pattern that give the user the option to create a spawning VI and it also create the start and stop VI to handle the spawning VI.

ActiveObject.png

I'm looking forward to meet you all next week to discuss new things we need in LabVIEW to make our day to day job easier (and more fun).

Cheers,

Mikael

0 Kudos
Message 53 of 56
(1,883 Views)

Darn that I didn't catchup on this thread before NIWeek..

I think a book about Design Patterns especialy catered to LV is an awesome idea!

I'd be happy to contribute some stuff. My special interest lies in Active Object, Command and Factory pattern, but I'd be happy to take the deeper dive into other patterns as well. In the interest of the community and just because it's fun.

0 Kudos
Message 54 of 56
(1,883 Views)

I am interested in contributing too. Please keep me in mind.

Also, if you decide to create a new community for this, please let us know, so we can suscribe.

Fab

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
0 Kudos
Message 55 of 56
(1,883 Views)

It is great to see such a high level of interest regarding the definition of design patterns.  We've actually formed a cross-department group of internal LabVIEW experts at NI to begin looking at publishing some of our ideas to this group.  We want to use the /largeapps domain as a forum for this discussion and collaboration with the community, as we want to foster feedback and new ideas.  Look for those soon!

Elijah Kerry
NI Director, Software Community
0 Kudos
Message 56 of 56
(1,883 Views)