UML依赖和关联概念 [英] UML dependecy and association concept
问题描述
我一直试图理解这两个概念之间的差异,但我仍然有点困惑。
如果我有这个界面的话>界面IArticleFactory {
IArticle Create(参数p)
}
在IArticle和IArticleFactory之间有什么关系?依赖关系,关联关系或无关。
参数P和IArticleFactory之间的关系是什么?依赖,关联或无。
(有些人在界面层面没有关系)
再次
类文章工厂:IArticleFactory {
IArticle Create(参数) p){
返回IArticle =新文章(p);
与IArticle和ArticleFactory之间的关系是什么?依赖,关联或无。
Article和ArticleFactory之间的关系是什么?依赖关系,关联关系或无关。
参数P和ArticleFactory之间的关系是什么?依赖,关联或无。
感谢
Pierpaolo
Hi,
I have been trying to understand the differnce between these two concepts, however I am still a bit confused.
if I have this interface
Interface IArticleFactory {
IArticle Create(Parameter p)
}
What is the relationship beetween IArticle and IArticleFactory? Dependency, Association or none.
What is the relationship beetween Parameter P and IArticleFactory? Dependency, Association or none.
(some people show no relation at interface level)
Again
Class ArticleFactory : IArticleFactory {
IArticle Create(Parameter p) {
return IArticle = new Article(p);
}
}
What is the relationship beetween IArticle and ArticleFactory? Dependency, Association or none.
What is the relationship beetween Article and ArticleFactory? Dependency, Association or none.
What is the relationship beetween Parameter P and ArticleFactory? Dependency, Association or none.
Thanks
Pierpaolo
推荐答案
我的意见1)IArticle和ArticleFactory之间的关系是 - 关联
2)文章和ArticleFactory之间的关系是 - 关联(聚合类型)
3)参数P和ArticleFactory之间的关系是 - 依赖性
希望它有所帮助。
问候任Sudhanshu
My take
1) Relationship beetween IArticle and ArticleFactory is- Association
2) Relationship beetween Article and ArticleFactory is - Association (type of Aggregation)
3) Relationship beetween Parameter P and ArticleFactory is - Dependency
hope it helps.
Regards
Sudhanshu
这篇关于UML依赖和关联概念的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!