I was provided with a usage example for the Quizz app. The use case is only for creating new polls. I'm having trouble deciding which design is better:
and)
alt text http://dl.dropbox.com/u/6187267/shooterpics/diagram1.jpg
b)
alt text http://dl.dropbox.com/u/6187267/shooterpics/diagram2.jpg
Although it may look like a domain model, it is actually a class diagram (I was lazy to put methods / attributes in diagrams :().
The idea of ββall this is what I have QuizCatalogwith Quizzes. Each Quizhas a set of Questions that must be created through QuestionFactory(a Questionis an abstract class, and QuestionA, QuestionBetc. are concrete classes). Everyone Questionhas a set PossibleAnswers.
The difference in terms of associations between Design Aand Design Blies in the fact that in the first I consider that it CreateQuizControllersimply delegates every task that it has QuizCatalog. If he QuizCatalogmust do something, he delegates everything that may be required, according to the hierarchy. This is really nice because it seems to reduce grip.
Design B, , . , Design A, ( QuizCatalog Quiz zes, a Question PossibleAnswer s ..), CreateQuizController , ( d). , , QuizCatalog Quiz, CreateQuizController Quiz ( " Quiz", Question PossibleAnwser s ..).
, Design A:
1.
, , " " ββ(, Quiz QuizCatalog , Question s), , , Controller.
, Quiz, , , QuizCatalog, Quizzes, . . Controller, - , "" , , .
, Controller , . , , System.
2.
Design A, CreateQuizController, , QuizCatalog. , QuizCatalog, ?
, Design A, , QuestionFactory , Design B, CreateQuizController QuestionFactory.
?
PS: , Quizz 2 z:( .