-
Notifications
You must be signed in to change notification settings - Fork 1
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
interface - attribute not generated #11
Comments
Hi @huseyin39, Taking from Java programming language, an interface is a basically blueprint of methods that the class who implements the interface. In other words, an interface only contains several methods. It doesn't contain attribute or instance variables. This extension converts an interface to a Ruby module. You can look the example here. So, if this doesn't work with your case. Could you share your class diagram or example of an interface with attributes? What should generated Ruby code be? |
In Ruby module, you can have variable. It is one of the purpose of Ruby's module with methods. For example, I create an interface on StarUML 'Interface' and give it a attribute 'var' and with a value 'value'. So I expect the extension to create a module named 'Interface' with a variable named 'var' with 'value' as value. It generates I would expect it to generate:
|
Could you share resources of a Ruby module with attributes? As I understand it, an interface contains only several methods that to be implemented by a class who implements it. It can't contain attributes. If you want to add attributes, you should create an abstract class instead of interface. By the way, I don't know how to implement abstract class on Ruby. Here are some resources about interface: |
I am not talking about Java interface but about Ruby module. There is not Ruby's module in StarUML, so we can consider implementing module from StarUML's interface. See below the first line: "A Module is a collection of methods and constants." |
I see. You are talking about constants in Ruby module. Yes, this extension doesn't generate that. |
Hello,
When creating an interface on StarUML and giving an attribute, the code generation doesn't create that attribute (would be CONST of ruby).
Thanks!
The text was updated successfully, but these errors were encountered: