Comments (8)
Am I the only one with this case? 😅
from dotnet.
Declaring components as interfaces shouldn't be a problem ... but what do you mean by "Component Class -- serves -> Interface Component"?
from dotnet.
Hi Simon, thanks for your response.
There's no problem declaring components as interfaces. The issue that I have is for the components that extends from the interfaces and they are used dynamically.
For example I declare a variable as an interface and it could be different components depending on each implementation of the interface.
I don't know how to show in the diagram that the mentioned variable could have different implementations.
Regards.
from dotnet.
So you have multiple implementations of a component interface?
from dotnet.
Yes, I do.
If I use any hardware device for example, I have an interface to define the methods that I will use in my software but each device have their own SDK so I extend the interface to adapt each SDK to my software. And then I load each device using reflection.
from dotnet.
You may need to write your own component finder strategy implementation in that case, as there's no easy/general way to model that situation I'm afraid. If we forget Structurizr for a minute, how would you draw the component diagram manually on a whiteboard? Would you draw one component per implementation, or a single component that represents all possible implementations? Once you understand this, you can then figure out how to represent this using the client library. One option might be to exclude those components from the component scan, and manually specify them instead. Does that help?
from dotnet.
I would like to show that my variable declared as an interface could have several implementations.
Maybe a new annotation could be created to declare what implemented classes could be that variable.
Something like that:
[UsesComponent("Different behaviour based on the consumed workflow")]
[PossibleComponents(WorkflowOne, WorkflowTwo)]
public IWorkflow CurrentWorkflow { get; private set; }
Where IWorkflow is the interface and WorkflowOne and WorkflowTwo are the classes that extend the interface and could be loaded dynamically.
What do you think?
from dotnet.
Creating your own annotations and a custom component finder strategy is certainly possible, and relatively straightforward. I'm still interested in your thoughts on how you would draw a component diagram (on a whiteboard) to represent this. Also, what tooling are you using to create the diagrams? This might be one of those situations where using a UML class diagram is the best way to show the multiple implementations, rather than the C4 model.
from dotnet.
Related Issues (20)
- problem HOT 1
- Default RankDirection not being serialized HOT 7
- EnableAutomaticLayout not working HOT 2
- dsl to C# serializer HOT 1
- EnableAutomaticLayout per default
- DefaultLayoutMergeStrategy breaks in certain scenarios HOT 4
- How can I model linked workspaces via CLI? HOT 2
- Exporting/embedding private workspace diagrams HOT 3
- Terraform support HOT 3
- Can't remove elements from model HOT 3
- Provide working example of loading layout information from an existing workspace.json HOT 1
- hi HOT 2
- Any chance for a dsl parser in c#? HOT 1
- Please make the archive-file optional HOT 3
- QUESTION: Will DSL be supported, will PutWorkspace keep working when workspace is deprecated? HOT 3
- the uploaded workspace of 0.54MB exceeds the size limit of 0.50MB HOT 3
- .net client won't preserve view custom size HOT 1
- Relationship between Person and Container not showing HOT 4
- Control RelationshipStyle on Dynamic View HOT 1
- Include mode on Filtered Views not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotnet.