关联末尾的点是什么意思? [英] What does the dot mean at the end of an association?

查看:33
本文介绍了关联末尾的点是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Visual Paradigm 反转了一些 Java 代码以获得 uml 类图.该图显示了一端带有小黑圈的一些关联,这是我以前从未见过的.

I reversed some Java code to get a uml class diagram using Visual Paradigm. The diagram shows some associations with little black circles on one end, which I never saw before.

图片

这绝对不是合成,也不是收容!谁能给我解释一下,这是什么关联?

It's definitely not a composition and not a containment! Can anybody explain to me, what kind of association this is?

相关代码如下:

public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> {
    public static final String TAG = DataAdapter.class.getSimpleName();

    private static Context mContext;
    private ArrayList<DataClass> mData;
    private static OnItemClickListener<DataClass> mListener;

    public static class ViewHolder extends RecyclerView.ViewHolder {}

    public DataAdapter(Context context, ArrayList<DataClass> data) {}

    public void setOnClickListener(OnItemClickListener listener) {}

    @Override
    public int getItemCount() {}

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {}

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {}
}

public interface OnItemClickListener<T> {
    public void onItemClick(T item);
}

推荐答案

您所看到的是所有权指示器,通常称为
在这种情况下,它表示关联右侧的属性为左侧的类所有.

What you are seeing is the ownership indicator, commonly known as the dot
In this case it indicates that the property at right side of the association is owned by the class on the left side.

来自 UML 规范 v2.5:

From the UML specs v2.5:

由关联分类器结束的关联所有权可能是由一个小的实心圆圈图形表示,为简洁起见,我们将术语一个点.点将被绘制为图形路径的整体线的,在它遇到分类器的点,插入线的末端和代表节点的一侧之间分类器.点的直径不得超过高度的一半聚合菱形的宽度,并且应大于线.这避免了填充菱形符号的视觉混淆同时确保它可以与线路区分开来.点表明该模型包括由表示的类型的属性点接触的分类器.该物业归另一端的分类器.在这种情况下,抑制是正常的所属分类器的属性隔间中的属性.

Ownership of Association ends by an associated Classifier may be indicated graphically by a small filled circle, which for brevity we will term a dot. The dot is to be drawn integral to the graphic path of the line, at the point where it meets the Classifier, inserted between the end of the line and the side of the node representing the Classifier. The diameter of the dot shall not exceed half the height of the aggregation diamond, and shall be larger than the width of the line. This avoids visual confusion with the filled diamond notation while ensuring that it can be distinguished from the line. The dot shows that the model includes a Property of the type represented by the Classifier touched by the dot. This Property is owned by the Classifier at the other end. In such a case it is normal to suppress the Property from the attributes compartment of the owning Classifier.

这篇关于关联末尾的点是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