In the UML class diagram the interface is equivalent to the interface concept in programming languages (a set of methods that the class that implement the interface should implement). I want to know if the interface in the component diagram has the same meaning. Are the interfaces mentioned in the component diagram the same interfaces that are detailed in the class diagram or should I treat every method in the component diagram as a separate interface?
相关问题
- how to define constructor for Python's new Nam
- Keeping track of variable instances
- Object.create() bug?
- System sequence diagram - Can system request input
- std::vector of objects / pointers / smart pointers
相关文章
- 接口B继承接口A,但是又不添加新的方法。这样有什么意义吗?
- NameError: name 'self' is not defined, eve
- Implementation Strategies for Object Orientation
- Check if the Type of an Object is inherited from a
- When to use Interfaces in PHP
- Are default parameters bad practice in OOP?
- How to return new instance of subclass while initi
- In OOP, what is the best practice in regards to us
There is actually no real difference between both. You can realize an interface with a class as well as with a component. Also you can show the realization in both cases with the socket/lollipop notation.
Components are not much different to classes. You can think of a component as a container that hosts a number of different classes. And if one of those classes realizes an interface you can expose that through the component (if you so wish). Additionally a component can have a lot of internal interfaces for its hosted classes.