question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Overriding properties inline

See original GitHub issue

Like discussed in #822 it should be possible to override some attributes inline in a functionblock/entity.

Here some examples: Example1:

namespace com.ipso.smartobjects

functionblock Distance {

   status {
       mandatory sensor_value as float
       optional sensor_units as string 
       ...    
   }
}

Information model using the IPSO model and overriding it:

using com.ipso.smartobjects.Distance;0.0.1

infomodel MyDistance100MeterDevice {

   functionblocks {
       distance as Distance with {
            mandatory sensor_value as float <max:100>
       }
   }
}

Example2:

entity EntityA {
	mandatory valueA as int
	optional valueB as int
}
using de.vorto.EntityA;0.0.1

functionblock FunctionblockA {
   status {
       mandatory entityA as EntityA
       optional unit as string 
   }
}
using de.vorto.FunctionblockA;0.0.1

infomodel DeviceA {
   functionblocks {
       distance as FunctionblockA with {
            mandatory entityA as EntityA with {
            	valueA as int <MAX 100>
            }
       }
   }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:21 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
e-grigorovcommented, May 16, 2018

My understanding on this topic is that there are:

  • descriptions - that’s the data type description, function block description and info model description
  • description consumers - function block uses the data type descriptions, the info model uses the function block descriptions etc.

If this feature is integrated, no such thing like “description” will exist any more. The application has to merge the info model with the function block to find the function block complete description. To me, it’ll break the main goal of Vorto: clear models.

To compare with OOP, the subsclass should not change the contract from the base class - Liskov substitution principle

1reaction
thjaecklecommented, May 9, 2018

Do I understand correctly that by this I can no longer rely on that a functionblock always contains a well defined (and versioned) contract but that it depends on the context? And even worse I cannot rely on the defined entities because they may also be changed by the context (infomodel).

What is the point of a functionblock then if I cannot rely that it is the same when used in different infomodels?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I override inline styles with external CSS?
The only way to override inline style is by using !important keyword beside the CSS rule. The following is an example of it....
Read more >
Override Inline Styles with CSS
Often we think of inline styles as a way to override styles we set up in the CSS. 99% of the time, this...
Read more >
How to override inline styles with external in CSS
In this article, we are going to learn how we can override inline styles with external CSS. Generally, we use inline CSS to...
Read more >
How to Override CSS Styles - W3docs
You must place inline styles in the <body> of the HTML document, while embedded style sheets must be placed in the <head> of...
Read more >
How To Override Inline CSS With “!important” Property Using ...
This video is going to show you How To Override Inline CSS With “!important” Property Using jQuery.Subscribe to Garnatti one: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found