vendredi 29 avril 2016

pattern for objects with and without context

I'm working on a system that is composed generically of questions and answers. Users of the system can use the ideas of questions and answers to design questionnaires.

When authoring questionnaires there is one type of question. Once a question is created, different types of answers can be added to it. For example, boolean answers, text answers, etc..

When executing & displaying questionnaires, the types of answers that have been added to the question are relevant in the context of the question when displaying it. So when drawing a question on the screen, I need to know what kind of answers it has, to know how to mark it up/draw it on the screen.

So there is tension between the domain ideas when considering them in either context.

The type of questions are in some ways defined by the types of answers, but I'm also not sure it's right to have multiple types of questions, one for each possible type of answer combination during authoring.

That being said, I don't feel like it's right to have to inspect the children of (answers within) the question - each time I need to figure out how to display it.

I'm confident that this kind of problem can be addressed with existing patterns, and that I just don't have the language to articulate it.

If anyone can help me re-frame this with a pattern I'd appreciate it.

Aucun commentaire:

Enregistrer un commentaire