Giter Club home page Giter Club logo

Comments (6)

kevinherron avatar kevinherron commented on May 18, 2024

What if there was a copy() method hanging off OpcUaClientConfig instead which returned a OpcUaClientConfigBuilder with all of the values pre-set from the config. This way you're not encouraged to leave some reference to a mutable, non-thread-safe object like a builder laying around.

from milo.

kevinherron avatar kevinherron commented on May 18, 2024

I'm implementing this idea on UaTcpStackClientConfig and OpcUaClientConfig.

edit: and the server versions... even though it's less likely to be needed.

from milo.

ctron avatar ctron commented on May 18, 2024

Actually I just did it for the server config because I needed them most :-)

from milo.

ctron avatar ctron commented on May 18, 2024

So I will stick with my local changes and wait for your fix! Thanks!!

Just to let you know what I did. I created two additional constructors, beside the default one. Taking in "Config" and "ConfigBuilder" each. The "ConfigBuilder" just calls "this ( other.build() )", which may not be that performant, but this should not be called that often either.

But that allows one to clone the builder and also create a mutable version from an existing configuration again.

True, every type used by the configuration, should be immutable as well.

from milo.

kevinherron avatar kevinherron commented on May 18, 2024

So I've done half the work... added copy() methods to the client config objects. It's somewhat tedious and boring, especially the tests, so I'm going to take a break and implement the server ones later... 😝

from milo.

kevinherron avatar kevinherron commented on May 18, 2024

Just missing tests for the server config objects now.

from milo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.