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

Request: interfaces #146

Open
vanillajonathan opened this issue Mar 12, 2021 · 15 comments
Open

Request: interfaces #146

vanillajonathan opened this issue Mar 12, 2021 · 15 comments

Comments

@vanillajonathan
Copy link

I would like to see the addition of provided interfaces and required interfaces. The interfaces should preferably be able to have a label. Another great thing would if the interfaces could be attached to ports. The ports should preferably be able to have a label too.

@skanaar
Copy link
Owner

skanaar commented Mar 16, 2021

Are you referring to the "circle" and "crescent"-shaped connectors as described here: https://www.uml-diagrams.org/component-diagrams.html

I would love to add them, it would be as new relation types in that case.

Ports are harder. I could add a port box at the start of the arrow.
Please provide a visual example of what you are looking for.

@vanillajonathan
Copy link
Author

Yes, I am referring to the "circle" and "crescent"-shaped connectors. I believe those are called "ball-and-socket notation" in UML.

I am trying to have a component:

  • Expose a required interface.
  • Expose a provided interface.

And be able to have a connector between one component's required interface to another component's provided interface.

The link you provided in your post contains a diagram that shows what I am looking for.

@skanaar
Copy link
Owner

skanaar commented Mar 21, 2021

OK, ball-and-socket relation types are now live on nomnoml.com

Note that since they are relations you cannot express a provided interface without referencing it. So there is some room for additional features.

nomnoml

See it in action:
https://www.nomnoml.com/#view/%5BService%5D%20required%20(-%3Eo%20provided%20%5BImplementation%5D%0A%5BA%5D%20--%3Eo%20%5BB%5D%0A%5BEngine%5D%20(o-%20%5BStrategy%7Capply()%5D%0A

@vanillajonathan
Copy link
Author

This is good and I realize doing anything more than this is going to be hard.

The notation where the ball-and-socket meets in the middle is deprecated, in modern UML, a component provides an interface, and another component requires an interface, then there is a connection between those interfaces.

|-----------o)-----------| // old UML
|-o ------------------ )-| // new UML

If this were to be according to UML then;

  • Component diagrams would have a component icon in the upper-right corner.
  • Components would be able to declare an required interface without having any connection to it.
  • Components would be able to declare a provided interface without having any connection from it.
  • Components would be able to have ports. Can have more than one port.
  • Ports can have interfaces. Can have more than one interface per port.

@skanaar
Copy link
Owner

skanaar commented Mar 22, 2021

Nice summary, it is always good to get some feedback on missing features.

Ports are difficult to add because of the layouting library nomnoml uses.

I'll keep this issue open for a while to let other people see it.

@skanaar
Copy link
Owner

skanaar commented Mar 22, 2021

I have now added node types for lollipop and socket so that required and provided interfaces can be expressed without any connections to them.

https://nomnoml.com/#view/%23direction%3A%20right%0A%5B%3Clollipop%3Einterface%5D%20-%20%5BComponent%5D%0A%5BComponent%5D%20-%20%5B%3Csocket%3EISocket%5D%0A%5BISocket%5D%20-%20%5BSocketImpl%5D

@vanillajonathan
Copy link
Author

This is now, it allows a component to have multiple required interfaces as well as multiple provided interfaces. It also allows the required interface of one component to connect to the provided interface of another component.

When the interface names are not short I do experience the text overlapping.

Yes, ports would be difficult with the layout engine because it would require a advanced layout engine that takes into account ports too. Maybe it would be possible to create a "dirty hack" for ports by making the box be the start of the edge, however this would come with limitations such as not being able to have multiple interfaces on one port.

@HauserV
Copy link

HauserV commented May 11, 2021

Thank you both for the work on this. Really appreciated.

Do you have an estimate when we could get a new version that includes this feature?

@skanaar
Copy link
Owner

skanaar commented May 12, 2021

I guess you are asking about a NPM package release?

I intentionally waited a bit to see if people found any issues with the ball and socket features in the web version.

@vanillajonathan
Copy link
Author

vanillajonathan commented May 12, 2021

@skanaar

When the interface names are not short I do experience the text overlapping.

@HauserV
Copy link

HauserV commented May 12, 2021

Exactly. Some people on our documentation team wanted to give a nomnoml a try (as an alternative to PlantUML) but since in our toolchain we let Kroki take care of diagramming for us we would need an NPM package because then it's just the matter of updating the version inside Kroki.

We have noticed that there was very little activity in this issue for some time now and so I wanted to ask about the status. Leaving more room for feedback is absolutely fine.

@skanaar
Copy link
Owner

skanaar commented May 12, 2021

v1.4.0 is now published. Please report any issues 😄

@vanillajonathan
Copy link
Author

@skanaar, Long interface names are cropped.

Example:

[<lollipop>IHttpContextAccessor] - [Component]

@vanillajonathan
Copy link
Author

@skanaar Is it possible to do anything about long interface names being cut off?

@skanaar
Copy link
Owner

skanaar commented Jun 9, 2021

Hi, yes it can be done but not immediately. I cannot spend too much time on nomnoml right now and this would require adding some capabilites to the layouting system.

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

3 participants