-
Notifications
You must be signed in to change notification settings - Fork 273
Refactor concerns in Service Bus *Info and *Description classes #469
Comments
Agreed this is a design issue that adds complexity if we don't fix it. Would be good to get people on the same page for a design that is crisper. |
We agreed to fix this formerly P2 issue as well due to the breaking changes it introduces to the developer experience. |
So Albert and I brainstormed and found the best solution to be to provide additional getter methods in TopicInfo for the values in TopicDescription.
Now, another option would be to consider TopicInfo to have a Has-A relationship with Entry and Has-A with TopicDescription. We could then still add getters/setters for the TopicDescription classes. This would be the closest possible to Java in terms of experience. @Albert what do you think of this – this is an extension to the E option we had? |
I must point out that he said it is very unlikely that the header values (the ones coming from Entry) would soon be useful in for the messaging part of SB (as opposed to relays). So let's discuss the last option I mentioned tomorrow morning. |
Over the scrum, the design decision was to make both Entry and TopicDescription the 1st class citizen of the TopicInfo and expose those properties at TopicInfo level. This will have the design of TopicInfo class most closely resemble the TopicInfo class in Java. |
fix ready |
Currently, in the Java SDK, the
TopicInfo
class extendsEntryModel<TopicDescription>
, and has these public properties:It is the best of both worlds, the properties we are interested in are exposed at the top level, and the only implementation details are the
Entry
andModel
properties, which encapsulate the junk needed elsewhere. The Has-A relationship plus the facade pattern works well here.The same class in PHP is not as clean, because the
TopicInfo
extendsEntry
, so all its implementation details are top-level, while the stuff the user cares about (the model parts above) must be accessed through the TopicDescription property.Here are the properties of the PHP SDK
TopicInfo
class, which extendsEntry
:The
TopicDescription
property returns an instance of theTopicDescription
class, which has these properties:The Is-A exposes lots of implementation details that the user should never care about (and most are not even applicable for SB service), and the lack of facade means what the user does care about is hidden in one out of 16 properties.
The text was updated successfully, but these errors were encountered: