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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Allow for extending tags on elements #666

Open
yoHasse opened this issue May 3, 2024 · 0 comments
Open

[Feature Request] Allow for extending tags on elements #666

yoHasse opened this issue May 3, 2024 · 0 comments
Assignees

Comments

@yoHasse
Copy link

yoHasse commented May 3, 2024

Hi! 馃憢

First off, thank you for this exceptional toolkit. It has significantly simplified visualizing my designs and is incredibly intuitive! 馃檹

I'm working with a loosely coupled system spread across multiple directories (12+ and growing). It would be highly beneficial to have the ability to extend tags from one model to another without navigating the entire file structure.

I am not sure if this is the correct solution to the problem, but I can't think of anything else... 馃槬

Table of content:

Here's an example to illustrate the scenario:

Logical overview:

ExternalSourceA -> ServiceA -> MessageBroker.TopicA -> MessageBroker.SubscriptionA -> ServiceB
ExternalSourceA -> ServiceA -> MessageBroker.TopicA -> MessageBroker.SubscriptionB -> ServiceC

Current implementation sample:

/src/serviceA.c4

model {
    serviceA = context 'service A' {
        controller = container 'controller'
    }

    externalSystemA -> serviceA
    serviceA -> messageBroker.topic
    serviceA.controller -> messageBroker.topic
}

/src/serviceB.c4

model {
    serviceB = context 'service B' {
        subFetcher = container 'subFetcher'
    }

    messageBroker.subA -> serviceB.subFetcher

}

/src/serviceC.c4

model {
    serviceC = context 'service C' {
        subFetcher = container 'subFetcher'
    }

    messageBroker.subB -> serviceC.subFetcher
}

/src/externalSystemA.c4

model {
    externalSystemA = context 'externalSystemA'
}

/src/messageBroker.c4

model {
    messageBroker = context 'messageBroker' {
        topic = container 'topic'
        subA = container 'subscriptionA'
        subB = container 'subscriptionB'
    }

    messageBroker.topic -> subA
    messageBroker.topic -> subB
}

/src/views.c4

views {
    // Define views for system interaction
    view context-externalSystem2ServiceB of serviceB {
        include *, 
            serviceA, 
            externalSystemA, 
            serviceA.controller, 
            messageBroker, 
            messageBroker.topic, 
            messageBroker.subA,
    }

    view context-externalSystem2ServiceC of serviceC {
        include 
            serviceA, 
            externalSystemA, 
            serviceA.controller, 
            messageBroker, 
            messageBroker.topic, 
            messageBroker.subB,
    }
}

Example usage:

    extend serviceA {
        #externalSystem2ServiceB
    }

    extend messageBroker {
        #externalSystem2ServiceC
        subA {
            #externalSystem2ServiceB
        }
    }

After enhancement:

/src/serviceA.c4

model {
    serviceA = context 'service A' {
        controller = container 'controller'
    }

    externalSystemA -> serviceA
    serviceA -> messageBroker.topic
    serviceA.controller -> messageBroker.topic
}

/src/serviceB.c4

model {
    serviceB = context 'service B' {
        subFetcher = container 'subFetcher'
    }

    extend externalSystemA {
        #externalSystem2ServiceB
    }

    extend serviceA {
        #externalSystem2ServiceB
    }

    extend messageBroker {
        #externalSystem2ServiceB
        subA {
            #externalSystem2ServiceB
        }
    }



    messageBroker.subA -> serviceB.subFetcher

}

/src/serviceC.c4

model {
    serviceC = context 'service C' {
        subFetcher = container 'subFetcher'
    }

    extend externalSystemA {
        #externalSystem2ServiceC
    }

    extend serviceA {
        #externalSystem2ServiceC
    }

    extend messageBroker {
        #externalSystem2ServiceC
        subA {
            #externalSystem2ServiceC
        }
    }

    messageBroker.subB -> serviceC.subFetcher
}

/src/externalSystemA.c4
...

/src/messageBroker.c4
...

/src/views.c4

views {
    // Define views for system interaction
    view context-externalSystem2ServiceB of serviceB {
        include 
            *, 
            element.tag = #externalSystem2ServiceB
            
    }

    view context-externalSystem2ServiceC of serviceC {
        include 
            *,
            element.tag = #externalSystem2ServiceC
    }
}

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

No branches or pull requests

2 participants