Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create interface for Services and replace static methods with instance methods #110

Closed
massifben opened this issue Jun 17, 2022 · 0 comments · Fixed by #318 or #320
Closed

Create interface for Services and replace static methods with instance methods #110

massifben opened this issue Jun 17, 2022 · 0 comments · Fixed by #318 or #320
Assignees
Labels
enhancement New feature or request

Comments

@massifben
Copy link
Contributor

SclService and SclAutomationService offer static methods.
The suggestion is to hide the implementation behind an interface and to use instance methods instead :

  • it allows client apps to mock the services when testing
  • it allows different implementations for these services
  • it better integrates with dependency injection frameworks
@massifben massifben added the enhancement New feature or request label Jun 17, 2022
@massifben massifben self-assigned this Jun 17, 2022
samirromdhani added a commit that referenced this issue Aug 21, 2023
samirromdhani added a commit that referenced this issue Aug 22, 2023
samirromdhani added a commit that referenced this issue Aug 22, 2023
samirromdhani added a commit that referenced this issue Aug 23, 2023
…ods with instance methods

closes #110

BREAKING CHANGE: 💥 in sct-commons:
  The services which provide static methods are moved from scl to service package.
  Now  those services implements interfaces, no static methods.
  Expect for PrivateService which is an UtilityClass is renamed to PrivateUtils and moved from scl to util package.

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 23, 2023
…ods with instance methods

closes #110

BREAKING CHANGE: 💥 in sct-commons:
  The services which provide static methods are moved from scl to service package.
  Now  those services implements interfaces, no static methods.
  Expect for PrivateService which is an UtilityClass is renamed to PrivateUtils and moved from scl to util package.

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 23, 2023
…nge the package from scl to util.

Changing the name of PrivateService to PrivateUtils and move it from scl to util package , closes #110

BREAKING CHANGE: 💥 in sct-commons:
    The services which provide static methods are moved from scl to service package.
    Now  those services implements interfaces, no static methods.
    Expect for PrivateService which is an UtilityClass is renamed to PrivateUtils and moved from scl to util package.

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 23, 2023
…nge the package from scl to util.

Changing the name of PrivateService to PrivateUtils and move it from scl to util package , closes #110

BREAKING CHANGE: 💥 in sct-commons:
    The services which provide static methods are moved from scl to service package.
    Now  those services implements interfaces, no static methods.
    ℹ️ Expect for PrivateService which is an UtilityClass is renamed to PrivateUtils and moved from scl to util package.

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 23, 2023
…nge the package from scl to util.

Changing the name of PrivateService to PrivateUtils and move it from scl to util package , closes #110

BREAKING CHANGE: 💥 in sct-commons:
    The services which provide static methods are moved from scl to service package.
    Now  those services implements interfaces, no static methods.
    ℹ️ Expect for PrivateService which is an UtilityClass is renamed to PrivateUtils and moved from scl to util package.

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 23, 2023
samirromdhani added a commit that referenced this issue Aug 23, 2023
samirromdhani added a commit that referenced this issue Aug 23, 2023
samirromdhani added a commit that referenced this issue Aug 23, 2023
samirromdhani added a commit that referenced this issue Aug 25, 2023
use @requiredargsconstructor, instead of @NoArgsConstructor.
use Camel case for PrivateLinkedToStds

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 25, 2023
Remove unused test package.
Use latest version of mockito.
Fix related to version 5.4.0

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 25, 2023
Remove unused test package.
Use latest version of mockito.
Fix related to version 5.4.0

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 25, 2023
Remove unused test package.
Use latest version of mockito.
Fix related to version 5.4.0

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 25, 2023
Remove unused test package.
Use latest version of mockito.
Fix related to version 5.4.0

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 25, 2023
Remove unused test package.
Use latest version of mockito.
Fix related to version 5.4.0

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 25, 2023
samirromdhani added a commit that referenced this issue Aug 28, 2023
samirromdhani added a commit that referenced this issue Aug 28, 2023
…x 'Editor'

The interfaces are moved from scl to api package.

