You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Ferenc Gerlits (Jira)" <ji...@apache.org> on 2023/02/07 13:18:00 UTC

[jira] [Assigned] (MINIFICPP-2029) Refactor the MQTT processors to better encapsulate dependence on the MQTT version

     [ https://issues.apache.org/jira/browse/MINIFICPP-2029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ferenc Gerlits reassigned MINIFICPP-2029:
-----------------------------------------

    Assignee:     (was: Ferenc Gerlits)

> Refactor the MQTT processors to better encapsulate dependence on the MQTT version
> ---------------------------------------------------------------------------------
>
>                 Key: MINIFICPP-2029
>                 URL: https://issues.apache.org/jira/browse/MINIFICPP-2029
>             Project: Apache NiFi MiNiFi C++
>          Issue Type: Improvement
>            Reporter: Ferenc Gerlits
>            Priority: Minor
>
> (from [https://github.com/apache/nifi-minifi-cpp/pull/1432#discussion_r1031680118] by [~lordgamez])
> [In the MQTT processors,] we rely too much on the mqtt_version_ and a lot of the function implementations are if-else branches depending on this version.
> A cleaner solution would be to collect these differing functionalities, create a separate abstract class for these functions with two separate inherited class implementations for the two versions. After we have the version in {{onSchedule}} we can instantiate the proper one and call the proper implementation in each case where it differs (strategy pattern).
> If needed the common parts can also be moved to the base class and only the differences implemented in the inherited classes (template method pattern).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)