LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Theoretical object oriented design question

Hi,

 

I am just getting into the design of some software that will take either one or two numbers and perform identical operations on them. It will then create a label that will be different depending on whether 1 or 2 serial numbers are used.

 

In the example it looks like I could make a vehicle class that would contain the serial number, and child classes for car, truck and boat that would define how the sticker was laid out.

 

The trouble I am having is that the control for serial number 1 and serial number 2 need to accept any of the three numbers for car truck and boat.

 

So I am not sure how to build classes to cover this, and what design pattern would be best.

 

So I am looking for ideas.

 

I have no real code yet to post, and a lot of the attributes are confidential, which is why I made the simple diagram.

 


design question.png

0 Kudos
Message 1 of 2
(2,128 Views)

Search this site for...

 

Factory Pattern

 

It basiclly uses a case sctructure to to select a Class constant of the proper type.

 

Have fun!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 2
(2,119 Views)