add package doc

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 28, 2023
SclEditor (interface) spec are reduced by adding ReadOnly and Write One

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 28, 2023
SclEditor (interface) spec are reduced by adding ReadOnly and Write One

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 28, 2023
Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 29, 2023
samirromdhani added a commit that referenced this issue Aug 29, 2023
samirromdhani added a commit that referenced this issue Aug 29, 2023
Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 29, 2023
@samirromdhani samirromdhani linked a pull request Aug 29, 2023 that will close this issue
samirromdhani added a commit that referenced this issue Aug 30, 2023
…ods with instance methods

closes #110

BREAKING CHANGE: 💥 in sct-commons:
  The services which provide static methods are moved from scl to service package.
  Now  those services implements interfaces, no static methods.
  Expect for PrivateService which is an UtilityClass is renamed to PrivateUtils and moved from scl to util package.

Signed-off-by: Samir Romdhani <[email protected]>

refactor(#110): give PrivateService the new name PrivateUtils and change the package from scl to util.

Changing the name of PrivateService to PrivateUtils and move it from scl to util package , closes #110

BREAKING CHANGE: 💥 in sct-commons:
    The services which provide static methods are moved from scl to service package.
    Now  those services implements interfaces, no static methods.
    ℹ️ Expect for PrivateService which is an UtilityClass is renamed to PrivateUtils and moved from scl to util package.

Signed-off-by: Samir Romdhani <[email protected]>

refactor(#110): update SclAutomationService

closes #110

Signed-off-by: Samir Romdhani <[email protected]>

refactor(#110): check review part1

use @requiredargsconstructor, instead of @NoArgsConstructor.
use Camel case for PrivateLinkedToStds

Signed-off-by: Samir Romdhani <[email protected]>

refactor(#110): check review part2 [use mockito properly]

Remove unused test package.
Use latest version of mockito.
Fix related to version 5.4.0

Signed-off-by: Samir Romdhani <[email protected]>

refactor(#110): review part3 [naming] remove prefix 'I' and add suffix 'Editor'

The interfaces are moved from scl to api package.

add package doc

Signed-off-by: Samir Romdhani <[email protected]>

refactor(#110): review part4 [seperate SclService features ]

SclEditor (interface) spec are reduced by adding ReadOnly and Write One

Signed-off-by: Samir Romdhani <[email protected]>

refactor(#110): sonar review

Signed-off-by: Samir Romdhani <[email protected]>

docs(#110): update demo project and quickstart page

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 30, 2023
…ods with instance methods

closes #110

BREAKING CHANGE: 💥 in sct-commons:
  The services which provide static methods are moved from scl to commons package.
  Now  those services implements interfaces, no static methods.
  Expect for PrivateService which is an UtilityClass is renamed to PrivateUtils and moved from scl to util package.

Signed-off-by: Samir Romdhani <[email protected]>

refactor(#110): give PrivateService the new name PrivateUtils and change the package from scl to util.

Changing the name of PrivateService to PrivateUtils and move it from scl to util package , closes #110

refactor(#110): update SclAutomationService

Signed-off-by: Samir Romdhani <[email protected]>

refactor(#110): check review part1

use @requiredargsconstructor, instead of @NoArgsConstructor.
use Camel case for PrivateLinkedToStds

Signed-off-by: Samir Romdhani <[email protected]>

refactor(#110): check review part2 [use mockito properly]

Remove unused test package.
Use latest version of mockito.
Fix related to version 5.4.0

Signed-off-by: Samir Romdhani <[email protected]>

refactor(#110): review part3 [naming] remove prefix 'I' and add suffix 'Editor'

The interfaces are moved from scl to api package.

add package doc

Signed-off-by: Samir Romdhani <[email protected]>

refactor(#110): review part4 [seperate SclService features ]

SclEditor (interface) spec are reduced by adding ReadOnly and Write One

Signed-off-by: Samir Romdhani <[email protected]>

refactor(#110): sonar review

Signed-off-by: Samir Romdhani <[email protected]>

docs(#110): update demo project and quickstart page

Signed-off-by: Samir Romdhani <[email protected]>
samirromdhani added a commit that referenced this issue Aug 30, 2023
…r-services-and-replace-static-methods-with-instance-methods

Create interface for Services and replace static methods with instance methods closes #110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
1 participant