cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Access to base Service when overriding

0 Kudos

Access to base Service when overriding

When overriding the Service of a Thing Template or Shape one does not have access to the base implementation. From my point of view this is a basic feature of the template approach.

 

Example:

  • BaseTT has Service DoSomething, allowing override
  • DerivedTT uses BaseTT as base template and overrides DoSomething
  • DerivedTT.DoSomething is only a copy. You can change it to your needs but you don't have access to BaseTT.DoSomething

 

Often I only want DerivedTT.DoSomething to execute the BaseTT.DoSomething plus calling a Service extra, do extra logging or similar.

A copy is even dangerous in this place because when changing BaseTT.DoSomething it has no impact on the copied code in DerivedTT.DoSomething, e. g. when fixing a bug.

3 Comments
olivierlp
Community Manager
Status changed to: No Plans to Implement

This is possible to see base implementations in our References/Browse window of the Service Editor for JavaScript based services.

bbeuckSIG
15-Moonstone

The suggested solution does not help me at all. I do not want to SEE but to CALL the base service.

 

I found an article on PTC support pages describing my request with some other words, obviously I am not the first asking for this.

GuillaumeLaroch
11-Garnet

Hello, I am not sure that the intent of this idea has been really understood ! The aim of such demand is to have a model which is really extensible. 

As described, if we want to add only one line in the base service, into the derived service, we need to copy paste + adding the line. But if later one, we change the base service, we also need to update everywhere it has been derived.

It would be something really useful for development & maintenance.

It's exactly like super() in JAVA.