Closed amarzavery closed 5 years ago
@amarzavery Looks like most of what you have described above has already been implemented
Link
class in rhea-promise from which is extended by Sender
and Receiver
EventHubSender
and EventHubReceiver
extend from LinkEntity
ConnectionContextBase
is in amqp-common with common things factored out from Event Hubs and Service Bus.Therefore, closing this issue
Step 1:
What we have currently works fine. However, there is lot of code duplication between EventHubReceiver and EventHubSender. Most of it can be moved up into LinkEntity. LinkEntity should have a protected property named
_link
which will be of typeLink
. Todayrhea-promise
also has code duplication inSender
andReceiver
. Common code should be moved toLink
. Then the_link
will be of typeLink
.Since ManagementClient also extends
LinkEntity
and ManagementClient has a private propertyreqresLink
which is different thanLink
. Thus it would make sense to have a base class namedClientEntity
which has a child class namedLinkEntity
and may be another child namedBidirectionalLinkEntity
.EHSender
,EHReceiver
andManagementClient
can be children of the intermediate parent classes. This would sort of be the right structure of reusing common code.Step 2: If possible we should try to get as much as possible into
amqp-common
since ServiceBus and Eventhubs both have lot of common functionality. However this needs to be done carefully since there are some basic differences in the structure of ConnectionContext.