Formula Abstraction Layer

Recently we started a new project with measure and math that have different behavior for a same output. The requirements is to have at runtime the measures and calculated data in SI (International System) and IP (Imperial/Pounds) and need to use two different standards and a customs for same conditions.

Ok, this is the place where take place the concept must used in OOP, the “Inheritance”, to create an “Asbtraction Layer” that separate the application from the specific Programming.

In the picture below the first class don’t have any formula or code inside and data inside. Only shared data with the application is accessed by Class Accessor.

It becomes convenient to use the abstraction approach, when we therefore have common data that needs to be transformed differently.

Each method under the child class is a single formula and only calculation method is overriden from the parent class. Each Method dont have terminal for data access.

Each class have own data, that is accessed by accessor vi inside the class.

Each Calculation is a method of the class overrided from the Abtsract Class. Data are exposed with accessor.

The aim of this article is to promote the advantages to use OOP in our application, for more detail about Abstraction and Inheritance you can follow the link below.

Abstraction Layer

HAL labVIEW

Inheritance in labview

ti potrebbero interessare

Design Pattern #2 – Simple State Machine

Ogni programmatore è alla ricerca di un modo più rapido e semplice per sviluppare software, uno strumento adatto è la macchina a stati.

Labview Wait and Wait Until Next multiple.

In labview sono utilizzate per inserire un ritardo, ma non lo fanno allo stesso modo e hanno scopi di utilizzo diversi.

CLA SUMMIT EUROPE 2019

Ogni anno National Instruments ospita il Summit Certified LabVIEW Architect (CLA) negli Stati Uniti e in Europa.L’evento riunisce programmatori NI LabVIEW per discutere di architetture, visualizzare in anteprima nuove funzionalità

Vuoi approfondire l'argomento? Hai un progetto e stai cercando un Team che ti possa supportare?