As I mentioned on Slack, 
I decided to give the Builder a second argument as the problem is that we'll be 
generating different variants of the drivers in the future.
Passive-Mode drivers will not have any serialize methods. And having the 
Entities provide a reference to their factories requires an instance first. 

I think this option is cleaner. 

Please have a look and if I misunderstood you, please correct me.


Chris



Am 23.01.20, 10:34 schrieb "Strljic, Matthias Milan" 
<matthias.strl...@isw.uni-stuttgart.de>:

    Sounds also nice for me. I would agree with the suggestion of julian.
    
    +1 simplicity  
    
    Greetings
    Matthias Strljic, M.Sc.
    
    ………………………………………………………………………………………………
    Interesse an Steuerungstechnik aus der Cloud und anderen Innovationen?
    Informieren Sie sich über die Stuttgarter Innovationstage vom 03.-04. März 
2020.
    https://www.stuttgarter-innovationstage.de
    ………………………………………………………………………………………………
    
    Universität Stuttgart
    Institut für Steuerungstechnik der Werkzeugmaschinen und 
Fertigungseinrichtungen (ISW)
    
    Seidenstraße 36
    70174 Stuttgart
    GERMANY
    
    Tel: +49 711 685-84530
    Fax: +49 711 685-74530
    
    E-Mail: matthias.strl...@isw.uni-stuttgart.de
    Web: http://www.isw.uni-stuttgart.de
    
    -----Ursprüngliche Nachricht-----
    Von: Julian Feinauer <j.feina...@pragmaticminds.de> 
    Gesendet: Wednesday, January 22, 2020 11:23 AM
    An: dev@plc4x.apache.org
    Betreff: Re: [CODE-GENERATION] Make all Pojos have a "toPlcValue" method?
    
    Sounds good to me.
    And probably also sublass them from an interface 
"FromFactory<CLassOfFactory>" that we can automatically get the factory class 
from a POJO (and need less reflection + String voodoo).
    
    Julian
    
    Am 22.01.20, 10:57 schrieb "Christofer Dutz" <christofer.d...@c-ware.de>:
    
        Hi all,
        
        I have recently worked a lot on drivers that have internal structures 
which are defined by the protocol:
        
          *   BACnet/IP
          *   KNCnet/IP
          *   That other protocol I worked on as a paid gig
        
        In all of these there I had to manually build lengthy “PlcStruct” 
constructs and pass them on.
        Now I think I’ll try adding a “toPlcValue” to all generated pojos … 
this way I can eliminate all of this boilerplate code.
        
        What do you think?
        
        Chris
        
        
    
    

Reply via email to