Open cdealti opened 9 years ago
For me, this all looks good. I just wonder if it is best to use a builder notation, or a config dictionary.
I'm wondering the same thing. I've started with the builder but I don't like it. The above options and possibly more need to be passed from the outermost class to the innermost one. Some options are consumed by classes in between. With Builder we need to create a parallel hierarchy of builders one for every class so that adding a new option might require to change every builder in the hierarchy. A dictionary might be simpler especially if the above configuration is read from a file. However, simply passing the dictionary to every constructor in the hierarchy is not that safe. You don't know who is using what configuration.
I've spent more time on this... Why don't we move the instantiation of the ZigBeeApi outside of ZigBeeConsole and pass it a reference to the instance?
Pros
Cons
Ciao, Cristiano
I'd like to modify the console to support standard gnu/posix options like in the below example. In order to support this I need to slightly modify the ZigBeeConsole, ZigBeeApi and ZigBeeNetworkManagerImpl to allow for more parameters to be passed to the constructors. In order to avoid constructors with so many parameters I was thinking to the Builder pattern. Do you think this is worthwhile to add?
Cheers, Cristiano