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

Change the architecture of the code #81

Merged
merged 2 commits into from
Aug 16, 2019

Conversation

BuddhiWathsala
Copy link
Contributor

Purpose

Since we are growing the Siddhi operator code base we need a proper architecture to organize the code.

Goals

Change the Siddhi operator code architecture to follow the clean architecture.

Approach

Clean architecture mainly describes the dependency rules. All the functionalities of the project embedded to multiple packages accordingly. Source code packages are in a circular way. The source code dependencies can only point inwards. Nothing in an inner circle can know anything at all about something in an outer circle.

Here we used the following packages in the code.

  1. siddhiv1alpha2
    • Contains all the objects and functions related to SiddhiProcess custom resource.
  2. natsv1alpha2
    • Contains the objects and functions of Nats clusters.
  3. streamingv1alpha1
    • Contains the objects and functions of Nats streaming.
  4. artifact
    • Responsible for all the CRUD operations to the K8s cluster.
  5. messaging
    • Responsible for the messaging system operations.
  6. deploymanager
    • Responsible for deployments of the Siddhi apps.
  7. parser
    • Contained the parsing logic of the operator.
  8. siddhicontroller
    • Control all the manager operations of the Siddhi operator like update status, controlling K8s object creation, etc.

These packages can be categorized as follow.

  1. Entities
    • siddhiv1alpha2
    • natsv1alpha2
    • streamingv1alpha1
    • artifact
  2. Use cases
    • deploymanager
    • messaging
  3. Controller
    • parser
    • siddhicontroller
  4. Framework & Driver
    • siddhiprocess

For more details:

Automation tests

  • Unit tests
    • Added the artifact unit tests

Test environment

  • minikube version: v1.2.0

Learning

The clean architecture allows you to independently manage and test the specific parts of the code.

@pcnfernando pcnfernando merged commit 4a91d21 into siddhi-io:master Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants