关联末尾的点是什么意思?
What does the dot mean at the end of an association?
我使用 Visual Paradigm 逆向了一些 Java 代码以得到一个 uml class 图。该图显示了一些一端带有小黑圈的关联,这是我以前从未见过的。
绝对不是合成也不是遏制!谁能给我解释一下,这是什么协会?
相关代码如下:
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);
}
您看到的是所有权指标,通常称为 点
在这种情况下,它表示关联右侧的 属性 归左侧的 class 所有。
来自 UML 规范 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.
装饰 Geert 的正确答案:在以前的 UML 版本中,可导航性(两边的空心箭头)被(误)用于该目的。所以现在你看到一个点也意味着你可以导航到它(因为它呈现了它所接触的 class 类型的属性)。仍然可以混合使用这两种表示法。但这没有多大意义。就个人而言,我只会在概念阶段使用(如果有的话)导航箭头。
我使用 Visual Paradigm 逆向了一些 Java 代码以得到一个 uml class 图。该图显示了一些一端带有小黑圈的关联,这是我以前从未见过的。
绝对不是合成也不是遏制!谁能给我解释一下,这是什么协会?
相关代码如下:
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);
}
您看到的是所有权指标,通常称为 点
在这种情况下,它表示关联右侧的 属性 归左侧的 class 所有。
来自 UML 规范 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.
装饰 Geert 的正确答案:在以前的 UML 版本中,可导航性(两边的空心箭头)被(误)用于该目的。所以现在你看到一个点也意味着你可以导航到它(因为它呈现了它所接触的 class 类型的属性)。仍然可以混合使用这两种表示法。但这没有多大意义。就个人而言,我只会在概念阶段使用(如果有的话)导航箭头。