UML: how to implement Association class in Java

前端 未结 3 1077
感情败类
感情败类 2020-12-08 11:19

I have this UML Association class. Note that: horizontal line is a solid line and the vertical line is a dashed line.

 ---------                  ---------
|         


        
3条回答
  •  我在风中等你
    2020-12-08 11:50

    I know this question is very old but I have a way more convenient than embedding n..1 relations in the association class :

    public class Transcript {
        //Transcript's properties
    } 
    
    public class Course {
    
        private Map transcriptsByStudent;
    }
    
    public class Student {
    
        private Map transcriptsByCourse;
    }
    

提交回复
热议问题