Comments (2)
For me, this all looks good. I just wonder if it is best to use a builder notation, or a config dictionary.
from zigbee4java.
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
- we remove one layer to the hierarchy (less parameters to pass through)
- given that the ZigBeeApi instance is not owned by the ZigBeeConsole, we can enhance the application adding logic that otherwise would require modifying the ZigBeeConsole class. The ZigBeeConsole class is just a useful and pluggable "View" on the ZigBee network.
Cons
- The ZigBeeApi instantiation code must be duplicated in the javase and android console. However this code is just twenty lines or so.
Ciao,
Cristiano
from zigbee4java.
Related Issues (20)
- Remove serialisation from library
- Library hangs on shutdown HOT 1
- Code styling HOT 2
- Error in zcl lib definition
- Hue Tap support HOT 3
- MoveToLevel command
- Error in zigbee api ( reporting command) HOT 2
- Support for REX3S - Zigbee module HOT 1
- Xiaomi Aqara temperature humidity sensor HOT 11
- Issue regarding Dongle Reset
- Zigbee console join enable / disable reports error HOT 2
- Serial port error with Windows 10 HOT 1
- sendSynchrouns(hwDriver, request, RESEND_TIMEOUT) = null in windows 10 HOT 4
- RESEND_TIMEOUT_DEFAULT too short HOT 2
- Help needed - ZigBeeNetworkManagerImpl - Unable to reset dongle HOT 4
- CC2531 Dongle becomes unresponsive if restart occurs right after SYS_RESET
- ZigBeeConsole Slack Bot example available
- "quit" commad can't quit the console application HOT 2
- Console: removing device from network
- Split between packages? HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zigbee4java.