I started thinking about exam class diagram for my OpenLearning project. In this project, we need to manage different kinds of Exam.So, what is the best way to design exam class ?
To now I think the design pattern factory is best solution.In the following UML class diagram, we define an abstract class with a createExam() method and we let subclasses to decide about creation.
For example, QcmExamFactory has the responsability to create the correct qcm exam.
There is lot QCM and real exams rules, so it is highly probable that implementation change.Moreover, in this time, there is only three types of exam : test, practice and real.
But I can imagine, it will exist other.That's why, I think the design pattern factory is a good solution :
If you aren't agree with me, let me know !
Aucun commentaire:
Enregistrer un commentaire