tlaukkan / zigbee4java

Zigbee API for Java provides simple Java interface to ZigBee network.
Apache License 2.0
144 stars 68 forks source link

Destination device address #95

Closed cdjackson closed 7 years ago

cdjackson commented 7 years ago

This is for comment more than for merging as it needs a tidyup to remove commented code...

This changes the ZigBeeDestination to ZigBeeAddress, and then has two address classes - ZigBeeGroupAddress, and ZigBeeDeviceAddress. ZigBeeDevice no longer extends ZigBeeDestination - nothing relied on this extension, and it seems much better not to have this link.

It also makes ZigBeeAddress abstract, and then move the isGroup method into the implementation classes rather than having the parent class check for subclasses to see if it's a group which doesn't seem nice.

In general, everywhere where we had a network address and endpoint, I'm now using the address. It likely needs a bit more work, but I'd welcome your thoughts on wether or not you're happy with this approach.

tlaukkan commented 7 years ago

I understand now what you meant in the other pull request. This looks quite clean and an improvement to the the destination approach. Nicely done. If you put in missing javadoc comments etc we could merge it in...